{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "title": "CopilotApi",
  "description": "Describes all JSON-RPC methods exposed by the Copilot CLI server. SDK codegen tools consume this to produce typed client wrappers.",
  "server": {
    "ping": {
      "rpcMethod": "ping",
      "description": "Checks server responsiveness and returns protocol information.",
      "params": {
        "$ref": "#/definitions/PingRequest",
        "description": "Optional message to echo back to the caller."
      },
      "result": {
        "$ref": "#/definitions/PingResult",
        "description": "Server liveness response, including the echoed message, current server timestamp, and protocol version."
      },
      "stability": "experimental"
    },
    "connect": {
      "rpcMethod": "connect",
      "description": "Performs the SDK server connection handshake and validates the optional connection token. Marked internal because this is JSON-RPC transport plumbing invoked automatically by an SDK client's own `connect()` wrapper, not a user-facing method. Stays internal as long as the SDK client owns the handshake; would only become public if the SDK ever exposed the raw schema surface to consumers without a connection wrapper.",
      "params": {
        "$ref": "#/definitions/ConnectRequest",
        "description": "Connection-level opt-ins for the `server.connect` handshake. Transport authentication is consumed by the native protocol boundary before dispatch.",
        "visibility": "internal"
      },
      "result": {
        "$ref": "#/definitions/ConnectResult",
        "description": "Handshake result reporting the server's protocol version and package version on success.",
        "visibility": "internal"
      },
      "stability": "experimental",
      "visibility": "internal"
    },
    "hooks": {
      "discover": {
        "rpcMethod": "hooks.discover",
        "description": "Discovers hook actions enabled under server-side discovery settings from user, repository, plugin, and managed-policy sources.",
        "params": {
          "$ref": "#/definitions/HooksDiscoverRequest",
          "description": "Optional project paths and host-exclusion behavior for server-scoped hook discovery."
        },
        "result": {
          "$ref": "#/definitions/HooksDiscoverResult",
          "description": "Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources."
        },
        "stability": "experimental"
      }
    },
    "models": {
      "list": {
        "rpcMethod": "models.list",
        "description": "Lists Copilot models available to the authenticated user.",
        "params": {
          "$ref": "#/definitions/ModelsListRequest",
          "description": "Optional opaque account selection or compatibility GitHub token used to list models."
        },
        "result": {
          "$ref": "#/definitions/ModelList",
          "description": "List of Copilot models available to the resolved user, including capabilities and billing metadata."
        },
        "stability": "experimental"
      },
      "getBuiltInCatalog": {
        "rpcMethod": "models.getBuiltInCatalog",
        "description": "Returns the running runtime's complete catalog of well-known built-in model IDs without authentication or network access.",
        "params": null,
        "result": {
          "$ref": "#/definitions/BuiltInModelCatalog",
          "description": "The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata."
        },
        "stability": "experimental"
      }
    },
    "tools": {
      "list": {
        "rpcMethod": "tools.list",
        "description": "Lists built-in tools available for a model.",
        "params": {
          "$ref": "#/definitions/ToolsListRequest",
          "description": "Optional model identifier whose tool overrides should be applied to the listing."
        },
        "result": {
          "$ref": "#/definitions/ToolList",
          "description": "Built-in tools available for the requested model, with their parameters and instructions."
        },
        "stability": "experimental"
      }
    },
    "account": {
      "getQuota": {
        "rpcMethod": "account.getQuota",
        "description": "Gets Copilot quota usage for the current or opaquely selected authenticated user.",
        "params": {
          "$ref": "#/definitions/AccountGetQuotaRequest",
          "description": "Optional opaque account selection or compatibility GitHub token used to look up quota."
        },
        "result": {
          "$ref": "#/definitions/AccountGetQuotaResult",
          "description": "Quota usage snapshots for the resolved user, keyed by quota type."
        },
        "stability": "experimental"
      },
      "getCurrentAuth": {
        "rpcMethod": "account.getCurrentAuth",
        "description": "Gets the currently active authentication credentials from the global auth manager.",
        "params": null,
        "result": {
          "$ref": "#/definitions/AccountGetCurrentAuthResult",
          "description": "Current authentication state"
        },
        "stability": "experimental"
      },
      "getAllUsers": {
        "rpcMethod": "account.getAllUsers",
        "description": "Gets all authenticated users available for account switching.",
        "params": null,
        "result": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AccountAllUsers",
            "description": "Authenticated account entry returned by `account.getAllUsers`."
          },
          "description": "List of all authenticated users"
        },
        "stability": "experimental"
      },
      "login": {
        "rpcMethod": "account.login",
        "description": "Validates and stores authentication credentials. When login is omitted, resolves the authenticated user from the token before persistence.",
        "params": {
          "$ref": "#/definitions/AccountLoginRequest",
          "description": "Credentials to validate and store. Omit login to resolve the authenticated user from the token."
        },
        "result": {
          "$ref": "#/definitions/AccountLoginResult",
          "description": "Result of a successful login; throws on failure"
        },
        "stability": "experimental"
      },
      "logout": {
        "rpcMethod": "account.logout",
        "description": "Removes user authentication from keychain and persisted state.",
        "params": {
          "$ref": "#/definitions/AccountLogoutRequest",
          "description": "User to log out"
        },
        "result": {
          "$ref": "#/definitions/AccountLogoutResult",
          "description": "Logout result indicating if more users remain"
        },
        "stability": "experimental"
      }
    },
    "secrets": {
      "addFilterValues": {
        "rpcMethod": "secrets.addFilterValues",
        "description": "Registers secret values for redaction in session logs and exports. The SDK calls this to inject dynamically generated secret values (e.g., OIDC tokens).",
        "params": {
          "$ref": "#/definitions/SecretsAddFilterValuesRequest",
          "description": "Secret values to add to the redaction filter."
        },
        "result": {
          "$ref": "#/definitions/SecretsAddFilterValuesResult",
          "description": "Confirmation that the secret values were registered."
        },
        "stability": "experimental"
      }
    },
    "mcp": {
      "config": {
        "list": {
          "rpcMethod": "mcp.config.list",
          "description": "Lists MCP servers from user configuration.",
          "params": null,
          "result": {
            "$ref": "#/definitions/McpConfigList",
            "description": "User-configured MCP servers, keyed by server name."
          },
          "stability": "experimental"
        },
        "add": {
          "rpcMethod": "mcp.config.add",
          "description": "Adds an MCP server to user configuration.",
          "params": {
            "$ref": "#/definitions/McpConfigAddRequest",
            "description": "MCP server name and configuration to add to user configuration."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "update": {
          "rpcMethod": "mcp.config.update",
          "description": "Updates an MCP server in user configuration.",
          "params": {
            "$ref": "#/definitions/McpConfigUpdateRequest",
            "description": "MCP server name and replacement configuration to write to user configuration."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "remove": {
          "rpcMethod": "mcp.config.remove",
          "description": "Removes an MCP server from user configuration.",
          "params": {
            "$ref": "#/definitions/McpConfigRemoveRequest",
            "description": "MCP server name to remove from user configuration."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "enable": {
          "rpcMethod": "mcp.config.enable",
          "description": "Enables MCP servers in user configuration for new sessions.",
          "params": {
            "$ref": "#/definitions/McpConfigEnableRequest",
            "description": "MCP server names to enable for new sessions."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "disable": {
          "rpcMethod": "mcp.config.disable",
          "description": "Disables MCP servers in user configuration for new sessions.",
          "params": {
            "$ref": "#/definitions/McpConfigDisableRequest",
            "description": "MCP server names to disable for new sessions."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "reload": {
          "rpcMethod": "mcp.config.reload",
          "description": "Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk.",
          "params": null,
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        }
      },
      "discover": {
        "rpcMethod": "mcp.discover",
        "description": "Discovers MCP servers from user, workspace, plugin, and builtin sources.",
        "params": {
          "$ref": "#/definitions/McpDiscoverRequest",
          "description": "Optional working directory used as context for MCP server discovery."
        },
        "result": {
          "$ref": "#/definitions/McpDiscoverResult",
          "description": "MCP servers discovered from user, workspace, plugin, and built-in sources."
        },
        "stability": "experimental"
      },
      "planInstall": {
        "rpcMethod": "mcp.planInstall",
        "description": "Requests a side-effect-free MCP install plan from a catalog candidate handle or a caller-supplied card. This host-implemented server method is available through SDK/TUI hosts; standalone and C-ABI runtimes whose host does not implement server-method dispatch return JSON-RPC MethodNotFound. A runtime with planning available returns a normalised plan and opaque single-use plan handle; a runtime without it returns the typed planning-unavailable result. A completed plan reports resource identity, provenance, eligible transport choices, the user-scope target, required typed values and secret placeholders, the policy result, the configuration changes installing would make, and whether a reload would be needed. Planning never writes configuration, stores a secret, or reloads MCP servers, so abandoning a plan needs no call and leaves nothing behind.",
        "params": {
          "$ref": "#/definitions/McpPlanInstallRequest",
          "description": "A side-effect-free request for an MCP install plan. Computing a plan never writes configuration, stores a secret, or reloads MCP servers."
        },
        "result": {
          "$ref": "#/definitions/McpPlanInstallResult",
          "description": "Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case."
        },
        "stability": "experimental"
      }
    },
    "extensions": {
      "discover": {
        "rpcMethod": "extensions.discover",
        "description": "Discovers user and enabled installed-plugin extensions from persisted Copilot home state, including enablement preferences. Launch-scoped additional plugins are not included.",
        "params": null,
        "result": {
          "$ref": "#/definitions/DiscoveredExtensions",
          "description": "Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included."
        },
        "stability": "experimental"
      },
      "enable": {
        "rpcMethod": "extensions.enable",
        "description": "Persistently enables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.enable to update them.",
        "params": {
          "$ref": "#/definitions/DiscoveredExtensionsEnableRequest",
          "description": "Source-qualified extension identifiers to persistently enable for future sessions."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "extensions.disable",
        "description": "Persistently disables extension IDs for future sessions. Active sessions are unchanged; use session.extensions.disable to update them.",
        "params": {
          "$ref": "#/definitions/DiscoveredExtensionsDisableRequest",
          "description": "Source-qualified extension identifiers to persistently disable for future sessions."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "registerExtensionLaunchProvider": {
      "rpcMethod": "registerExtensionLaunchProvider",
      "description": "Registers the calling SDK client as the per-entrypoint extension launch provider. Call before creating any sessions. When omitted, the runtime uses its built-in extension launcher.",
      "params": null,
      "result": {
        "type": "null"
      },
      "stability": "experimental"
    },
    "catalog": {
      "search": {
        "rpcMethod": "catalog.search",
        "description": "Requests a bounded catalog search. This host-implemented server method is available through SDK/TUI hosts; standalone and C-ABI runtimes whose host does not implement server-method dispatch return JSON-RPC MethodNotFound. A runtime with search available returns inert candidate summaries, each with an opaque single-use handle scoped to this runtime instance; a runtime without it returns the typed search-unavailable result. Public authorities may be searched anonymously, while an authority that requires credentials yields the typed authentication-required result. All returned text, URLs, and package metadata are untrusted external data and can never trigger instructions, tools, or installation. Read-only: nothing is installed, configured, or persisted.",
        "params": {
          "$ref": "#/definitions/CatalogSearchRequest",
          "description": "A bounded catalog search. Both the query length and the result count are capped by the schema so a caller cannot request an unbounded scan."
        },
        "result": {
          "$ref": "#/definitions/CatalogSearchResult",
          "description": "Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success."
        },
        "stability": "experimental"
      }
    },
    "plugins": {
      "list": {
        "rpcMethod": "plugins.list",
        "description": "Lists plugins installed in user/global state.",
        "params": null,
        "result": {
          "$ref": "#/definitions/PluginListResult",
          "description": "Plugins installed in user/global state."
        },
        "stability": "experimental"
      },
      "install": {
        "rpcMethod": "plugins.install",
        "description": "Installs a plugin from a marketplace, GitHub repo, URL, or local path.",
        "params": {
          "$ref": "#/definitions/PluginsInstallRequest",
          "description": "Plugin source and optional working directory for relative-path resolution."
        },
        "result": {
          "$ref": "#/definitions/PluginInstallResult",
          "description": "Result of installing a plugin."
        },
        "stability": "experimental"
      },
      "uninstall": {
        "rpcMethod": "plugins.uninstall",
        "description": "Uninstalls an installed plugin.",
        "params": {
          "$ref": "#/definitions/PluginsUninstallRequest",
          "description": "Name (or spec) of the plugin to uninstall."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "update": {
        "rpcMethod": "plugins.update",
        "description": "Updates an installed plugin to its latest published version.",
        "params": {
          "$ref": "#/definitions/PluginsUpdateRequest",
          "description": "Name (or spec) of the plugin to update."
        },
        "result": {
          "$ref": "#/definitions/PluginUpdateResult",
          "description": "Result of updating a single plugin."
        },
        "stability": "experimental"
      },
      "updateAll": {
        "rpcMethod": "plugins.updateAll",
        "description": "Updates every installed plugin to its latest published version.",
        "params": null,
        "result": {
          "$ref": "#/definitions/PluginUpdateAllResult",
          "description": "Result of updating all installed plugins."
        },
        "stability": "experimental"
      },
      "enable": {
        "rpcMethod": "plugins.enable",
        "description": "Enables installed plugins for new sessions.",
        "params": {
          "$ref": "#/definitions/PluginsEnableRequest",
          "description": "Plugin names (or specs) to enable."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "plugins.disable",
        "description": "Disables installed plugins for new sessions.",
        "params": {
          "$ref": "#/definitions/PluginsDisableRequest",
          "description": "Plugin names (or specs) to disable."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "builtin": {
        "set": {
          "rpcMethod": "plugins.builtin.set",
          "description": "Replaces this server's trusted built-in plugin directories while no sessions are active.",
          "params": {
            "$ref": "#/definitions/PluginsBuiltinSetRequest",
            "description": "Trusted built-in plugin directories to use for this runtime process."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        }
      },
      "marketplaces": {
        "list": {
          "rpcMethod": "plugins.marketplaces.list",
          "description": "Lists all registered marketplaces (defaults + user-added).",
          "params": null,
          "result": {
            "$ref": "#/definitions/MarketplaceListResult",
            "description": "All registered marketplaces, including built-in defaults."
          },
          "stability": "experimental"
        },
        "add": {
          "rpcMethod": "plugins.marketplaces.add",
          "description": "Registers a new marketplace from a source (owner/repo, URL, or local path).",
          "params": {
            "$ref": "#/definitions/PluginsMarketplacesAddRequest",
            "description": "Marketplace source and optional working directory for relative-path resolution."
          },
          "result": {
            "$ref": "#/definitions/MarketplaceAddResult",
            "description": "Result of registering a new marketplace."
          },
          "stability": "experimental"
        },
        "remove": {
          "rpcMethod": "plugins.marketplaces.remove",
          "description": "Removes a previously-registered marketplace. When the marketplace has dependent plugins and `force` is not set, the marketplace is left intact and the result lists the dependents so the caller can decide whether to retry with `force=true`.",
          "params": {
            "$ref": "#/definitions/PluginsMarketplacesRemoveRequest",
            "description": "Name of the marketplace to remove and an optional force flag."
          },
          "result": {
            "$ref": "#/definitions/MarketplaceRemoveResult",
            "description": "Outcome of the remove attempt, including dependent-plugin info when applicable."
          },
          "stability": "experimental"
        },
        "browse": {
          "rpcMethod": "plugins.marketplaces.browse",
          "description": "Lists plugins advertised by a registered marketplace.",
          "params": {
            "$ref": "#/definitions/PluginsMarketplacesBrowseRequest",
            "description": "Name of the marketplace whose plugin catalog to fetch."
          },
          "result": {
            "$ref": "#/definitions/MarketplaceBrowseResult",
            "description": "Plugins advertised by the marketplace."
          },
          "stability": "experimental"
        },
        "refresh": {
          "rpcMethod": "plugins.marketplaces.refresh",
          "description": "Re-fetches one or all registered marketplace catalogs.",
          "params": {
            "$ref": "#/definitions/PluginsMarketplacesRefreshRequest",
            "description": "Optional marketplace name; omit to refresh all."
          },
          "result": {
            "$ref": "#/definitions/MarketplaceRefreshResult",
            "description": "Result of refreshing one or more marketplace catalogs."
          },
          "stability": "experimental"
        }
      }
    },
    "skills": {
      "config": {
        "setDisabledSkills": {
          "rpcMethod": "skills.config.setDisabledSkills",
          "description": "Replaces the global list of disabled skills.",
          "params": {
            "$ref": "#/definitions/SkillsConfigSetDisabledSkillsRequest",
            "description": "Skill names to mark as disabled in global configuration, replacing any previous list."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "setSkillDisabled": {
          "rpcMethod": "skills.config.setSkillDisabled",
          "description": "Atomically adds or removes one skill from the disabled list.",
          "params": {
            "$ref": "#/definitions/SkillsConfigSetSkillDisabledRequest",
            "description": "Adds or removes a single skill from the global disabled list, leaving every other entry untouched."
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        }
      },
      "discover": {
        "rpcMethod": "skills.discover",
        "description": "Discovers skills across global and project sources.",
        "params": {
          "$ref": "#/definitions/SkillsDiscoverRequest",
          "description": "Optional project paths and additional skill directories to include in discovery."
        },
        "result": {
          "$ref": "#/definitions/ServerSkillList",
          "description": "Skills discovered across global and project sources."
        },
        "stability": "experimental"
      },
      "getDiscoveryPaths": {
        "rpcMethod": "skills.getDiscoveryPaths",
        "description": "Returns the canonical directories where a client may create skills that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.",
        "params": {
          "$ref": "#/definitions/SkillsGetDiscoveryPathsRequest",
          "description": "Optional project paths to enumerate."
        },
        "result": {
          "$ref": "#/definitions/SkillDiscoveryPathList",
          "description": "Canonical locations where skills can be created so the runtime will recognize them."
        },
        "stability": "experimental"
      }
    },
    "agents": {
      "discover": {
        "rpcMethod": "agents.discover",
        "description": "Discovers custom agents across user, project, plugin, and remote sources.",
        "params": {
          "$ref": "#/definitions/AgentsDiscoverRequest",
          "description": "Optional project paths to include in agent discovery."
        },
        "result": {
          "$ref": "#/definitions/ServerAgentList",
          "description": "Agents discovered across user, project, plugin, and remote sources."
        },
        "stability": "experimental"
      },
      "getDiscoveryPaths": {
        "rpcMethod": "agents.getDiscoveryPaths",
        "description": "Returns the canonical directories where a client may create custom agents that the runtime will recognize, including ones that do not exist yet. Project directories become active once created.",
        "params": {
          "$ref": "#/definitions/AgentsGetDiscoveryPathsRequest",
          "description": "Optional project paths to include when enumerating agent discovery directories."
        },
        "result": {
          "$ref": "#/definitions/AgentDiscoveryPathList",
          "description": "Canonical locations where custom agents can be created so the runtime will recognize them."
        },
        "stability": "experimental"
      }
    },
    "instructions": {
      "discover": {
        "rpcMethod": "instructions.discover",
        "description": "Discovers instruction sources across user, repository, and plugin sources.",
        "params": {
          "$ref": "#/definitions/InstructionsDiscoverRequest",
          "description": "Optional project paths to include in instruction discovery."
        },
        "result": {
          "$ref": "#/definitions/ServerInstructionSourceList",
          "description": "Instruction sources discovered across user, repository, and plugin sources."
        },
        "stability": "experimental"
      },
      "getDiscoveryPaths": {
        "rpcMethod": "instructions.getDiscoveryPaths",
        "description": "Returns the canonical files and directories where a client may create custom instructions that the runtime will recognize, including ones that do not exist yet. Repository targets become active once created.",
        "params": {
          "$ref": "#/definitions/InstructionsGetDiscoveryPathsRequest",
          "description": "Optional project paths to include when enumerating instruction discovery targets."
        },
        "result": {
          "$ref": "#/definitions/InstructionDiscoveryPathList",
          "description": "Canonical files and directories where custom instructions can be created so the runtime will recognize them."
        },
        "stability": "experimental"
      }
    },
    "commands": {
      "list": {
        "rpcMethod": "commands.list",
        "description": "Lists the well-known built-in slash commands that work as the first message in a new session (e.g. /plan, /env), without requiring an active session. Commands that depend on session state, authentication, or a synced session are omitted.",
        "params": null,
        "result": {
          "$ref": "#/definitions/CommandList",
          "description": "Slash commands available in the session, after applying any include/exclude filters."
        },
        "stability": "experimental"
      }
    },
    "user": {
      "settings": {
        "reload": {
          "rpcMethod": "user.settings.reload",
          "description": "Drops this runtime process's in-memory user settings cache so the next settings read observes disk.",
          "params": null,
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "get": {
          "rpcMethod": "user.settings.get",
          "description": "Lists every known user setting (settings.json overlaid with the legacy config.json, config.json wins), each with its effective value, its default, and whether it is at the default — so settings the user has never set still appear with their default value. Does not include repository- or enterprise-managed overrides that the runtime layers on top at session time.",
          "params": null,
          "result": {
            "$ref": "#/definitions/UserSettingsGetResult",
            "description": "Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides."
          },
          "stability": "experimental"
        },
        "set": {
          "rpcMethod": "user.settings.set",
          "description": "Writes one or more user settings to settings.json, replacing each provided top-level key. A key whose value is null is removed. Returns the keys whose new value is shadowed by a legacy config.json entry (config.json wins on read), which the runtime leaves in place — such writes do not take effect until the legacy value is removed.",
          "params": {
            "$ref": "#/definitions/UserSettingsSetRequest",
            "description": "Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed."
          },
          "result": {
            "$ref": "#/definitions/UserSettingsSetResult",
            "description": "Outcome of writing user settings."
          },
          "stability": "experimental"
        }
      }
    },
    "managedSettings": {
      "read": {
        "rpcMethod": "managedSettings.read",
        "description": "Discovers device-managed settings from production MDM and managed-file sources, validates them against the runtime-owned managed-settings schema, and returns the canonical JSON without requiring a session.",
        "params": null,
        "result": {
          "$ref": "#/definitions/ManagedSettingsReadResult",
          "description": "Validated device-managed settings discovered before a session exists."
        },
        "stability": "experimental"
      }
    },
    "runtime": {
      "shutdown": {
        "rpcMethod": "runtime.shutdown",
        "description": "Gracefully shuts down an SDK-owned runtime. The response is sent only after cleanup completes; callers may then terminate the owned runtime process.",
        "params": null,
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "sessionFs": {
      "setProvider": {
        "rpcMethod": "sessionFs.setProvider",
        "description": "Registers an SDK client as the session filesystem provider.",
        "params": {
          "$ref": "#/definitions/SessionFsSetProviderRequest",
          "description": "Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider."
        },
        "result": {
          "$ref": "#/definitions/SessionFsSetProviderResult",
          "description": "Indicates whether the calling client was registered as the session filesystem provider."
        },
        "stability": "experimental"
      }
    },
    "llmInference": {
      "setProvider": {
        "rpcMethod": "llmInference.setProvider",
        "description": "Registers an SDK client as the LLM inference callback provider.",
        "params": null,
        "result": {
          "$ref": "#/definitions/LlmInferenceSetProviderResult",
          "description": "Indicates whether the calling client was registered as the LLM inference provider."
        },
        "stability": "experimental"
      },
      "httpResponseStart": {
        "rpcMethod": "llmInference.httpResponseStart",
        "description": "Delivers the response head (status + headers) for an in-flight request, correlated by the requestId the runtime supplied in httpRequestStart. Must be called exactly once per request before any httpResponseChunk frames.",
        "params": {
          "$ref": "#/definitions/LlmInferenceHttpResponseStartRequest",
          "description": "Response head."
        },
        "result": {
          "$ref": "#/definitions/LlmInferenceHttpResponseStartResult",
          "description": "Whether the start frame was accepted."
        },
        "stability": "experimental"
      },
      "httpResponseChunk": {
        "rpcMethod": "llmInference.httpResponseChunk",
        "description": "Delivers a body byte range (or a terminal transport error) for an in-flight response, correlated by requestId. Set `end` true on the last chunk. When `error` is set the response terminates with a transport-level failure and the runtime raises an APIConnectionError.",
        "params": {
          "$ref": "#/definitions/LlmInferenceHttpResponseChunkRequest",
          "description": "A response body chunk or terminal error."
        },
        "result": {
          "$ref": "#/definitions/LlmInferenceHttpResponseChunkResult",
          "description": "Whether the chunk was accepted."
        },
        "stability": "experimental"
      }
    },
    "sessions": {
      "open": {
        "rpcMethod": "sessions.open",
        "description": "Creates or resumes a local session and returns the opened session ID.",
        "params": {
          "$ref": "#/definitions/SessionOpenParams",
          "description": "Open a session by creating, resuming, attaching, connecting to a remote, or handing off."
        },
        "result": {
          "$ref": "#/definitions/SessionOpenResult",
          "description": "Result of opening a session."
        },
        "stability": "experimental"
      },
      "fork": {
        "rpcMethod": "sessions.fork",
        "description": "Creates a new session by forking persisted history from an existing session.",
        "params": {
          "$ref": "#/definitions/SessionsForkRequest",
          "description": "Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session."
        },
        "result": {
          "$ref": "#/definitions/SessionsForkResult",
          "description": "Identifier and optional friendly name assigned to the newly forked session."
        },
        "stability": "experimental"
      },
      "connect": {
        "rpcMethod": "sessions.connect",
        "description": "Connects to an existing remote session and exposes it as an SDK session.",
        "params": {
          "$ref": "#/definitions/ConnectRemoteSessionParams",
          "description": "Remote session connection parameters."
        },
        "result": {
          "$ref": "#/definitions/RemoteSessionConnectionResult",
          "description": "Remote session connection result."
        },
        "stability": "experimental"
      },
      "list": {
        "rpcMethod": "sessions.list",
        "description": "Lists sessions, optionally filtered by source and working-directory context. Returned entries are discriminated by `isRemote`: local entries carry only the lightweight `LocalSessionMetadataValue` shape; remote entries carry the full `RemoteSessionMetadataValue` shape (repository, PR number, taskType, etc.).",
        "params": {
          "$ref": "#/definitions/SessionsListRequest",
          "description": "Optional source filter, metadata-load limit, and context filter applied to the returned sessions."
        },
        "result": {
          "$ref": "#/definitions/SessionList",
          "description": "Sessions matching the filter, ordered most-recently-modified first."
        },
        "stability": "experimental"
      },
      "getMetadata": {
        "rpcMethod": "sessions.getMetadata",
        "description": "Reads lightweight persisted metadata for one local session without opening it.",
        "params": {
          "$ref": "#/definitions/SessionsGetMetadataRequest",
          "description": "Session ID whose persisted metadata should be read."
        },
        "result": {
          "$ref": "#/definitions/SessionsGetMetadataResult",
          "description": "Persisted local session metadata when the session exists."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "readPersistedEvents": {
        "rpcMethod": "sessions.readPersistedEvents",
        "description": "Reads a page of durable events directly from a local session's persisted journal without creating, resuming, or activating the session. The initial backward read uses a bounded tail scan for fast first paint; cursor continuations preserve the session event-log paging semantics. Persisted events may omit payloads that are reconstructed only for an active session.",
        "params": {
          "$ref": "#/definitions/SessionsReadPersistedEventsRequest",
          "description": "Pagination options for reading an inactive or active local session's persisted event journal."
        },
        "result": {
          "$ref": "#/definitions/EventsReadResult",
          "description": "Batch of session events returned by a read, with cursor and continuation metadata."
        },
        "stability": "experimental"
      },
      "listNonEmptySessionIds": {
        "rpcMethod": "sessions.listNonEmptySessionIds",
        "description": "Lists recent local session IDs that contain user-visible history, omitting housekeeping-only sessions.",
        "params": {
          "$ref": "#/definitions/SessionsListNonEmptySessionIdsRequest",
          "description": "Limit for non-empty local session IDs."
        },
        "result": {
          "$ref": "#/definitions/SessionsListNonEmptySessionIdsResult",
          "description": "Recent local session IDs that contain user-visible history."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "findByTaskId": {
        "rpcMethod": "sessions.findByTaskId",
        "description": "Finds the local session bound to a GitHub task ID, if any.",
        "params": {
          "$ref": "#/definitions/SessionsFindByTaskIDRequest",
          "description": "GitHub task ID to look up."
        },
        "result": {
          "$ref": "#/definitions/SessionsFindByTaskIDResult",
          "description": "ID of the local session bound to the given GitHub task, or omitted when none."
        },
        "stability": "experimental"
      },
      "findByPrefix": {
        "rpcMethod": "sessions.findByPrefix",
        "description": "Resolves a UUID prefix to a unique session ID, if exactly one session matches.",
        "params": {
          "$ref": "#/definitions/SessionsFindByPrefixRequest",
          "description": "UUID prefix to resolve to a unique session ID."
        },
        "result": {
          "$ref": "#/definitions/SessionsFindByPrefixResult",
          "description": "Session ID matching the prefix, omitted when no unique match exists."
        },
        "stability": "experimental"
      },
      "getLastForContext": {
        "rpcMethod": "sessions.getLastForContext",
        "description": "Returns the most-relevant prior session for a given working-directory context.",
        "params": {
          "$ref": "#/definitions/SessionsGetLastForContextRequest",
          "description": "Optional working-directory context used to score session relevance."
        },
        "result": {
          "$ref": "#/definitions/SessionsGetLastForContextResult",
          "description": "Most-relevant session ID for the supplied context, or omitted when no sessions exist."
        },
        "stability": "experimental"
      },
      "getEventFilePath": {
        "rpcMethod": "sessions.getEventFilePath",
        "description": "Computes the absolute path to a session's persisted events.jsonl file. Internal: filesystem paths are only meaningful in-process (CLI and runtime share a filesystem). Currently used by the CLI's contribution-graph feature to read historical events directly. Remote SDK consumers must not depend on this; a proper event-query API would replace it if the contribution graph ever needed to work over the wire.",
        "params": {
          "$ref": "#/definitions/SessionsGetEventFilePathRequest",
          "description": "Session ID whose event-log file path to compute."
        },
        "result": {
          "$ref": "#/definitions/SessionsGetEventFilePathResult",
          "description": "Absolute path to the session's events.jsonl file on disk."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "getSizes": {
        "rpcMethod": "sessions.getSizes",
        "description": "Returns the on-disk byte size of each session's workspace directory.",
        "params": null,
        "result": {
          "$ref": "#/definitions/SessionSizes",
          "description": "Map of sessionId -> on-disk size in bytes for each session's workspace directory."
        },
        "stability": "experimental"
      },
      "checkInUse": {
        "rpcMethod": "sessions.checkInUse",
        "description": "Returns the subset of the supplied session IDs that are currently held by another running process.",
        "params": {
          "$ref": "#/definitions/SessionsCheckInUseRequest",
          "description": "Session IDs to test for live in-use locks."
        },
        "result": {
          "$ref": "#/definitions/SessionsCheckInUseResult",
          "description": "Session IDs from the input set that are currently in use by another process."
        },
        "stability": "experimental"
      },
      "getPersistedRemoteSteerable": {
        "rpcMethod": "sessions.getPersistedRemoteSteerable",
        "description": "Returns a session's persisted remote-steerable flag, if any has been recorded. Internal: this is CLI-specific book-keeping used by `--continue` / `--resume` to inherit the prior session's remote-steerable preference. SDK consumers that want similar behavior should manage their own persistence around start/stop calls rather than relying on this runtime-side flag.",
        "params": {
          "$ref": "#/definitions/SessionsGetPersistedRemoteSteerableRequest",
          "description": "Session ID to look up the persisted remote-steerable flag for."
        },
        "result": {
          "$ref": "#/definitions/SessionsGetPersistedRemoteSteerableResult",
          "description": "The session's persisted remote-steerable flag, or omitted when no value has been persisted."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "close": {
        "rpcMethod": "sessions.close",
        "description": "Closes a session: emits shutdown, flushes pending events, releases the in-use lock, and disposes the active session.",
        "params": {
          "$ref": "#/definitions/SessionsCloseRequest",
          "description": "Session ID to close."
        },
        "result": {
          "$ref": "#/definitions/SessionsCloseResult",
          "description": "Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active."
        },
        "stability": "experimental"
      },
      "bulkDelete": {
        "rpcMethod": "sessions.bulkDelete",
        "description": "Closes, deactivates, and deletes a set of sessions, returning the bytes freed per session.",
        "params": {
          "$ref": "#/definitions/SessionsBulkDeleteRequest",
          "description": "Session IDs to close, deactivate, and delete from disk."
        },
        "result": {
          "$ref": "#/definitions/SessionBulkDeleteResult",
          "description": "Map of sessionId -> bytes freed by removing the session's workspace directory."
        },
        "stability": "experimental"
      },
      "delete": {
        "rpcMethod": "sessions.delete",
        "description": "Deletes one local session from disk after running the same lifecycle hooks as the session manager.",
        "params": {
          "$ref": "#/definitions/SessionsDeleteRequest",
          "description": "Session ID to delete from disk."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "pruneOld": {
        "rpcMethod": "sessions.pruneOld",
        "description": "Deletes sessions older than the given threshold, with optional dry-run and exclusion list.",
        "params": {
          "$ref": "#/definitions/SessionsPruneOldRequest",
          "description": "Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true)."
        },
        "result": {
          "$ref": "#/definitions/SessionPruneResult",
          "description": "Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag."
        },
        "stability": "experimental"
      },
      "save": {
        "rpcMethod": "sessions.save",
        "description": "Flushes a session's pending events to disk.",
        "params": {
          "$ref": "#/definitions/SessionsSaveRequest",
          "description": "Session ID whose pending events should be flushed to disk."
        },
        "result": {
          "$ref": "#/definitions/SessionsSaveResult",
          "description": "Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed)."
        },
        "stability": "experimental"
      },
      "releaseLock": {
        "rpcMethod": "sessions.releaseLock",
        "description": "Releases the in-use lock held by this process for a session.",
        "params": {
          "$ref": "#/definitions/SessionsReleaseLockRequest",
          "description": "Session ID whose in-use lock should be released."
        },
        "result": {
          "$ref": "#/definitions/SessionsReleaseLockResult",
          "description": "Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session."
        },
        "stability": "experimental"
      },
      "enrichMetadata": {
        "rpcMethod": "sessions.enrichMetadata",
        "description": "Backfills missing summary and context fields on the supplied session metadata records.",
        "params": {
          "$ref": "#/definitions/SessionsEnrichMetadataRequest",
          "description": "Session metadata records to enrich with summary and context information."
        },
        "result": {
          "$ref": "#/definitions/SessionEnrichMetadataResult",
          "description": "The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted."
        },
        "stability": "experimental"
      },
      "reloadPluginHooks": {
        "rpcMethod": "sessions.reloadPluginHooks",
        "description": "Reloads user, plugin, and (optionally) repo hooks on the active session.",
        "params": {
          "$ref": "#/definitions/SessionsReloadPluginHooksRequest",
          "description": "Active session ID and an optional flag for deferring repo-level hooks until folder trust."
        },
        "result": {
          "$ref": "#/definitions/SessionsReloadPluginHooksResult",
          "description": "Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId."
        },
        "stability": "experimental"
      },
      "loadDeferredRepoHooks": {
        "rpcMethod": "sessions.loadDeferredRepoHooks",
        "description": "Loads previously-deferred repo-level hooks on the active session, returning queued startup prompts.",
        "params": {
          "$ref": "#/definitions/SessionsLoadDeferredRepoHooksRequest",
          "description": "Active session ID whose deferred repo-level hooks should be loaded."
        },
        "result": {
          "$ref": "#/definitions/SessionLoadDeferredRepoHooksResult",
          "description": "Queued repo-level startup prompts and the total hook command count after loading."
        },
        "stability": "experimental"
      },
      "setAdditionalPlugins": {
        "rpcMethod": "sessions.setAdditionalPlugins",
        "description": "Replaces the manager-wide additional plugins registered with the session manager.",
        "params": {
          "$ref": "#/definitions/SessionsSetAdditionalPluginsRequest",
          "description": "Manager-wide additional plugins to register; replaces any previously-configured set."
        },
        "result": {
          "$ref": "#/definitions/SessionsSetAdditionalPluginsResult",
          "description": "Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload."
        },
        "stability": "experimental"
      },
      "getBoardEntryCount": {
        "rpcMethod": "sessions.getBoardEntryCount",
        "description": "Gets the dynamic-context board entry count associated with a session, when available. Internal: this exists solely so CLI telemetry events (`rem_spawn_gate`, `rem_consolidation_complete`) can pair START / END board counts around the detached rem-agent spawn. \"Dynamic context board\" is a runtime-internal concept that is not part of the public SDK contract; the long-term plan is to relocate the telemetry emission into the runtime so this method can be deleted entirely.",
        "params": {
          "$ref": "#/definitions/SessionsGetBoardEntryCountRequest",
          "description": "Session ID whose board entry count should be returned."
        },
        "result": {
          "$ref": "#/definitions/SessionsGetBoardEntryCountResult",
          "description": "Dynamic-context board entry count, when available."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "startRemoteControl": {
        "rpcMethod": "sessions.startRemoteControl",
        "description": "Attaches the runtime-managed remote-control singleton to a session, awaiting initial setup. If remote control is already attached to a different session, the singleton is transferred (preserving the underlying Mission Control connection). Returns the final status.",
        "params": {
          "$ref": "#/definitions/SessionsStartRemoteControlRequest",
          "description": "Parameters for attaching the remote-control singleton to a session."
        },
        "result": {
          "$ref": "#/definitions/RemoteControlStatusResult",
          "description": "Wrapper for the singleton's current status."
        },
        "stability": "experimental"
      },
      "transferRemoteControl": {
        "rpcMethod": "sessions.transferRemoteControl",
        "description": "Atomically rebinds the remote-control singleton to a different session, preserving the underlying Mission Control connection. When `expectedFromSessionId` is provided and does not match the singleton's current `attachedSessionId`, the transfer is rejected with `transferred: false` and the current status is returned unchanged.",
        "params": {
          "$ref": "#/definitions/SessionsTransferRemoteControlRequest",
          "description": "Parameters for atomically rebinding the remote-control singleton."
        },
        "result": {
          "$ref": "#/definitions/RemoteControlTransferResult",
          "description": "Outcome of a transferRemoteControl call."
        },
        "stability": "experimental"
      },
      "setRemoteControlSteering": {
        "rpcMethod": "sessions.setRemoteControlSteering",
        "description": "Patches the steering state of the active remote-control singleton. When remote control is off, this is a no-op and the off status is returned. Today only `enabled: true` is actionable on the underlying exporter; passing `false` is reserved for future use.",
        "params": {
          "$ref": "#/definitions/SessionsSetRemoteControlSteeringRequest",
          "description": "Patch for the singleton's steering state."
        },
        "result": {
          "$ref": "#/definitions/RemoteControlStatusResult",
          "description": "Wrapper for the singleton's current status."
        },
        "stability": "experimental"
      },
      "stopRemoteControl": {
        "rpcMethod": "sessions.stopRemoteControl",
        "description": "Stops the remote-control singleton. When `expectedSessionId` is provided and does not match the singleton's current `attachedSessionId`, the stop is rejected with `stopped: false` and the current status is returned unchanged (unless `force` is set, in which case the singleton is unconditionally torn down).",
        "params": {
          "$ref": "#/definitions/SessionsStopRemoteControlRequest",
          "description": "Parameters for stopping the remote-control singleton."
        },
        "result": {
          "$ref": "#/definitions/RemoteControlStopResult",
          "description": "Outcome of a stopRemoteControl call."
        },
        "stability": "experimental"
      },
      "getRemoteControlStatus": {
        "rpcMethod": "sessions.getRemoteControlStatus",
        "description": "Returns the current state of the remote-control singleton, including the attached session id and frontend URL when active.",
        "params": null,
        "result": {
          "$ref": "#/definitions/RemoteControlStatusResult",
          "description": "Wrapper for the singleton's current status."
        },
        "stability": "experimental"
      },
      "registerExtensionToolsOnSession": {
        "rpcMethod": "sessions.registerExtensionToolsOnSession",
        "description": "Registers extension-provided tools on the given session, gated by an optional `enabled` callback. Returns an opaque unsubscribe function the caller must invoke to deregister the tools when the extension is torn down. Marked internal because `loader`, `enabled`, and the returned `unsubscribe` are in-process handles that cannot cross the JSON-RPC boundary. Disappears once extension discovery / launch / tool registration are owned by the runtime: SDK consumers will pass pure config (search paths, disabled ids) via `SessionOptions` and the runtime will resolve, launch, register, and tear down extensions itself.",
        "params": {
          "$ref": "#/definitions/RegisterExtensionToolsParams",
          "description": "Params to attach an extension loader's tools to a session.",
          "visibility": "internal"
        },
        "result": {
          "$ref": "#/definitions/RegisterExtensionToolsResult",
          "description": "Handle for releasing the extension tool registration.",
          "visibility": "internal"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "configureSessionExtensions": {
        "rpcMethod": "sessions.configureSessionExtensions",
        "description": "Attaches (or detaches) an in-process ExtensionController delegate for the given session, used by shared-API surfaces that need to query or modify the session's extension state. Pass `controller: undefined` to detach. Marked internal because the controller is an in-process object that cannot cross the JSON-RPC boundary. Disappears alongside `registerExtensionToolsOnSession`: once the runtime owns extension management, the public surface exposes list/enable/disable/reload as dedicated RPCs served by the runtime.",
        "params": {
          "$ref": "#/definitions/ConfigureSessionExtensionsParams",
          "description": "Params to attach or detach an in-process ExtensionController delegate.",
          "visibility": "internal"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      }
    },
    "agentRegistry": {
      "spawn": {
        "rpcMethod": "agentRegistry.spawn",
        "description": "Spawns a managed-server child with the supplied configuration and returns a discriminated-union result. The caller (typically the CLI controller) is responsible for attaching to the spawned child and sending any follow-up prompt. When the controller-local spawn gate is closed the server returns JSON-RPC MethodNotFound.",
        "params": {
          "$ref": "#/definitions/AgentRegistrySpawnRequest",
          "description": "Inputs to spawn a managed-server child via the controller's spawn delegate."
        },
        "result": {
          "$ref": "#/definitions/AgentRegistrySpawnResult",
          "description": "Outcome of an agentRegistry.spawn call."
        },
        "stability": "experimental"
      }
    }
  },
  "session": {
    "suspend": {
      "rpcMethod": "session.suspend",
      "description": "Suspends the session while preserving persisted state for later resume.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          }
        },
        "required": [
          "sessionId"
        ],
        "additionalProperties": false,
        "description": "Identifies the target session."
      },
      "result": {
        "type": "null"
      },
      "stability": "experimental"
    },
    "send": {
      "rpcMethod": "session.send",
      "description": "Sends a user message to the session and returns its message ID.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "prompt": {
            "type": "string",
            "description": "The user message text"
          },
          "displayPrompt": {
            "type": "string",
            "description": "If provided, this is shown in the timeline instead of `prompt`"
          },
          "attachments": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/Attachment",
              "description": "A user message attachment — a file, directory, code selection, blob, GitHub-anchored pointer, or extension-supplied context payload"
            },
            "description": "Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message"
          },
          "mode": {
            "$ref": "#/definitions/SendMode",
            "description": "How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn."
          },
          "prepend": {
            "type": "boolean",
            "description": "If true, adds the message to the front of the queue instead of the end"
          },
          "billable": {
            "type": "boolean",
            "description": "If false, this message will not trigger a Premium Request Unit charge. User messages default to billable."
          },
          "requiredTool": {
            "type": "string",
            "description": "If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange"
          },
          "source": {
            "type": "string",
            "pattern": "^(user|system|command-.*|schedule-\\d+|agent-.+)$",
            "description": "Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent.",
            "visibility": "internal"
          },
          "agentMode": {
            "$ref": "#/definitions/SendAgentMode",
            "description": "The UI mode the agent was in when this message was sent. Defaults to the session's current mode."
          },
          "requestHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key."
          },
          "traceparent": {
            "type": "string",
            "description": "W3C Trace Context traceparent header for distributed tracing of this agent turn"
          },
          "tracestate": {
            "type": "string",
            "description": "W3C Trace Context tracestate header for distributed tracing"
          },
          "wait": {
            "type": "boolean",
            "description": "If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly."
          }
        },
        "required": [
          "sessionId",
          "prompt"
        ],
        "additionalProperties": false,
        "description": "Parameters for sending a user message to the session",
        "title": "SendRequest",
        "stability": "experimental"
      },
      "result": {
        "$ref": "#/definitions/SendResult",
        "description": "Result of sending a user message"
      },
      "stability": "experimental"
    },
    "sendMessages": {
      "rpcMethod": "session.sendMessages",
      "description": "Sends zero or more user messages to the session in a single turn and returns their message IDs. All provided messages are appended to the conversation in order, then exactly one agent turn runs over the resulting history. When the list is empty, one turn runs over the existing history with no new user message. Remote-backed (Mission Control) sessions do not support this method and will return an error.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/SendMessageItem",
              "description": "A single user message to append to the session as part of a `session.sendMessages` turn"
            },
            "description": "The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message."
          },
          "mode": {
            "$ref": "#/definitions/SendMode",
            "description": "How to deliver the messages. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn."
          },
          "prepend": {
            "type": "boolean",
            "description": "If true, adds the messages to the front of the queue instead of the end"
          },
          "agentMode": {
            "$ref": "#/definitions/SendAgentMode",
            "description": "The UI mode the agent was in when these messages were sent. Defaults to the session's current mode."
          },
          "requestHeaders": {
            "type": "object",
            "additionalProperties": {
              "type": "string"
            },
            "description": "Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key."
          },
          "traceparent": {
            "type": "string",
            "description": "W3C Trace Context traceparent header for distributed tracing of this agent turn"
          },
          "tracestate": {
            "type": "string",
            "description": "W3C Trace Context tracestate header for distributed tracing"
          },
          "wait": {
            "type": "boolean",
            "description": "If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly."
          }
        },
        "required": [
          "sessionId",
          "messages"
        ],
        "additionalProperties": false,
        "description": "Parameters for sending zero or more user messages to the session in a single turn. Remote-backed (Mission Control) sessions do not support this method and will return an error.",
        "title": "SendMessagesRequest",
        "stability": "experimental"
      },
      "result": {
        "$ref": "#/definitions/SendMessagesResult",
        "description": "Result of sending zero or more user messages"
      },
      "stability": "experimental"
    },
    "sandbox": {
      "getEnforcementStatus": {
        "rpcMethod": "session.sandbox.getEnforcementStatus",
        "description": "Returns whether managed policy requires sandbox enforcement and whether an enforcement failure has permanently blocked the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SandboxEnforcementStatus",
          "description": "Managed sandbox enforcement state for a session."
        },
        "stability": "experimental"
      }
    },
    "sendSystemNotification": {
      "rpcMethod": "session.sendSystemNotification",
      "description": "Queues or sends an internal system notification to the session according to its passive policy.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "message": {
            "type": "string",
            "description": "Notification text to deliver to the model."
          },
          "kind": {
            "description": "Optional structured notification kind.",
            "x-opaque-json": true
          },
          "options": {
            "description": "Internal delivery options, including passive policy.",
            "x-opaque-json": true
          }
        },
        "required": [
          "sessionId",
          "message"
        ],
        "additionalProperties": false,
        "description": "Internal request for sending a system notification.",
        "title": "SendSystemNotificationRequest",
        "stability": "experimental"
      },
      "result": {
        "type": "null"
      },
      "stability": "experimental",
      "visibility": "internal"
    },
    "abort": {
      "rpcMethod": "session.abort",
      "description": "Aborts the current agent turn.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "reason": {
            "$ref": "#/definitions/AbortReason",
            "description": "Finite reason code describing why the current turn was aborted"
          }
        },
        "required": [
          "sessionId"
        ],
        "additionalProperties": false,
        "description": "Parameters for aborting the current turn",
        "title": "AbortRequest",
        "stability": "experimental"
      },
      "result": {
        "$ref": "#/definitions/AbortResult",
        "description": "Result of aborting the current turn"
      },
      "stability": "experimental"
    },
    "interruptMainTurn": {
      "rpcMethod": "session.interruptMainTurn",
      "description": "Interrupts the current main agent turn while leaving running background work (subagents, sidekicks, and promoted attached shells) alive. No-op when the main loop is not processing.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "flushQueued": {
            "type": "boolean",
            "description": "When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort."
          }
        },
        "required": [
          "sessionId"
        ],
        "additionalProperties": false,
        "description": "Parameters for interrupting the main agent turn.",
        "title": "InterruptMainTurnRequest",
        "stability": "experimental"
      },
      "result": {
        "$ref": "#/definitions/InterruptMainTurnResult",
        "description": "Result of interrupting the main agent turn."
      },
      "stability": "experimental"
    },
    "cancelAllBackgroundAgents": {
      "rpcMethod": "session.cancelAllBackgroundAgents",
      "description": "Cancels every running background agent (task-registry subagents plus sidekick agents) without interrupting the main agent loop. Promoted attached shells are left running.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          }
        },
        "required": [
          "sessionId"
        ],
        "additionalProperties": false,
        "description": "Identifies the target session."
      },
      "result": {
        "type": "integer",
        "description": "The number of running background agents (task-registry agents) that were cancelled."
      },
      "stability": "experimental"
    },
    "shutdown": {
      "rpcMethod": "session.shutdown",
      "description": "Shuts down the session and persists its final state. Awaits any deferred sessionEnd hooks before resolving so user-supplied hook scripts complete before the runtime tears down.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "type": {
            "$ref": "#/definitions/ShutdownType",
            "description": "Why the session is being shut down. Defaults to \"routine\" when omitted."
          },
          "reason": {
            "type": "string",
            "description": "Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'."
          }
        },
        "required": [
          "sessionId"
        ],
        "additionalProperties": false,
        "description": "Parameters for shutting down the session",
        "title": "ShutdownRequest",
        "stability": "experimental"
      },
      "result": {
        "type": "null"
      },
      "stability": "experimental"
    },
    "gitHubAuth": {
      "getStatus": {
        "rpcMethod": "session.gitHubAuth.getStatus",
        "description": "Gets authentication status and account metadata for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionAuthStatus",
          "description": "Authentication status and account metadata for the session."
        },
        "stability": "experimental"
      },
      "setCredentials": {
        "rpcMethod": "session.gitHubAuth.setCredentials",
        "description": "Updates the session's auth credentials used for outbound model and API requests.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "credentials": {
              "$ref": "#/definitions/SettableAuthInfo",
              "description": "The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime installs the supplied value immediately for outbound model/API requests. When the credential carries a raw token (`token`, `env`, or `gh-cli`) but no `copilotUser`, the runtime additionally re-resolves `copilotUser` server-side (best-effort, asynchronously, after the synchronous install) so plan/quota/billing metadata regains fidelity; on resolution failure the verbatim credential remains installed. It does NOT otherwise validate the credential. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "New auth credentials to install on the session. Omit to leave credentials unchanged.",
          "title": "SessionSetCredentialsParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionSetCredentialsResult",
          "description": "Indicates whether the credential update succeeded."
        },
        "stability": "experimental"
      },
      "getCurrentAuthInfo": {
        "rpcMethod": "session.gitHubAuth.getCurrentAuthInfo",
        "description": "Gets the current authentication information for internal session hosts.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionAuthInfoResult",
          "description": "Current authentication information, or null when no authentication is active."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "getAllAuthAvailable": {
        "rpcMethod": "session.gitHubAuth.getAllAuthAvailable",
        "description": "Gets all authentication accounts available to the internal session host.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionAuthStatus",
            "description": "Authentication status and account metadata for the session."
          },
          "description": "Authentication accounts available to the internal session host."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "refreshCopilotUser": {
        "rpcMethod": "session.gitHubAuth.refreshCopilotUser",
        "description": "Refreshes Copilot account metadata for the current authentication.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionAuthInfoResult",
          "description": "Current authentication information, or null when no authentication is active."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "login": {
        "rpcMethod": "session.gitHubAuth.login",
        "description": "Logs in a GitHub user through the internal session host.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "host": {
              "type": "string",
              "description": "GitHub host URL"
            },
            "login": {
              "type": "string",
              "description": "GitHub login"
            },
            "token": {
              "type": "string",
              "description": "GitHub authentication token"
            },
            "persist": {
              "type": "boolean",
              "description": "Whether to persist the token after login"
            }
          },
          "required": [
            "sessionId",
            "host",
            "login",
            "token"
          ],
          "additionalProperties": false,
          "description": "Internal GitHub login parameters.",
          "title": "SessionAuthLoginRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "switchToAuth": {
        "rpcMethod": "session.gitHubAuth.switchToAuth",
        "description": "Switches the session to another available authentication.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "authInfo": {
              "$ref": "#/definitions/AuthInfo",
              "description": "Authentication information to activate"
            },
            "token": {
              "type": "string",
              "description": "Optional token paired with the authentication information"
            }
          },
          "required": [
            "sessionId",
            "authInfo"
          ],
          "additionalProperties": false,
          "description": "Parameters for switching the session's active authentication.",
          "title": "SessionAuthSwitchRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "logout": {
        "rpcMethod": "session.gitHubAuth.logout",
        "description": "Logs out the session's current GitHub authentication.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "boolean",
          "description": "Whether the current authentication was logged out."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "logoutUser": {
        "rpcMethod": "session.gitHubAuth.logoutUser",
        "description": "Logs out a specific GitHub authentication.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "authInfo": {
              "$ref": "#/definitions/AuthInfo",
              "description": "Authentication information to log out"
            }
          },
          "required": [
            "sessionId",
            "authInfo"
          ],
          "additionalProperties": false,
          "description": "Parameters identifying a GitHub authentication to log out.",
          "title": "SessionAuthLogoutUserRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "boolean",
          "description": "Whether the requested authentication was logged out."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "lastAuthErrors": {
        "rpcMethod": "session.gitHubAuth.lastAuthErrors",
        "description": "Gets validation errors from the most recent authentication attempt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/AuthValidationErrors",
          "description": "Validation errors from the most recent authentication attempt."
        },
        "stability": "experimental",
        "visibility": "internal"
      }
    },
    "debug": {
      "collectLogs": {
        "rpcMethod": "session.debug.collectLogs",
        "description": "Collects a redacted session debug log bundle into a local archive or staging directory. The runtime includes session-owned logs by default and accepts caller-provided diagnostic entries so host applications can add their own files without changing this API shape.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "destination": {
              "$ref": "#/definitions/DebugCollectLogsDestination",
              "description": "Where the redacted bundle should be written. Use `archive` to produce a .tgz, or `directory` to stage redacted files for caller-managed upload/post-processing."
            },
            "include": {
              "$ref": "#/definitions/DebugCollectLogsInclude",
              "description": "Which built-in session diagnostics to include. Omitted fields default to true."
            },
            "additionalEntries": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/DebugCollectLogsEntry",
                "description": "A caller-provided server-local file or directory to include in the debug bundle."
              },
              "description": "Caller-provided server-local files or directories to include in addition to the runtime's built-in session diagnostics. This lets host applications add their own diagnostics without changing the API shape."
            }
          },
          "required": [
            "sessionId",
            "destination"
          ],
          "additionalProperties": false,
          "description": "Options for collecting a redacted session debug bundle.",
          "title": "DebugCollectLogsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/DebugCollectLogsResult",
          "description": "Result of collecting a redacted debug bundle."
        },
        "stability": "experimental"
      }
    },
    "canvas": {
      "list": {
        "rpcMethod": "session.canvas.list",
        "description": "Lists canvases declared for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/CanvasList",
          "description": "Declared canvases available in this session."
        },
        "stability": "experimental"
      },
      "listOpen": {
        "rpcMethod": "session.canvas.listOpen",
        "description": "Lists currently open canvas instances for the live session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/CanvasListOpenResult",
          "description": "Live open-canvas snapshot."
        },
        "stability": "experimental"
      },
      "open": {
        "rpcMethod": "session.canvas.open",
        "description": "Opens or focuses a canvas instance.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "extensionId": {
              "type": "string",
              "description": "Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId."
            },
            "canvasId": {
              "type": "string",
              "description": "Provider-local canvas identifier"
            },
            "instanceId": {
              "type": "string",
              "description": "Caller-supplied stable instance identifier"
            },
            "input": {
              "description": "Canvas open input",
              "x-opaque-json": true
            }
          },
          "required": [
            "sessionId",
            "canvasId",
            "instanceId"
          ],
          "additionalProperties": false,
          "description": "Canvas open parameters.",
          "title": "CanvasOpenRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/OpenCanvasInstance",
          "description": "Open canvas instance snapshot."
        },
        "stability": "experimental"
      },
      "close": {
        "rpcMethod": "session.canvas.close",
        "description": "Closes an open canvas instance.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "instanceId": {
              "type": "string",
              "description": "Open canvas instance identifier"
            }
          },
          "required": [
            "sessionId",
            "instanceId"
          ],
          "additionalProperties": false,
          "description": "Canvas close parameters.",
          "title": "CanvasCloseRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "action": {
        "invoke": {
          "rpcMethod": "session.canvas.action.invoke",
          "description": "Invokes an action on an open canvas instance.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "instanceId": {
                "type": "string",
                "description": "Open canvas instance identifier"
              },
              "actionName": {
                "type": "string",
                "description": "Action name to invoke"
              },
              "input": {
                "description": "Action input",
                "x-opaque-json": true
              }
            },
            "required": [
              "sessionId",
              "instanceId",
              "actionName"
            ],
            "additionalProperties": false,
            "description": "Canvas action invocation parameters.",
            "title": "CanvasActionInvokeRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/CanvasActionInvokeResult",
            "description": "Canvas action invocation result."
          },
          "stability": "experimental"
        }
      },
      "provider": {
        "register": {
          "rpcMethod": "session.canvas.provider.register",
          "description": "Registers an internal canvas provider connection and its contributions.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "connectionId": {
                "type": "string",
                "description": "Connection identifier for callback routing"
              },
              "info": {
                "description": "Provider metadata supplied by the host",
                "x-opaque-json": true
              },
              "canvases": {
                "type": "array",
                "items": {
                  "x-opaque-json": true
                },
                "description": "Canvas contributions supplied by the provider"
              }
            },
            "required": [
              "sessionId",
              "connectionId",
              "info",
              "canvases"
            ],
            "additionalProperties": false,
            "description": "Internal canvas provider registration parameters.",
            "title": "CanvasProviderRegisterRequest",
            "stability": "experimental"
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental",
          "visibility": "internal"
        },
        "unregister": {
          "rpcMethod": "session.canvas.provider.unregister",
          "description": "Unregisters an internal canvas provider connection.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "connectionId": {
                "type": "string",
                "description": "Connection identifier to unregister"
              }
            },
            "required": [
              "sessionId",
              "connectionId"
            ],
            "additionalProperties": false,
            "description": "Internal canvas provider unregistration parameters.",
            "title": "CanvasProviderUnregisterRequest",
            "stability": "experimental"
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental",
          "visibility": "internal"
        }
      }
    },
    "factory": {
      "run": {
        "rpcMethod": "session.factory.run",
        "description": "Runs a registered factory by name at the top level.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Registered factory name."
            },
            "args": {
              "description": "Factory input value.",
              "x-opaque-json": true
            },
            "options": {
              "$ref": "#/definitions/RunOptions",
              "description": "Factory invocation options."
            }
          },
          "required": [
            "sessionId",
            "name",
            "args"
          ],
          "additionalProperties": false,
          "description": "Parameters for invoking a registered factory.",
          "title": "FactoryRunRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryRunResult",
          "description": "Complete current or terminal factory run envelope."
        },
        "stability": "experimental"
      },
      "resume": {
        "rpcMethod": "session.factory.resume",
        "description": "Resumes a factory run using its persisted name, arguments, journal, and accounting.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "limits": {
              "$ref": "#/definitions/FactoryRunLimits",
              "description": "Optional per-invocation resource ceiling overrides."
            },
            "notifyOnComplete": {
              "type": "boolean",
              "description": "Whether to notify the originating session when the factory completes."
            },
            "logPhaseNames": {
              "type": "boolean",
              "description": "Whether to emit factory phase names to the session transcript."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for resuming a factory run from its persisted identity.",
          "title": "FactoryResumeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryResumeResult",
          "description": "Resolved persisted factory identity and resumed run envelope."
        },
        "stability": "experimental"
      },
      "runFromTool": {
        "rpcMethod": "session.factory.runFromTool",
        "description": "Internal tool-originated factory invocation.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Registered factory name."
            },
            "args": {
              "description": "Factory input value.",
              "x-opaque-json": true
            },
            "options": {
              "$ref": "#/definitions/FactoryToolRunOptions",
              "description": "Tool-originated factory invocation options."
            },
            "toolCallId": {
              "type": "string",
              "description": "Opaque identifier of the originating tool call."
            }
          },
          "required": [
            "sessionId",
            "name",
            "args"
          ],
          "additionalProperties": false,
          "description": "Internal parameters for invoking a registered factory from a tool.",
          "title": "FactoryToolRunRequest",
          "visibility": "internal",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryRunResult",
          "description": "Complete current or terminal factory run envelope."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "resumeFromTool": {
        "rpcMethod": "session.factory.resumeFromTool",
        "description": "Internal tool-originated factory resume.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "limits": {
              "$ref": "#/definitions/FactoryRunLimits",
              "description": "Optional per-invocation resource ceiling overrides."
            },
            "toolCallId": {
              "type": "string",
              "description": "Opaque identifier of the originating tool call."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Internal parameters for resuming a factory run from a tool.",
          "title": "FactoryToolResumeRequest",
          "visibility": "internal",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryResumeResult",
          "description": "Resolved persisted factory identity and resumed run envelope."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "getRun": {
        "rpcMethod": "session.factory.getRun",
        "description": "Gets the current or settled envelope for a factory run.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for retrieving a factory run.",
          "title": "FactoryGetRunRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryRunResult",
          "description": "Complete current or terminal factory run envelope."
        },
        "stability": "experimental"
      },
      "listRuns": {
        "rpcMethod": "session.factory.listRuns",
        "description": "Lists durable factory runs for this session in creation order.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "afterSeq": {
              "type": "integer",
              "description": "Exclusive forward cursor."
            },
            "beforeSeq": {
              "type": "integer",
              "description": "Exclusive backward cursor."
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "description": "Maximum terminal runs to return. Defaults to 200 and is capped at 500."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Parameters for paging factory runs.",
          "title": "FactoryListRunsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryListRunsResult",
          "description": "A page of factory runs in durable creation order."
        },
        "stability": "experimental"
      },
      "getRunDetail": {
        "rpcMethod": "session.factory.getRunDetail",
        "description": "Gets durable and live observability detail for one factory run.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for retrieving a factory run.",
          "title": "FactoryGetRunRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryRunDetail",
          "description": "Full factory run observability detail."
        },
        "stability": "experimental"
      },
      "getRunProgress": {
        "rpcMethod": "session.factory.getRunProgress",
        "description": "Pages durable progress for one factory run.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "phaseId": {
              "type": "string",
              "description": "Optional phase identifier used to scope records and cursors."
            },
            "afterSeq": {
              "type": "integer",
              "description": "Exclusive forward cursor."
            },
            "beforeSeq": {
              "type": "integer",
              "description": "Exclusive backward cursor."
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "description": "Maximum records to return. Defaults to 200 and is capped at 500."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for paging factory progress.",
          "title": "FactoryGetRunProgressRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryProgressPage",
          "description": "A bidirectional page of factory progress."
        },
        "stability": "experimental"
      },
      "cancel": {
        "rpcMethod": "session.factory.cancel",
        "description": "Requests cancellation of a factory run and returns its run envelope.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for cancelling a factory run.",
          "title": "FactoryCancelRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryRunResult",
          "description": "Complete current or terminal factory run envelope."
        },
        "stability": "experimental"
      },
      "log": {
        "rpcMethod": "session.factory.log",
        "description": "Records a batch of ordered factory progress lines.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "executionToken": {
              "type": "string",
              "description": "Opaque token identifying the current factory execution attempt."
            },
            "lines": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/FactoryLogLine",
                "description": "One ordered factory progress line."
              },
              "description": "Ordered progress lines to append."
            }
          },
          "required": [
            "sessionId",
            "runId",
            "executionToken",
            "lines"
          ],
          "additionalProperties": false,
          "description": "Parameters for recording factory progress.",
          "title": "FactoryLogRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryAckResult",
          "description": "Acknowledgement that a factory request was accepted."
        },
        "stability": "experimental"
      },
      "agent": {
        "rpcMethod": "session.factory.agent",
        "description": "Runs one factory-scoped subagent and returns its result.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "factoryRunId": {
              "type": "string",
              "description": "Factory run identifier that owns the subagent."
            },
            "executionToken": {
              "type": "string",
              "description": "Opaque token identifying the current factory execution attempt."
            },
            "prompt": {
              "type": "string",
              "description": "Prompt to send to the subagent."
            },
            "opts": {
              "$ref": "#/definitions/FactoryAgentOptions",
              "description": "Subagent execution options."
            }
          },
          "required": [
            "sessionId",
            "factoryRunId",
            "executionToken",
            "prompt",
            "opts"
          ],
          "additionalProperties": false,
          "description": "Parameters for one factory-scoped subagent call.",
          "title": "FactoryAgentRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryAgentResult",
          "description": "Result of one factory-scoped subagent call."
        },
        "stability": "experimental"
      },
      "journal": {
        "get": {
          "rpcMethod": "session.factory.journal.get",
          "description": "Reads a memoized factory journal entry.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "runId": {
                "type": "string",
                "description": "Factory run identifier."
              },
              "executionToken": {
                "type": "string",
                "description": "Opaque token identifying the current factory execution attempt."
              },
              "key": {
                "type": "string",
                "description": "Namespaced journal key."
              }
            },
            "required": [
              "sessionId",
              "runId",
              "executionToken",
              "key"
            ],
            "additionalProperties": false,
            "description": "Parameters for reading a factory journal entry.",
            "title": "FactoryJournalGetRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/FactoryJournalGetResult",
            "description": "Result of reading a factory journal entry."
          },
          "stability": "experimental"
        },
        "put": {
          "rpcMethod": "session.factory.journal.put",
          "description": "Stores a memoized factory journal entry.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "runId": {
                "type": "string",
                "description": "Factory run identifier."
              },
              "executionToken": {
                "type": "string",
                "description": "Opaque token identifying the current factory execution attempt."
              },
              "key": {
                "type": "string",
                "description": "Namespaced journal key."
              },
              "resultJson": {
                "description": "JSON result to memoize.",
                "x-opaque-json": true
              }
            },
            "required": [
              "sessionId",
              "runId",
              "executionToken",
              "key",
              "resultJson"
            ],
            "additionalProperties": false,
            "description": "Parameters for storing a factory journal entry.",
            "title": "FactoryJournalPutRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/FactoryAckResult",
            "description": "Acknowledgement that a factory request was accepted."
          },
          "stability": "experimental"
        }
      }
    },
    "model": {
      "getCurrent": {
        "rpcMethod": "session.model.getCurrent",
        "description": "Gets the currently selected model for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/CurrentModel",
          "description": "The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume."
        },
        "stability": "experimental"
      },
      "switchTo": {
        "rpcMethod": "session.model.switchTo",
        "description": "Switches the session to a model and optional reasoning configuration.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "modelId": {
              "type": "string",
              "description": "Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model."
            },
            "reasoningEffort": {
              "type": "string",
              "description": "Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. \"none\" disables reasoning. When omitted, no effort override is applied."
            },
            "reasoningSummary": {
              "$ref": "#/definitions/ReasoningSummary",
              "description": "Reasoning summary mode to request for supported model clients"
            },
            "verbosity": {
              "$ref": "#/definitions/Verbosity",
              "description": "Output verbosity level to request for supported models"
            },
            "modelCapabilities": {
              "$ref": "#/definitions/ModelCapabilitiesOverride",
              "description": "Override individual model capabilities resolved by the runtime"
            },
            "contextTier": {
              "$ref": "#/definitions/ContextTier",
              "description": "Explicit context tier for the selected model. `\"default\"` / `\"long_context\"` apply the requested tier; omit this field to use normal model behavior with no explicit tier."
            },
            "source": {
              "$ref": "#/definitions/ModelChangeSource",
              "description": "Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value."
            },
            "deferIfModelChangeQueued": {
              "type": "boolean",
              "description": "When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active)."
            },
            "compactionDecision": {
              "type": "string",
              "description": "Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary."
            },
            "runCompactionPreflight": {
              "type": "boolean",
              "description": "When true, evaluate context-window compaction policy before applying the switch."
            },
            "repoScope": {
              "type": "string",
              "description": "Optional repository settings scope to persist after the switch commits."
            },
            "modelChangeScope": {
              "type": "string",
              "description": "Settings scope used when persisting the selected model."
            },
            "requireAvailable": {
              "type": "boolean",
              "description": "Require the target to be currently available and enabled before applying the switch."
            },
            "pickerPersistence": {
              "$ref": "#/definitions/ModelPickerPersistenceRequest",
              "description": "Optional settings context and explicit-override flags used to persist a picker selection."
            }
          },
          "required": [
            "sessionId",
            "modelId"
          ],
          "additionalProperties": false,
          "description": "Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.",
          "title": "ModelSwitchToRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ModelSwitchToResult",
          "description": "The model identifier active on the session after the switch."
        },
        "stability": "experimental"
      },
      "applyStartupOverlay": {
        "rpcMethod": "session.model.applyStartupOverlay",
        "description": "Resolves and applies organization-managed and repository model overlays.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "deviceManagedModel": {
              "type": "string",
              "description": "Model required by device-managed policy, when configured."
            },
            "serverManagedModel": {
              "type": "string",
              "description": "Model required by server-managed policy, when configured."
            },
            "policyHelperModel": {
              "type": "string",
              "description": "Startup default model from the enterprise policy helper, when configured. Weakest of the managed sources: it applies only when neither device nor server policy names a model, and an explicit user selection still wins."
            },
            "repoModel": {
              "type": "string",
              "description": "Model selected by repository settings, when configured."
            },
            "repoReasoningEffort": {
              "type": "string",
              "description": "Reasoning effort selected by repository settings, when configured."
            },
            "repoContextTier": {
              "type": "string",
              "description": "Context tier selected by repository settings, when configured."
            },
            "cliModel": {
              "type": "string",
              "description": "Model explicitly selected by the CLI, when provided."
            },
            "deferredResume": {
              "type": "boolean",
              "description": "Whether the overlay is being applied while resuming a deferred session."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Managed, repository, and CLI model overrides to overlay onto the session at startup.",
          "title": "ModelApplyStartupOverlayRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ModelSwitchToResult",
          "description": "The model identifier active on the session after the switch."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "setReasoningEffort": {
        "rpcMethod": "session.model.setReasoningEffort",
        "description": "Updates the session's reasoning effort without changing the selected model.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "reasoningEffort": {
              "type": "string",
              "description": "Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling."
            }
          },
          "required": [
            "sessionId",
            "reasoningEffort"
          ],
          "additionalProperties": false,
          "description": "Reasoning effort level to apply to the currently selected model.",
          "title": "ModelSetReasoningEffortRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ModelSetReasoningEffortResult",
          "description": "Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns."
        },
        "stability": "experimental"
      },
      "list": {
        "rpcMethod": "session.model.list",
        "description": "Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "skipCache": {
                  "type": "boolean",
                  "description": "If true, bypasses the per-session model list cache and re-fetches from CAPI."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Optional listing options.",
          "title": "ModelListRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionModelList",
          "description": "The list of models available to this session."
        },
        "stability": "experimental"
      }
    },
    "mode": {
      "get": {
        "rpcMethod": "session.mode.get",
        "description": "Gets the current agent interaction mode.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionMode",
          "description": "The session mode the agent is operating in"
        },
        "stability": "experimental"
      },
      "set": {
        "rpcMethod": "session.mode.set",
        "description": "Sets the current agent interaction mode.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/SessionMode",
              "description": "The session mode the agent is operating in"
            },
            "inheritPlanBaseFromSessionId": {
              "type": "string",
              "description": "Session whose plan-mode base state should be inherited."
            },
            "planModelConfigured": {
              "type": "boolean",
              "description": "Whether a dedicated plan model is configured."
            },
            "planModel": {
              "type": "string",
              "description": "Dedicated model to use in plan mode, when configured."
            },
            "planReasoningEffort": {
              "type": "string",
              "description": "Reasoning effort to use with the dedicated plan model."
            },
            "planContextTier": {
              "type": "string",
              "description": "Context tier to use with the dedicated plan model."
            },
            "compactionDecision": {
              "type": "string",
              "description": "Explicit response to a model-switch compaction preflight."
            },
            "restorePlanModel": {
              "type": "boolean",
              "description": "Whether leaving plan mode should restore the session's previous model."
            },
            "persistPlanSelection": {
              "type": "boolean",
              "description": "Whether the selected plan model should be persisted."
            },
            "pickerSettingsContext": {
              "$ref": "#/definitions/ModelPickerSettingsContext",
              "description": "Settings context used when persisting the selected plan model."
            },
            "planExitAction": {
              "type": "string",
              "description": "Action to perform when leaving plan mode."
            }
          },
          "required": [
            "sessionId",
            "mode"
          ],
          "additionalProperties": false,
          "description": "Agent interaction mode to apply to the session.",
          "title": "ModeSetRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ModeSetResult",
          "description": "Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform."
        },
        "stability": "experimental"
      }
    },
    "name": {
      "get": {
        "rpcMethod": "session.name.get",
        "description": "Gets the session's friendly name.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/NameGetResult",
          "description": "The session's friendly name, or null when not yet set."
        },
        "stability": "experimental"
      },
      "set": {
        "rpcMethod": "session.name.set",
        "description": "Sets the session's friendly name.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "minLength": 1,
              "maxLength": 100,
              "description": "New session name (1–100 characters, trimmed of leading/trailing whitespace)"
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "New friendly name to apply to the session.",
          "title": "NameSetRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "setAuto": {
        "rpcMethod": "session.name.setAuto",
        "description": "Persists an auto-generated session summary as the session's name when no user-set name exists.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "summary": {
              "type": "string",
              "description": "Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting."
            }
          },
          "required": [
            "sessionId",
            "summary"
          ],
          "additionalProperties": false,
          "description": "Auto-generated session summary to apply as the session's name when no user-set name exists.",
          "title": "NameSetAutoRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/NameSetAutoResult",
          "description": "Indicates whether the auto-generated summary was applied as the session's name."
        },
        "stability": "experimental"
      }
    },
    "plan": {
      "read": {
        "rpcMethod": "session.plan.read",
        "description": "Reads the session plan file from the workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/PlanReadResult",
          "description": "Existence, contents, and resolved path of the session plan file."
        },
        "stability": "experimental"
      },
      "update": {
        "rpcMethod": "session.plan.update",
        "description": "Writes new content to the session plan file.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "content": {
              "type": "string",
              "description": "The new content for the plan file"
            }
          },
          "required": [
            "sessionId",
            "content"
          ],
          "additionalProperties": false,
          "description": "Replacement contents to write to the session plan file.",
          "title": "PlanUpdateRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "delete": {
        "rpcMethod": "session.plan.delete",
        "description": "Deletes the session plan file from the workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "readSqlTodos": {
        "rpcMethod": "session.plan.readSqlTodos",
        "description": "Reads todo rows from the session SQL database for plan rendering.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/PlanReadSqlTodosResult",
          "description": "Todo rows read from the session SQL database. Empty when no session database is available."
        },
        "stability": "experimental"
      },
      "readSqlTodosWithDependencies": {
        "rpcMethod": "session.plan.readSqlTodosWithDependencies",
        "description": "Reads todo rows AND dependency edges from the session SQL database for structured progress UI. Same defensive behavior as readSqlTodos — returns empty arrays when the database, tables, or columns aren't available. Clients should call this on session start and after every `session.todos_changed` event to refresh structured-UI rendering.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/PlanReadSqlTodosWithDependenciesResult",
          "description": "Todo rows + dependency edges read from the session SQL database."
        },
        "stability": "experimental"
      }
    },
    "workspaces": {
      "getWorkspace": {
        "rpcMethod": "session.workspaces.getWorkspace",
        "description": "Gets current workspace metadata for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesGetWorkspaceResult",
          "description": "Current workspace metadata for the session, including its absolute filesystem path when available."
        },
        "stability": "experimental"
      },
      "updateMetadata": {
        "rpcMethod": "session.workspaces.updateMetadata",
        "description": "Updates workspace metadata for a local session and returns the refreshed workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "context": {
              "description": "Opaque workspace context supplied by the session host.",
              "x-opaque-json": true
            },
            "name": {
              "type": "string",
              "description": "Optional workspace display name override."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Workspace metadata fields to update.",
          "title": "WorkspacesUpdateMetadataRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesGetWorkspaceResult",
          "description": "Current workspace metadata for the session, including its absolute filesystem path when available."
        },
        "stability": "experimental"
      },
      "ensure": {
        "rpcMethod": "session.workspaces.ensure",
        "description": "Ensures a local session workspace exists and returns it.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "context": {
              "description": "Opaque workspace context supplied by the session host.",
              "x-opaque-json": true
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Optional session context used when creating a local workspace.",
          "title": "WorkspacesEnsureRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesGetWorkspaceResult",
          "description": "Current workspace metadata for the session, including its absolute filesystem path when available."
        },
        "stability": "experimental"
      },
      "listFiles": {
        "rpcMethod": "session.workspaces.listFiles",
        "description": "Lists files stored in the session workspace files directory.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesListFilesResult",
          "description": "Relative paths of files stored in the session workspace files directory."
        },
        "stability": "experimental"
      },
      "readFile": {
        "rpcMethod": "session.workspaces.readFile",
        "description": "Reads a file from the session workspace files directory.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Relative path within the workspace files directory"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Relative path of the workspace file to read.",
          "title": "WorkspacesReadFileRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesReadFileResult",
          "description": "Contents of the requested workspace file as a UTF-8 string."
        },
        "stability": "experimental"
      },
      "createFile": {
        "rpcMethod": "session.workspaces.createFile",
        "description": "Creates or overwrites a file in the session workspace files directory.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Relative path within the workspace files directory"
            },
            "content": {
              "type": "string",
              "description": "File content to write as a UTF-8 string"
            }
          },
          "required": [
            "sessionId",
            "path",
            "content"
          ],
          "additionalProperties": false,
          "description": "Relative path and UTF-8 content for the workspace file to create or overwrite.",
          "title": "WorkspacesCreateFileRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "listCheckpoints": {
        "rpcMethod": "session.workspaces.listCheckpoints",
        "description": "Lists workspace checkpoints in chronological order.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesListCheckpointsResult",
          "description": "Workspace checkpoints in chronological order; empty when the workspace is not enabled."
        },
        "stability": "experimental"
      },
      "readCheckpoint": {
        "rpcMethod": "session.workspaces.readCheckpoint",
        "description": "Reads the content of a workspace checkpoint by number.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "number": {
              "type": "integer",
              "minimum": 0,
              "description": "Checkpoint number to read"
            }
          },
          "required": [
            "sessionId",
            "number"
          ],
          "additionalProperties": false,
          "description": "Checkpoint number to read.",
          "title": "WorkspacesReadCheckpointRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesReadCheckpointResult",
          "description": "Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing."
        },
        "stability": "experimental"
      },
      "addSummary": {
        "rpcMethod": "session.workspaces.addSummary",
        "description": "Adds a compaction summary checkpoint to the local session workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "title": {
              "type": "string",
              "description": "Summary title shown in checkpoint listings."
            },
            "content": {
              "type": "string",
              "description": "Markdown summary content to persist."
            }
          },
          "required": [
            "sessionId",
            "title",
            "content"
          ],
          "additionalProperties": false,
          "description": "Compaction summary checkpoint to persist.",
          "title": "WorkspacesAddSummaryRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesAddSummaryResult",
          "description": "Persisted summary metadata and refreshed workspace metadata."
        },
        "stability": "experimental"
      },
      "truncateSummaries": {
        "rpcMethod": "session.workspaces.truncateSummaries",
        "description": "Truncates local workspace compaction summaries after a rollback.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "keepCount": {
              "type": "integer",
              "minimum": 0,
              "description": "Number of newest summaries to keep."
            }
          },
          "required": [
            "sessionId",
            "keepCount"
          ],
          "additionalProperties": false,
          "description": "Rollback point for local workspace summaries.",
          "title": "WorkspacesTruncateSummariesRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesGetWorkspaceResult",
          "description": "Current workspace metadata for the session, including its absolute filesystem path when available."
        },
        "stability": "experimental"
      },
      "readAutopilotObjective": {
        "rpcMethod": "session.workspaces.readAutopilotObjective",
        "description": "Reads the autopilot objective state file from the local session workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesReadAutopilotObjectiveResult",
          "description": "Autopilot objective file content, or null when missing."
        },
        "stability": "experimental"
      },
      "writeAutopilotObjective": {
        "rpcMethod": "session.workspaces.writeAutopilotObjective",
        "description": "Writes the autopilot objective state file in the local session workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "content": {
              "type": "string",
              "description": "Autopilot objective file content."
            }
          },
          "required": [
            "sessionId",
            "content"
          ],
          "additionalProperties": false,
          "description": "Autopilot objective file content to persist.",
          "title": "WorkspacesWriteAutopilotObjectiveRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesWriteAutopilotObjectiveResult",
          "description": "Result of writing the autopilot objective file."
        },
        "stability": "experimental"
      },
      "deleteAutopilotObjective": {
        "rpcMethod": "session.workspaces.deleteAutopilotObjective",
        "description": "Deletes the autopilot objective state file from the local session workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesDeleteAutopilotObjectiveResult",
          "description": "Result of deleting the autopilot objective file."
        },
        "stability": "experimental"
      },
      "autopilotObjectiveExists": {
        "rpcMethod": "session.workspaces.autopilotObjectiveExists",
        "description": "Checks whether the local session workspace has an autopilot objective state file.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/WorkspacesAutopilotObjectiveExistsResult",
          "description": "Whether the autopilot objective file exists."
        },
        "stability": "experimental"
      },
      "saveLargePaste": {
        "rpcMethod": "session.workspaces.saveLargePaste",
        "description": "Saves pasted content as a UTF-8 file in the session workspace.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "content": {
              "type": "string",
              "description": "Pasted content to save as a UTF-8 file"
            }
          },
          "required": [
            "sessionId",
            "content"
          ],
          "additionalProperties": false,
          "description": "Pasted content to save as a UTF-8 file in the session workspace.",
          "title": "WorkspacesSaveLargePasteRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspacesSaveLargePasteResult",
          "description": "Descriptor for the saved paste file, or null when the workspace is unavailable."
        },
        "stability": "experimental"
      },
      "diff": {
        "rpcMethod": "session.workspaces.diff",
        "description": "Computes a diff for the session workspace. Never rejects for a busy session: a `session`-mode diff that cannot read the session's file-change captures falls back to an unstaged git diff with `isFallback: true` and reports why in `unavailableReason`.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/WorkspaceDiffMode",
              "description": "Diff mode requested by the client."
            },
            "ignoreWhitespace": {
              "type": "boolean",
              "description": "When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false."
            }
          },
          "required": [
            "sessionId",
            "mode"
          ],
          "additionalProperties": false,
          "description": "Parameters for computing a workspace diff.",
          "title": "WorkspacesDiffRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/WorkspaceDiffResult",
          "description": "Workspace diff result for the requested mode."
        },
        "stability": "experimental"
      }
    },
    "completions": {
      "getTriggerCharacters": {
        "rpcMethod": "session.completions.getTriggerCharacters",
        "description": "Gets the characters that should trigger host-driven completions for the session. Empty disables host-driven completions (e.g. local sessions, or a relay host that does not advertise them).",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/CompletionsGetTriggerCharactersResult",
          "description": "Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`)."
        },
        "stability": "experimental"
      },
      "request": {
        "rpcMethod": "session.completions.request",
        "description": "Requests host-driven completion items for the current composer input. Returns an empty list when the host has no items or does not support completions.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "text": {
              "type": "string",
              "description": "The full composed composer input."
            },
            "offset": {
              "type": "integer",
              "minimum": 0,
              "description": "Cursor offset within `text`, in UTF-16 code units."
            }
          },
          "required": [
            "sessionId",
            "text",
            "offset"
          ],
          "additionalProperties": false,
          "description": "Request host-driven completions for the current composer input.",
          "title": "CompletionsRequestRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CompletionsRequestResult",
          "description": "Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions."
        },
        "stability": "experimental"
      }
    },
    "instructions": {
      "getSources": {
        "rpcMethod": "session.instructions.getSources",
        "description": "Gets instruction sources loaded for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/InstructionsGetSourcesResult",
          "description": "Instruction sources loaded for the session, in merge order."
        },
        "stability": "experimental"
      }
    },
    "fleet": {
      "start": {
        "rpcMethod": "session.fleet.start",
        "description": "Starts fleet mode by submitting the fleet orchestration prompt to the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "prompt": {
              "type": "string",
              "description": "Optional user prompt to combine with fleet instructions"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Optional user prompt to combine with the fleet orchestration instructions.",
          "title": "FleetStartRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FleetStartResult",
          "description": "Indicates whether fleet mode was successfully activated."
        },
        "stability": "experimental"
      }
    },
    "agent": {
      "list": {
        "rpcMethod": "session.agent.list",
        "description": "Lists agents available to the session. Defaults to custom agents only; pass includeBuiltInAgents to include the effective built-in agents.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "includeBuiltInAgents": {
                  "type": "boolean",
                  "description": "When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session."
                },
                "includePrompt": {
                  "type": "boolean",
                  "description": "When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Controls whether built-in agents and authored prompt text are included.",
          "title": "AgentListRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/AgentList",
          "description": "Agents available to the session."
        },
        "stability": "experimental"
      },
      "setPrompt": {
        "rpcMethod": "session.agent.setPrompt",
        "description": "Sets an in-memory authored prompt override for an available agent. For built-in agents, this replaces only the static base prompt while preserving runtime-owned dynamic prompt composition and behavior. The special `general-purpose` agent is not overrideable. Overrides are not persisted; resumed and forked sessions start without them, so the host must re-apply them.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable effective agent id. Plugin namespace separators are normalized."
            },
            "prompt": {
              "type": "string",
              "description": "Replacement authored prompt. Empty text is valid."
            }
          },
          "required": [
            "sessionId",
            "id",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "An in-memory authored prompt override for an available agent.",
          "title": "AgentSetPromptRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "getCurrent": {
        "rpcMethod": "session.agent.getCurrent",
        "description": "Gets the currently selected custom agent for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/AgentGetCurrentResult",
          "description": "The currently selected custom agent, or null when using the default agent."
        },
        "stability": "experimental"
      },
      "select": {
        "rpcMethod": "session.agent.select",
        "description": "Selects a custom agent for subsequent turns in the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Name of the custom agent to select"
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "Name of the custom agent to select for subsequent turns.",
          "title": "AgentSelectRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/AgentSelectResult",
          "description": "The newly selected custom agent."
        },
        "stability": "experimental"
      },
      "deselect": {
        "rpcMethod": "session.agent.deselect",
        "description": "Clears the selected custom agent and returns the session to the default agent.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "reload": {
        "rpcMethod": "session.agent.reload",
        "description": "Reloads custom agent definitions and returns the refreshed list.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/AgentReloadResult",
          "description": "Custom agents available to the session after reloading definitions from disk."
        },
        "stability": "experimental"
      }
    },
    "tasks": {
      "startAgent": {
        "rpcMethod": "session.tasks.startAgent",
        "description": "Starts a background agent task in the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "agentType": {
              "type": "string",
              "description": "Type of agent to start (e.g., 'explore', 'task', 'general-purpose')"
            },
            "prompt": {
              "type": "string",
              "description": "Task prompt for the agent"
            },
            "name": {
              "type": "string",
              "description": "Friendly, non-unique name used when displaying the agent"
            },
            "description": {
              "type": "string",
              "description": "Short description of the task"
            },
            "model": {
              "type": "string",
              "description": "Optional model override"
            }
          },
          "required": [
            "sessionId",
            "agentType",
            "prompt",
            "name"
          ],
          "additionalProperties": false,
          "description": "Agent type, prompt, name, and optional description and model override for the new task.",
          "title": "TasksStartAgentRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksStartAgentResult",
          "description": "Identifier assigned to the newly started background agent task."
        },
        "stability": "experimental"
      },
      "list": {
        "rpcMethod": "session.tasks.list",
        "description": "Lists background tasks tracked by the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/TaskList",
          "description": "Background tasks currently tracked by the session."
        },
        "stability": "experimental"
      },
      "refresh": {
        "rpcMethod": "session.tasks.refresh",
        "description": "Refreshes metadata for any detached background shells the runtime knows about.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/TasksRefreshResult",
          "description": "Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop."
        },
        "stability": "experimental"
      },
      "waitForPending": {
        "rpcMethod": "session.tasks.waitForPending",
        "description": "Waits for all in-flight background tasks and any follow-up turns to settle.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/TasksWaitForPendingResult",
          "description": "Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS)."
        },
        "stability": "experimental"
      },
      "getProgress": {
        "rpcMethod": "session.tasks.getProgress",
        "description": "Returns progress information for a background task by ID.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Task identifier (agent ID or shell ID)"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Identifier of the background task to fetch progress for.",
          "title": "TasksGetProgressRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksGetProgressResult",
          "description": "Progress information for the task, or null when no task with that ID is tracked."
        },
        "stability": "experimental"
      },
      "getCurrentPromotable": {
        "rpcMethod": "session.tasks.getCurrentPromotable",
        "description": "Returns the first sync-waiting task that can currently be promoted to background mode.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/TasksGetCurrentPromotableResult",
          "description": "The first sync-waiting task that can currently be promoted to background mode."
        },
        "stability": "experimental"
      },
      "promoteToBackground": {
        "rpcMethod": "session.tasks.promoteToBackground",
        "description": "Promotes an eligible synchronously-waited task so it continues running in the background.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Task identifier"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Identifier of the task to promote to background mode.",
          "title": "TasksPromoteToBackgroundRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksPromoteToBackgroundResult",
          "description": "Indicates whether the task was successfully promoted to background mode."
        },
        "stability": "experimental"
      },
      "promoteCurrentToBackground": {
        "rpcMethod": "session.tasks.promoteCurrentToBackground",
        "description": "Atomically promotes the first promotable sync-waiting task to background mode and returns it.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/TasksPromoteCurrentToBackgroundResult",
          "description": "The promoted task as it now exists in background mode, omitted if no promotable task was waiting."
        },
        "stability": "experimental"
      },
      "cancel": {
        "rpcMethod": "session.tasks.cancel",
        "description": "Cancels a background task.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Task identifier"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Identifier of the background task to cancel.",
          "title": "TasksCancelRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksCancelResult",
          "description": "Indicates whether the background task was successfully cancelled."
        },
        "stability": "experimental"
      },
      "remove": {
        "rpcMethod": "session.tasks.remove",
        "description": "Removes a completed or cancelled background task from tracking.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Task identifier"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Identifier of the completed or cancelled task to remove from tracking.",
          "title": "TasksRemoveRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksRemoveResult",
          "description": "Indicates whether the task was removed. False when the task does not exist or is still running/idle."
        },
        "stability": "experimental"
      },
      "sendMessage": {
        "rpcMethod": "session.tasks.sendMessage",
        "description": "Sends a message to a background agent task.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Agent task identifier"
            },
            "message": {
              "type": "string",
              "description": "Message content to send to the agent"
            },
            "fromAgentId": {
              "type": "string",
              "description": "Agent ID of the sender, if sent on behalf of another agent"
            }
          },
          "required": [
            "sessionId",
            "id",
            "message"
          ],
          "additionalProperties": false,
          "description": "Identifier of the target agent task, message content, and optional sender agent ID.",
          "title": "TasksSendMessageRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TasksSendMessageResult",
          "description": "Indicates whether the message was delivered, with an error message when delivery failed."
        },
        "stability": "experimental"
      }
    },
    "skills": {
      "list": {
        "rpcMethod": "session.skills.list",
        "description": "Lists skills available to the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SkillList",
          "description": "Skills available to the session, with their enabled state."
        },
        "stability": "experimental"
      },
      "getInvoked": {
        "rpcMethod": "session.skills.getInvoked",
        "description": "Returns the skills that have been invoked during this session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SkillsGetInvokedResult",
          "description": "Skills invoked during this session, ordered by invocation time (most recent last)."
        },
        "stability": "experimental"
      },
      "enable": {
        "rpcMethod": "session.skills.enable",
        "description": "Enables a skill for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Name of the skill to enable"
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "Name of the skill to enable for the session.",
          "title": "SkillsEnableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "session.skills.disable",
        "description": "Disables a skill for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Name of the skill to disable"
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "Name of the skill to disable for the session.",
          "title": "SkillsDisableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "reload": {
        "rpcMethod": "session.skills.reload",
        "description": "Reloads skill definitions for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SkillsLoadDiagnostics",
          "description": "Diagnostics from reloading skill definitions, with warnings and errors as separate lists."
        },
        "stability": "experimental"
      },
      "ensureLoaded": {
        "rpcMethod": "session.skills.ensureLoaded",
        "description": "Ensures the session's skill definitions have been loaded from disk.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "mcp": {
      "list": {
        "rpcMethod": "session.mcp.list",
        "description": "Lists MCP servers configured for the session, their connection status, and host-level state. The host-level state (disabled/filtered servers, failed/needs-auth/pending connections, mcp3p policy, full config) is empty/zero when no MCP host has been initialized for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/McpServerList",
          "description": "MCP servers configured for the session, with their connection status and host-level state."
        },
        "stability": "experimental"
      },
      "listTools": {
        "rpcMethod": "session.mcp.listTools",
        "description": "Lists the tools exposed by a connected MCP server on this session's host. This performs a live `tools/list` request. Tool UI metadata is returned independently of whether MCP Apps rendering is enabled for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
              "description": "Name of the connected MCP server whose tools to list."
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name whose tool list should be returned.",
          "title": "McpListToolsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/McpListToolsResult",
          "description": "Tools exposed by the connected MCP server. Throws when the server is not connected."
        },
        "stability": "experimental"
      },
      "enable": {
        "rpcMethod": "session.mcp.enable",
        "description": "Enables an MCP server for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
              "description": "Name of the MCP server to enable"
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Name of the MCP server to enable for the session.",
          "title": "McpEnableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "session.mcp.disable",
        "description": "Disables an MCP server for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
              "description": "Name of the MCP server to disable"
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Name of the MCP server to disable for the session.",
          "title": "McpDisableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "reload": {
        "rpcMethod": "session.mcp.reload",
        "description": "Reloads MCP server connections for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "moveLoadingToBackground": {
        "rpcMethod": "session.mcp.moveLoadingToBackground",
        "description": "Releases any turns waiting on an in-flight MCP load without cancelling the load, letting the agent proceed while MCP servers finish connecting in the background. No-op when no MCP load is in flight or waiting turns were already released.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/MoveMcpLoadingToBackgroundResult",
          "description": "Result of moving in-flight MCP loading to the background."
        },
        "stability": "experimental"
      },
      "reloadWithConfig": {
        "rpcMethod": "session.mcp.reloadWithConfig",
        "description": "Reloads MCP server connections for the session with an explicit host-provided configuration.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "config": {
              "anyOf": [
                {},
                {
                  "$ref": "#/definitions/McpReloadConfig",
                  "description": "In-process MCP reload configuration.",
                  "visibility": "internal"
                }
              ],
              "description": "Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).",
              "visibility": "internal",
              "x-opaque-in-process": true,
              "x-typescript-type": "McpReloadConfig"
            }
          },
          "required": [
            "sessionId",
            "config"
          ],
          "additionalProperties": false,
          "description": "Opaque MCP reload configuration.",
          "title": "McpReloadWithConfigRequest",
          "visibility": "internal"
        },
        "result": {
          "$ref": "#/definitions/McpStartServersResult",
          "description": "MCP server startup filtering result."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "executeSampling": {
        "rpcMethod": "session.mcp.executeSampling",
        "description": "Runs an MCP sampling inference on behalf of an MCP server.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call."
            },
            "serverName": {
              "type": "string",
              "description": "Name of the MCP server that initiated the sampling request"
            },
            "mcpRequestId": {
              "description": "The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).",
              "x-opaque-json": true
            },
            "request": {
              "$ref": "#/definitions/McpExecuteSamplingRequest",
              "description": "Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "serverName",
            "mcpRequestId",
            "request"
          ],
          "additionalProperties": false,
          "description": "Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.",
          "title": "McpExecuteSamplingParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/McpSamplingExecutionResult",
          "description": "Outcome of an MCP sampling execution: success result, failure error, or cancellation."
        },
        "stability": "experimental"
      },
      "cancelSamplingExecution": {
        "rpcMethod": "session.mcp.cancelSamplingExecution",
        "description": "Cancels an in-flight MCP sampling execution by request ID.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The requestId previously passed to executeSampling that should be cancelled"
            }
          },
          "required": [
            "sessionId",
            "requestId"
          ],
          "additionalProperties": false,
          "description": "The requestId previously passed to executeSampling that should be cancelled.",
          "title": "McpCancelSamplingExecutionParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/McpCancelSamplingExecutionResult",
          "description": "Indicates whether an in-flight sampling execution with the given requestId was found and cancelled."
        },
        "stability": "experimental"
      },
      "setEnvValueMode": {
        "rpcMethod": "session.mcp.setEnvValueMode",
        "description": "Sets how environment-variable values supplied to MCP servers are resolved (direct or indirect).",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/McpSetEnvValueModeDetails",
              "description": "How environment-variable values supplied to MCP servers are resolved. \"direct\" passes literal string values; \"indirect\" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to \"direct\"."
            }
          },
          "required": [
            "sessionId",
            "mode"
          ],
          "additionalProperties": false,
          "description": "Mode controlling how MCP server env values are resolved (`direct` or `indirect`).",
          "title": "McpSetEnvValueModeParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/McpSetEnvValueModeResult",
          "description": "Env-value mode recorded on the session after the update."
        },
        "stability": "experimental"
      },
      "removeGitHub": {
        "rpcMethod": "session.mcp.removeGitHub",
        "description": "Removes the auto-managed `github` MCP server when present.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/McpRemoveGitHubResult",
          "description": "Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove)."
        },
        "stability": "experimental"
      },
      "configureGitHub": {
        "rpcMethod": "session.mcp.configureGitHub",
        "description": "Configures the built-in GitHub MCP server for the session's current auth context.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "authInfo": {
              "description": "Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).",
              "visibility": "internal",
              "x-opaque-in-process": true
            }
          },
          "required": [
            "sessionId",
            "authInfo"
          ],
          "additionalProperties": false,
          "description": "Credential-free authentication identity used to configure GitHub MCP.",
          "title": "McpConfigureGitHubRequest",
          "visibility": "internal"
        },
        "result": {
          "$ref": "#/definitions/McpConfigureGitHubResult",
          "description": "Result of configuring GitHub MCP."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "startServer": {
        "rpcMethod": "session.mcp.startServer",
        "description": "Starts an individual MCP server on the live session. Omit `config` for a config-free start-by-name of an already-configured server (reuses the server's already-registered configuration); supply `config` to start from a caller-supplied configuration. Session-scoped and ephemeral: the server is added to this session's running set only and is reaped when the session ends. Does NOT modify persistent user configuration (`mcp.config.*`), so it does not affect future sessions. The server surfaces through `session.mcp.list` and the `session.mcp_servers_loaded` / `session.mcp_server_status_changed` events like any other server.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Name of the MCP server to start"
            },
            "config": {
              "$ref": "#/definitions/McpSerializableServerConfig",
              "description": "MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name)."
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server.",
          "title": "McpStartServerRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "restartServer": {
        "rpcMethod": "session.mcp.restartServer",
        "description": "Restarts an individual MCP server on the live session (stops then starts). Omit `config` for a config-free restart-by-name of an already-configured server; supply `config` to restart with a replacement configuration. Session-scoped and ephemeral: does NOT modify persistent user configuration (`mcp.config.*`).",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Name of the MCP server to restart"
            },
            "config": {
              "$ref": "#/definitions/McpSerializableServerConfig",
              "description": "Replacement MCP server configuration (stdio process or remote HTTP/SSE). Omit to restart the server with its already-registered configuration (config-free restart-by-name)."
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.",
          "title": "McpRestartServerRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "stopServer": {
        "rpcMethod": "session.mcp.stopServer",
        "description": "Stops an individual MCP server on the session's host.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Name of the MCP server to stop"
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name for an individual MCP server stop.",
          "title": "McpStopServerRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "registerExternalClient": {
        "rpcMethod": "session.mcp.registerExternalClient",
        "description": "Registers a pre-connected external MCP client (e.g. IDE) on the session's host. The caller retains lifecycle ownership of the client and transport. Marked internal because the `client` and `transport` arguments are in-process MCP SDK instances that cannot be serialized across the JSON-RPC boundary; once the CLI moves on top of the SDK, external clients will be expressed as transport configs the runtime can construct itself.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Logical server name for the external client"
            },
            "client": {
              "description": "In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.",
              "visibility": "internal",
              "x-opaque-in-process": true
            },
            "transport": {
              "description": "In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.",
              "visibility": "internal",
              "x-opaque-in-process": true
            },
            "config": {
              "description": "In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.",
              "visibility": "internal",
              "x-opaque-in-process": true
            }
          },
          "required": [
            "sessionId",
            "serverName",
            "client",
            "transport",
            "config"
          ],
          "additionalProperties": false,
          "description": "Registration parameters for an external MCP client.",
          "title": "McpRegisterExternalClientRequest",
          "visibility": "internal"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "unregisterExternalClient": {
        "rpcMethod": "session.mcp.unregisterExternalClient",
        "description": "Unregisters a previously registered external MCP client by server name. Marked internal as the paired companion of `registerExternalClient`: only in-process callers that registered a client this way can meaningfully unregister it. Disappears alongside `registerExternalClient`: once external clients are described to the runtime as config rather than handed in as instances, lifecycle (including deregistration) is owned entirely by the runtime.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Server name of the external client to unregister"
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name identifying the external client to remove.",
          "title": "McpUnregisterExternalClientRequest",
          "visibility": "internal"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "isServerRunning": {
        "rpcMethod": "session.mcp.isServerRunning",
        "description": "Checks whether a named MCP server is currently running on the session's host.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "serverName": {
              "type": "string",
              "description": "Name of the MCP server to check"
            }
          },
          "required": [
            "sessionId",
            "serverName"
          ],
          "additionalProperties": false,
          "description": "Server name to check running status for.",
          "title": "McpIsServerRunningRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/McpIsServerRunningResult",
          "description": "Whether the named MCP server is running."
        },
        "stability": "experimental"
      },
      "oauth": {
        "handlePendingRequest": {
          "rpcMethod": "session.mcp.oauth.handlePendingRequest",
          "description": "Resolves a pending MCP OAuth request with a host-provided token or cancellation. The pending request is emitted as mcp.oauth_required with the data necessary to authorize the request.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "requestId": {
                "type": "string",
                "description": "OAuth request identifier from the mcp.oauth_required event"
              },
              "result": {
                "$ref": "#/definitions/McpOauthPendingRequestResponse",
                "description": "Host response to the pending OAuth request."
              }
            },
            "required": [
              "sessionId",
              "requestId",
              "result"
            ],
            "additionalProperties": false,
            "description": "Pending MCP OAuth request ID and host-provided token or cancellation response.",
            "title": "McpOauthHandlePendingRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpOauthHandlePendingResult",
            "description": "Indicates whether the pending MCP OAuth response was accepted."
          },
          "stability": "experimental"
        },
        "authenticationStateChanged": {
          "rpcMethod": "session.mcp.oauth.authenticationStateChanged",
          "description": "Notifies the session that MCP OAuth authentication succeeded and updated credentials were persisted, so cached tool definitions can be refreshed.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "description": "Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server."
              },
              "refreshSessionToken": {
                "type": "boolean",
                "description": "Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session."
              }
            },
            "required": [
              "sessionId"
            ],
            "additionalProperties": false,
            "description": "Identifies the MCP server whose persisted OAuth credentials were updated.",
            "title": "McpOauthAuthenticationStateChangedRequest",
            "stability": "experimental"
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "login": {
          "rpcMethod": "session.mcp.oauth.login",
          "description": "Starts OAuth authentication for a remote MCP server.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the remote MCP server to authenticate"
              },
              "forceReauth": {
                "type": "boolean",
                "description": "When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck."
              },
              "clientName": {
                "type": "string",
                "description": "Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees."
              },
              "callbackSuccessMessage": {
                "type": "string",
                "description": "Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return."
              },
              "clientId": {
                "type": "string",
                "description": "Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration."
              },
              "clientSecret": {
                "type": "string",
                "description": "Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it."
              },
              "publicClient": {
                "type": "boolean",
                "description": "Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store."
              },
              "grantType": {
                "$ref": "#/definitions/McpOauthLoginGrantType",
                "description": "Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified."
              }
            },
            "required": [
              "sessionId",
              "serverName"
            ],
            "additionalProperties": false,
            "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.",
            "title": "McpOauthLoginRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpOauthLoginResult",
            "description": "OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server."
          },
          "stability": "experimental"
        },
        "probe": {
          "rpcMethod": "session.mcp.oauth.probe",
          "description": "Passively probes a configured remote MCP server to classify whether OAuth is required or a cached/override token is accepted. Does not start OAuth, emit pending OAuth requests, or mutate MCP connection state.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the configured remote MCP server to probe."
              }
            },
            "required": [
              "sessionId",
              "serverName"
            ],
            "additionalProperties": false,
            "description": "Remote MCP server name for a passive OAuth status probe.",
            "title": "McpOauthProbeRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpOauthProbeResult",
            "description": "Passive MCP OAuth probe result. `authenticated` means the server accepted the probe request while an OAuth-origin access token was attached; it does not prove the server required or independently validated that token. The probe does not make a second unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures."
          },
          "stability": "experimental"
        },
        "respond": {
          "rpcMethod": "session.mcp.oauth.respond",
          "description": "Responds to a pending MCP OAuth authorization request by its request id.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "requestId": {
                "type": "string",
                "description": "OAuth request identifier from the mcp.oauth_required event"
              }
            },
            "required": [
              "sessionId",
              "requestId"
            ],
            "additionalProperties": false,
            "description": "Pending MCP OAuth request id to respond to.",
            "title": "McpOauthRespondRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpOauthRespondResult",
            "description": "Indicates whether the pending MCP OAuth response was accepted."
          },
          "stability": "experimental"
        }
      },
      "headers": {
        "handlePendingHeadersRefreshRequest": {
          "rpcMethod": "session.mcp.headers.handlePendingHeadersRefreshRequest",
          "description": "Responds to a pending MCP dynamic headers refresh request. Hosts that subscribe to `mcp.headers_refresh_required` use this to provide short-lived per-server headers or to indicate that no dynamic headers are available for this refresh.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "requestId": {
                "type": "string",
                "description": "Headers refresh request identifier from mcp.headers_refresh_required"
              },
              "result": {
                "$ref": "#/definitions/McpHeadersHandlePendingHeadersRefreshRequest",
                "description": "Host response: supply dynamic headers or decline this refresh."
              }
            },
            "required": [
              "sessionId",
              "requestId",
              "result"
            ],
            "additionalProperties": false,
            "description": "MCP headers refresh request id and the host response.",
            "title": "McpHeadersHandlePendingHeadersRefreshRequestRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpHeadersHandlePendingHeadersRefreshRequestResult",
            "description": "Indicates whether the pending MCP headers refresh response was accepted."
          },
          "stability": "experimental"
        }
      },
      "apps": {
        "readResource": {
          "rpcMethod": "session.mcp.apps.readResource",
          "description": "Fetch an MCP resource (typically a `ui://` MCP App bundle, per SEP-1865) from a connected server. Requires the `mcp-apps` session capability.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the MCP server hosting the resource"
              },
              "uri": {
                "type": "string",
                "description": "Resource URI (typically ui://...)"
              }
            },
            "required": [
              "sessionId",
              "serverName",
              "uri"
            ],
            "additionalProperties": false,
            "description": "MCP server and resource URI to fetch.",
            "title": "McpAppsReadResourceRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpAppsReadResourceResult",
            "description": "Resource contents returned by the MCP server."
          },
          "stability": "experimental"
        },
        "listTools": {
          "rpcMethod": "session.mcp.apps.listTools",
          "description": "List tools that an MCP App view is allowed to call (SEP-1865 visibility filter). Returns tools whose `_meta.ui.visibility` is unset (default `[\"model\",\"app\"]`) or includes `\"app\"`.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "MCP server hosting the app"
              },
              "originServerName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing."
              }
            },
            "required": [
              "sessionId",
              "serverName",
              "originServerName"
            ],
            "additionalProperties": false,
            "description": "MCP server to list app-callable tools for.",
            "title": "McpAppsListToolsRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpAppsListToolsResult",
            "description": "App-callable tools from the named MCP server."
          },
          "stability": "experimental"
        },
        "callTool": {
          "rpcMethod": "session.mcp.apps.callTool",
          "description": "Call an MCP tool from an MCP App view (SEP-1865). Enforces the visibility check that prevents an app iframe from invoking model-only tools. Returns the standard MCP `CallToolResult`.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "MCP server hosting the tool"
              },
              "toolName": {
                "type": "string",
                "description": "MCP tool name"
              },
              "arguments": {
                "type": "object",
                "additionalProperties": {
                  "x-opaque-json": true
                },
                "description": "Tool arguments"
              },
              "originServerName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing."
              }
            },
            "required": [
              "sessionId",
              "serverName",
              "toolName",
              "originServerName"
            ],
            "additionalProperties": false,
            "description": "MCP server, tool name, and arguments to invoke from an MCP App view.",
            "title": "McpAppsCallToolRequest",
            "stability": "experimental"
          },
          "result": {
            "type": "object",
            "additionalProperties": {
              "x-opaque-json": true
            },
            "description": "Standard MCP CallToolResult"
          },
          "stability": "experimental"
        },
        "setHostContext": {
          "rpcMethod": "session.mcp.apps.setHostContext",
          "description": "Replace the host context returned to MCP App guests on `ui/initialize`. Hosts use this to advertise theme, locale, or other metadata to the guest UI.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "context": {
                "$ref": "#/definitions/McpAppsSetHostContextDetails",
                "description": "Host context advertised to MCP App guests"
              }
            },
            "required": [
              "sessionId",
              "context"
            ],
            "additionalProperties": false,
            "description": "Host context to advertise to MCP App guests.",
            "title": "McpAppsSetHostContextRequest",
            "stability": "experimental"
          },
          "result": {
            "type": "null"
          },
          "stability": "experimental"
        },
        "getHostContext": {
          "rpcMethod": "session.mcp.apps.getHostContext",
          "description": "Read the current host context advertised to MCP App guests.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              }
            },
            "required": [
              "sessionId"
            ],
            "additionalProperties": false,
            "description": "Identifies the target session."
          },
          "result": {
            "$ref": "#/definitions/McpAppsHostContext",
            "description": "Current host context advertised to MCP App guests."
          },
          "stability": "experimental"
        },
        "diagnose": {
          "rpcMethod": "session.mcp.apps.diagnose",
          "description": "Diagnose MCP Apps wiring for a specific MCP server. Reports the session capability, feature-flag state, advertised extension, and how many tools have `_meta.ui` populated.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "MCP server to probe"
              }
            },
            "required": [
              "sessionId",
              "serverName"
            ],
            "additionalProperties": false,
            "description": "MCP server to diagnose MCP Apps wiring for.",
            "title": "McpAppsDiagnoseRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpAppsDiagnoseResult",
            "description": "Diagnostic snapshot of MCP Apps wiring for the named server."
          },
          "stability": "experimental"
        }
      },
      "resources": {
        "read": {
          "rpcMethod": "session.mcp.resources.read",
          "description": "Fetch an MCP resource from a connected server by URI (proxies MCP `resources/read`).",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the MCP server hosting the resource"
              },
              "uri": {
                "type": "string",
                "description": "Resource URI"
              }
            },
            "required": [
              "sessionId",
              "serverName",
              "uri"
            ],
            "additionalProperties": false,
            "description": "MCP server and resource URI to fetch.",
            "title": "McpResourcesReadRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpResourcesReadResult",
            "description": "Resource contents returned by the MCP server."
          },
          "stability": "experimental"
        },
        "list": {
          "rpcMethod": "session.mcp.resources.list",
          "description": "Enumerate one page of resources a connected MCP server exposes (proxies MCP `resources/list`). Pass `cursor` to continue from a prior result's `nextCursor`.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the MCP server whose resources to enumerate"
              },
              "cursor": {
                "type": "string",
                "description": "Opaque MCP pagination cursor from a prior `nextCursor` value"
              }
            },
            "required": [
              "sessionId",
              "serverName"
            ],
            "additionalProperties": false,
            "description": "MCP server whose resources to enumerate.",
            "title": "McpResourcesListRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpResourcesListResult",
            "description": "One page of resources advertised by the named MCP server."
          },
          "stability": "experimental"
        },
        "listTemplates": {
          "rpcMethod": "session.mcp.resources.listTemplates",
          "description": "Enumerate one page of resource templates a connected MCP server exposes (proxies MCP `resources/templates/list`). Pass `cursor` to continue from a prior result's `nextCursor`.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "serverName": {
                "type": "string",
                "minLength": 1,
                "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
                "description": "Name of the MCP server whose resource templates to enumerate"
              },
              "cursor": {
                "type": "string",
                "description": "Opaque MCP pagination cursor from a prior `nextCursor` value"
              }
            },
            "required": [
              "sessionId",
              "serverName"
            ],
            "additionalProperties": false,
            "description": "MCP server whose resource templates to enumerate.",
            "title": "McpResourcesListTemplatesRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/McpResourcesListTemplatesResult",
            "description": "One page of resource templates advertised by the named MCP server."
          },
          "stability": "experimental"
        }
      }
    },
    "plugins": {
      "list": {
        "rpcMethod": "session.plugins.list",
        "description": "Lists plugins installed for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/PluginList",
          "description": "Plugins installed for the session, with their enabled state and version metadata."
        },
        "stability": "experimental"
      },
      "reload": {
        "rpcMethod": "session.plugins.reload",
        "description": "Reloads the session's plugin set, refreshing MCP servers, custom agents, hooks, and skills cache so SDK-driven changes via `server.plugins.*` take effect immediately.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "reloadMcp": {
                  "type": "boolean",
                  "description": "Reload MCP server connections after refreshing plugins. Defaults to true."
                },
                "reloadCustomAgents": {
                  "type": "boolean",
                  "description": "Re-run custom-agent discovery after refreshing plugins. Defaults to true."
                },
                "reloadHooks": {
                  "type": "boolean",
                  "description": "Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions)."
                },
                "reloadExtensions": {
                  "type": "boolean",
                  "description": "Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session)."
                },
                "deferRepoHooks": {
                  "type": "boolean",
                  "description": "When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Optional flags controlling which side effects the reload performs.",
          "title": "PluginsReloadRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "provider": {
      "getEndpoint": {
        "rpcMethod": "session.provider.getEndpoint",
        "description": "Returns the provider endpoint and credentials the session is currently configured to talk to, so the caller can make inference calls directly against the same backend the session uses.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "modelId": {
                  "type": "string",
                  "description": "Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Optional model identifier to scope the endpoint snapshot to.",
          "title": "ProviderGetEndpointRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ProviderEndpoint",
          "description": "A snapshot of the provider endpoint the session is currently configured to talk to."
        },
        "stability": "experimental"
      },
      "add": {
        "rpcMethod": "session.provider.add",
        "description": "Adds BYOK providers and/or models to the session's registry at runtime, extending the additive registry built from the session's `providers`/`models` options. Both fields are optional, so a call may add providers only, models only, or both. Within a single call providers are registered before models, so a model may reference a provider added in the same call; across calls a model may reference any provider already registered (from session creation or a prior add). A model whose referenced provider is not registered by the end of the call is rejected. Newly added models become selectable via `model.list` / `model.switchTo` and are inherited by sub-agents spawned afterwards.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "providers": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/NamedProviderConfig",
                "description": "External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch."
              },
              "description": "Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'."
            },
            "models": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ProviderModelConfig",
                "description": "A BYOK model definition referencing a named provider."
              },
              "description": "BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.",
          "title": "ProviderAddRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ProviderAddResult",
          "description": "The selectable model entries synthesized for the models added by this call."
        },
        "stability": "experimental"
      }
    },
    "options": {
      "update": {
        "rpcMethod": "session.options.update",
        "description": "Patches the genuinely-mutable subset of session options.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "model": {
              "type": "string",
              "description": "The model ID to use for assistant turns."
            },
            "modelCapabilitiesOverrides": {
              "$ref": "#/definitions/ModelCapabilitiesOverride",
              "description": "Per-property model capability overrides for the selected model."
            },
            "reasoningEffort": {
              "type": "string",
              "description": "Reasoning effort for the selected model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied."
            },
            "reasoningSummary": {
              "$ref": "#/definitions/OptionsUpdateReasoningSummary",
              "description": "Reasoning summary mode for supported model clients."
            },
            "verbosity": {
              "$ref": "#/definitions/Verbosity",
              "description": "Output verbosity level for supported models."
            },
            "clientName": {
              "type": "string",
              "description": "Identifier of the client driving the session."
            },
            "lspClientName": {
              "type": "string",
              "description": "Identifier sent to LSP-style integrations."
            },
            "integrationId": {
              "type": "string",
              "description": "Stable integration identifier used for analytics and rate-limit attribution."
            },
            "featureFlags": {
              "type": "object",
              "additionalProperties": {
                "type": "boolean"
              },
              "description": "Map of feature-flag IDs to their boolean enabled state."
            },
            "isExperimentalMode": {
              "type": "boolean",
              "description": "Whether experimental capabilities are enabled."
            },
            "provider": {
              "$ref": "#/definitions/ProviderConfig",
              "description": "Custom model-provider configuration (BYOK)."
            },
            "capi": {
              "$ref": "#/definitions/CapiSessionOptions",
              "description": "Options scoped to the built-in CAPI (Copilot API) provider."
            },
            "workingDirectory": {
              "type": "string",
              "description": "Absolute working-directory path for shell tools."
            },
            "availableTools": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Allowlist of tool names available to this session."
            },
            "excludedTools": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Denylist of tool names for this session."
            },
            "includedBuiltinAgents": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction."
            },
            "excludedBuiltinAgents": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available."
            },
            "toolFilterPrecedence": {
              "$ref": "#/definitions/OptionsUpdateToolFilterPrecedence",
              "description": "Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set."
            },
            "enableScriptSafety": {
              "type": "boolean",
              "description": "Whether shell-script safety heuristics are enabled."
            },
            "shell": {
              "$ref": "#/definitions/ShellOptions",
              "description": "Per-session settings for built-in shell tools."
            },
            "shellInitProfile": {
              "type": "string",
              "description": "Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).",
              "deprecated": true
            },
            "shellProcessFlags": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "PowerShell process flags applied to built-in and user-requested shell commands."
            },
            "sandboxConfig": {
              "$ref": "#/definitions/SandboxConfig",
              "description": "Resolved sandbox configuration."
            },
            "sandboxConfigSource": {
              "$ref": "#/definitions/SandboxConfigSource",
              "description": "Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently.",
              "visibility": "internal"
            },
            "logInteractiveShells": {
              "type": "boolean",
              "description": "Whether interactive shell sessions are logged."
            },
            "envValueMode": {
              "$ref": "#/definitions/OptionsUpdateEnvValueMode",
              "description": "How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch)."
            },
            "allowAllMcpServerInstructions": {
              "type": "boolean",
              "description": "Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers."
            },
            "skillDirectories": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Additional directories to search for skills."
            },
            "includedBuiltinSkills": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "null"
                }
              ],
              "description": "Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. Set to null to remove the allowlist restriction."
            },
            "disabledSkills": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Skill IDs that should be excluded from this session."
            },
            "enableOnDemandInstructionDiscovery": {
              "type": "boolean",
              "description": "Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`."
            },
            "maxInlineBinaryBytes": {
              "type": "integer",
              "minimum": 0,
              "description": "Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB."
            },
            "installedPlugins": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SessionInstalledPlugin",
                "description": "Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source."
              },
              "description": "Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes."
            },
            "customAgentsLocalOnly": {
              "type": "boolean",
              "description": "Whether to default custom agents to local-only execution."
            },
            "suppressCustomAgentPrompt": {
              "type": "boolean",
              "description": "When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement."
            },
            "skipCustomInstructions": {
              "type": "boolean",
              "description": "Whether to skip loading custom instruction sources."
            },
            "disabledInstructionSources": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Instruction source IDs to exclude from the system prompt."
            },
            "coauthorEnabled": {
              "type": "boolean",
              "description": "Whether to include the `Co-authored-by` trailer in commit messages."
            },
            "trajectoryFile": {
              "type": "string",
              "description": "Optional path for trajectory output."
            },
            "enableStreaming": {
              "type": "boolean",
              "description": "Whether to stream model responses."
            },
            "copilotUrl": {
              "type": "string",
              "description": "Override URL for the Copilot API endpoint."
            },
            "askUserDisabled": {
              "type": "boolean",
              "description": "Whether to disable the `ask_user` tool (encourages autonomous behavior)."
            },
            "continueOnAutoMode": {
              "type": "boolean",
              "description": "Whether to allow auto-mode continuation across turns."
            },
            "runningInInteractiveMode": {
              "type": "boolean",
              "description": "Whether the session is running in an interactive UI."
            },
            "enableReasoningSummaries": {
              "type": "boolean",
              "description": "Whether to surface reasoning-summary events from the model."
            },
            "agentContext": {
              "type": "string",
              "description": "Runtime context discriminator (e.g., `cli`, `actions`)."
            },
            "eventsLogDirectory": {
              "type": "string",
              "description": "Override directory for the session-events log. When unset, the runtime's default events log directory is used."
            },
            "eventsLogIncludesSubagents": {
              "type": "boolean",
              "description": "Whether subagent callback events should be forwarded into the session event log sink."
            },
            "additionalContentExclusionPolicies": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/OptionsUpdateAdditionalContentExclusionPolicy",
                "description": "Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope."
              },
              "description": "Additional content-exclusion policies to merge into the session's policy set.",
              "stability": "experimental"
            },
            "manageScheduleEnabled": {
              "type": "boolean",
              "description": "Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users)."
            },
            "sessionCapabilities": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SessionCapability",
                "description": "Session capability id"
              },
              "description": "Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged."
            },
            "skipEmbeddingRetrieval": {
              "type": "boolean",
              "description": "Whether to skip embedding retrieval pipeline initialization and execution."
            },
            "organizationCustomInstructions": {
              "type": "string",
              "description": "Organization-level custom instructions to inject into the system prompt."
            },
            "enableFileHooks": {
              "type": "boolean",
              "description": "Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism."
            },
            "enableHostGitOperations": {
              "type": "boolean",
              "description": "Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt)."
            },
            "enableSessionStore": {
              "type": "boolean",
              "description": "Whether to enable cross-session store writes and reads."
            },
            "enableSkills": {
              "type": "boolean",
              "description": "Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset."
            },
            "contextTier": {
              "$ref": "#/definitions/OptionsUpdateContextTier",
              "description": "Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier."
            },
            "sessionLimits": {
              "anyOf": [
                {
                  "$ref": "#/definitions/SessionLimitsConfig",
                  "description": "Optional session limits."
                },
                {
                  "type": "null"
                }
              ],
              "description": "Optional session limits. Pass null to clear the session limits."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Patch of mutable session options to apply to the running session.",
          "title": "SessionUpdateOptionsParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionUpdateOptionsResult",
          "description": "Indicates whether the session options patch was applied successfully."
        },
        "stability": "experimental"
      }
    },
    "lsp": {
      "initialize": {
        "rpcMethod": "session.lsp.initialize",
        "description": "Loads the merged LSP configuration set for the session's working directory.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "workingDirectory": {
              "type": "string",
              "description": "Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted."
            },
            "gitRoot": {
              "type": "string",
              "description": "Git root used as the boundary when traversing for project-level LSP configs (supports monorepos)."
            },
            "force": {
              "type": "boolean",
              "description": "Force re-initialization even when LSP configs were already loaded for the working directory."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Parameters for (re)loading the merged LSP configuration set.",
          "title": "LspInitializeRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "extensions": {
      "list": {
        "rpcMethod": "session.extensions.list",
        "description": "Lists extensions discovered for the session and their current status.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/ExtensionList",
          "description": "Extensions discovered for the session, with their current status."
        },
        "stability": "experimental"
      },
      "enable": {
        "rpcMethod": "session.extensions.enable",
        "description": "Enables an extension for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Source-qualified extension ID to enable"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Source-qualified extension identifier to enable for the session.",
          "title": "ExtensionsEnableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "session.extensions.disable",
        "description": "Disables an extension for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Source-qualified extension ID to disable"
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Source-qualified extension identifier to disable for the session.",
          "title": "ExtensionsDisableRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "reload": {
        "rpcMethod": "session.extensions.reload",
        "description": "Reloads extension definitions and processes for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "sendAttachmentsToMessage": {
        "rpcMethod": "session.extensions.sendAttachmentsToMessage",
        "description": "Push attachments into the next user-message turn from an extension. The host should surface them as composer pills and forward them via the next session.send call. Callable only by extension-owned connections.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "instanceId": {
              "type": "string",
              "description": "Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment."
            },
            "attachments": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/PushAttachment",
                "description": "Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context."
              },
              "description": "Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape."
            }
          },
          "required": [
            "sessionId",
            "attachments"
          ],
          "additionalProperties": false,
          "description": "Parameters for session.extensions.sendAttachmentsToMessage.",
          "title": "SendAttachmentsToMessageParams",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "tools": {
      "execute": {
        "rpcMethod": "session.tools.execute",
        "description": "Executes one tool from the session's currently offered tool set through the native invocation pipeline.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Name of the currently offered tool to execute."
            },
            "arguments": {
              "description": "Arguments supplied to the tool.",
              "x-opaque-json": true
            },
            "toolCallId": {
              "type": "string",
              "description": "Optional identifier used to correlate this invocation with its tool call."
            }
          },
          "required": [
            "sessionId",
            "name",
            "arguments"
          ],
          "additionalProperties": false,
          "description": "A tool name and arguments to execute through the session's native invocation pipeline.",
          "title": "ToolsExecuteRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ToolResult",
          "description": "Canonical result returned by a session tool."
        },
        "stability": "experimental"
      },
      "getBuiltinDescriptors": {
        "rpcMethod": "session.tools.getBuiltinDescriptors",
        "description": "Returns the Rust-owned built-in tool descriptors used to construct the session's offered tool set.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "reduceUserIntervention": {
              "type": "boolean",
              "description": "Whether descriptors should favor fewer user-intervention prompts."
            },
            "includeAuthor": {
              "type": "boolean",
              "description": "Whether tool descriptors should include authoring metadata."
            },
            "skillEmbeddingEnabled": {
              "type": "boolean",
              "description": "Whether semantic skill lookup is available."
            },
            "shellConfig": {
              "$ref": "#/definitions/ToolsShellDescriptorConfig",
              "description": "Shell-specific names and description lines for shell tools."
            },
            "shellSupportsPowerShell7Syntax": {
              "type": "boolean",
              "description": "Whether the configured shell supports PowerShell 7 syntax."
            },
            "shellTimeoutMs": {
              "type": "number",
              "description": "Default shell timeout in milliseconds."
            },
            "backgroundTaskNotificationsEnabled": {
              "type": "boolean",
              "description": "Whether background task completion notifications are enabled."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Options controlling how Rust-owned built-in tool descriptors are materialized.",
          "title": "ToolsGetBuiltinDescriptorsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ToolsGetBuiltinDescriptorsResult",
          "description": "Rust-owned built-in tool descriptors for the session."
        },
        "stability": "experimental"
      },
      "taskCompleteEventData": {
        "rpcMethod": "session.tools.taskCompleteEventData",
        "description": "Projects a completed task_complete tool call into its label-safe session event payload.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "toolArgs": {
              "description": "Arguments supplied to the completed task_complete tool call.",
              "x-opaque-json": true
            },
            "finalResult": {
              "$ref": "#/definitions/ToolResultExpanded",
              "description": "Final expanded result returned by the task_complete tool."
            }
          },
          "required": [
            "sessionId",
            "toolArgs",
            "finalResult"
          ],
          "additionalProperties": false,
          "description": "Task-completion tool arguments and final result used to build a label-safe session event payload.",
          "title": "ToolsTaskCompleteEventDataRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/TaskCompleteData",
          "description": "Task completion notification with summary from the agent"
        },
        "stability": "experimental"
      },
      "handlePendingToolCall": {
        "rpcMethod": "session.tools.handlePendingToolCall",
        "description": "Provides the result for a pending external tool call.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Request ID of the pending tool call"
            },
            "result": {
              "$ref": "#/definitions/ExternalToolResult",
              "description": "Tool call result (string or expanded result object)"
            },
            "error": {
              "type": "string",
              "description": "Error message if the tool call failed"
            }
          },
          "required": [
            "sessionId",
            "requestId"
          ],
          "additionalProperties": false,
          "description": "Pending external tool call request ID, with the tool result or an error describing why it failed.",
          "title": "HandlePendingToolCallRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HandlePendingToolCallResult",
          "description": "Indicates whether the external tool call result was handled successfully."
        },
        "stability": "experimental"
      },
      "initializeAndValidate": {
        "rpcMethod": "session.tools.initializeAndValidate",
        "description": "Resolves, builds, and validates the runtime tool list for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/ToolsInitializeAndValidateResult",
          "description": "Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation."
        },
        "stability": "experimental"
      },
      "getCurrentMetadata": {
        "rpcMethod": "session.tools.getCurrentMetadata",
        "description": "Returns lightweight metadata for the session's currently initialized tools.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/ToolsGetCurrentMetadataResult",
          "description": "Current lightweight tool metadata snapshot for the session."
        },
        "stability": "experimental"
      },
      "set": {
        "rpcMethod": "session.tools.set",
        "description": "Atomically replaces the complete externally implemented tool list supplied by the calling connection. Built-in, MCP/plugin, extension-discovered, subagent, and tools supplied by other connections remain unchanged.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "tools": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ProtocolExternalToolDefinition",
                "description": "Serializable definition of a caller-implemented tool whose execution is handled over the SDK connection."
              },
              "description": "Complete replacement list for the calling connection."
            }
          },
          "required": [
            "sessionId",
            "tools"
          ],
          "additionalProperties": false,
          "description": "Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection.",
          "title": "ToolsSetRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ToolsSetResult",
          "description": "Empty result after replacing the calling connection's externally implemented tools."
        },
        "stability": "experimental"
      },
      "updateSubagentSettings": {
        "rpcMethod": "session.tools.updateSubagentSettings",
        "description": "Updates the current session's live subagent settings after user settings change. The persisted user settings remain the source of truth for future sessions.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "subagents": {
              "$ref": "#/definitions/SubagentSettings",
              "description": "Subagent settings to apply, or null to clear the live session override"
            }
          },
          "required": [
            "sessionId",
            "subagents"
          ],
          "additionalProperties": false,
          "description": "Subagent settings to apply to the current session",
          "title": "UpdateSubagentSettingsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ToolsUpdateSubagentSettingsResult",
          "description": "Empty result after applying subagent settings"
        },
        "stability": "experimental"
      }
    },
    "commands": {
      "list": {
        "rpcMethod": "session.commands.list",
        "description": "Lists slash commands available in the session.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "includeBuiltins": {
                  "type": "boolean",
                  "description": "Include runtime built-in commands"
                },
                "includeSkills": {
                  "type": "boolean",
                  "description": "Include enabled user-invocable skills and commands"
                },
                "includeClientCommands": {
                  "type": "boolean",
                  "description": "Include commands registered by protocol clients, including SDK clients and extensions"
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Optional filters controlling which command sources to include in the listing.",
          "title": "CommandsListRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CommandList",
          "description": "Slash commands available in the session, after applying any include/exclude filters."
        },
        "stability": "experimental"
      },
      "invoke": {
        "rpcMethod": "session.commands.invoke",
        "description": "Invokes a slash command in the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Command name. Leading slashes are stripped and the name is matched case-insensitively."
            },
            "input": {
              "type": "string",
              "description": "Raw input after the command name"
            },
            "origin": {
              "$ref": "#/definitions/CommandsInvocationOrigin",
              "description": "Optional client surface that initiated the invocation"
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "Slash command name and optional raw input string to invoke.",
          "title": "CommandsInvokeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SlashCommandInvocationResult",
          "description": "Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection)."
        },
        "stability": "experimental"
      },
      "finalizeInvocationEffect": {
        "rpcMethod": "session.commands.finalizeInvocationEffect",
        "description": "Finalizes persistence associated with a client-applied slash-command effect.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "effect": {
              "type": "object",
              "properties": {},
              "description": "The slash-command result object that produced the pending effect, echoed back unchanged."
            },
            "outcome": {
              "$ref": "#/definitions/CommandsInvocationEffectOutcome",
              "description": "Whether the host applied or cancelled the pending invocation effect."
            }
          },
          "required": [
            "sessionId",
            "effect",
            "outcome"
          ],
          "additionalProperties": false,
          "description": "The pending slash-command invocation effect to finalize, plus whether the host applied or cancelled it.",
          "title": "CommandsFinalizeInvocationEffectRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CommandsFinalizeInvocationEffectResult",
          "description": "Whether finalizing the invocation effect succeeded, and the failure reason when it did not."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "handlePendingCommand": {
        "rpcMethod": "session.commands.handlePendingCommand",
        "description": "Reports completion of a pending client-handled slash command.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Request ID from the command invocation event"
            },
            "error": {
              "type": "string",
              "description": "Error message if the command handler failed"
            }
          },
          "required": [
            "sessionId",
            "requestId"
          ],
          "additionalProperties": false,
          "description": "Pending command request ID and an optional error if the client handler failed.",
          "title": "CommandsHandlePendingCommandRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CommandsHandlePendingCommandResult",
          "description": "Indicates whether the pending client-handled command was completed successfully."
        },
        "stability": "experimental"
      },
      "execute": {
        "rpcMethod": "session.commands.execute",
        "description": "Executes a slash command synchronously and returns any error.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "commandName": {
              "type": "string",
              "description": "Name of the slash command to invoke (without the leading '/')."
            },
            "args": {
              "type": "string",
              "description": "Argument string to pass to the command (empty string if none)."
            }
          },
          "required": [
            "sessionId",
            "commandName",
            "args"
          ],
          "additionalProperties": false,
          "description": "Slash command name and argument string to execute synchronously.",
          "title": "ExecuteCommandParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ExecuteCommandResult",
          "description": "Error message produced while executing the command, if any."
        },
        "stability": "experimental"
      },
      "enqueue": {
        "rpcMethod": "session.commands.enqueue",
        "description": "Enqueues a slash command for FIFO processing on the local session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "command": {
              "type": "string",
              "description": "Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately."
            },
            "displayText": {
              "type": [
                "string",
                "null"
              ],
              "description": "Optional user-facing text for the queue row. The command string is shown when omitted."
            }
          },
          "required": [
            "sessionId",
            "command"
          ],
          "additionalProperties": false,
          "description": "Slash-prefixed command string to enqueue for FIFO processing.",
          "title": "EnqueueCommandParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/EnqueueCommandResult",
          "description": "Indicates whether the command was accepted into the local execution queue."
        },
        "stability": "experimental"
      },
      "respondToQueuedCommand": {
        "rpcMethod": "session.commands.respondToQueuedCommand",
        "description": "Reports whether the host actually executed a queued command and whether to continue processing.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Request ID from the `command.queued` event the host is responding to."
            },
            "result": {
              "$ref": "#/definitions/QueuedCommandResult",
              "description": "Result of the queued command execution."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "result"
          ],
          "additionalProperties": false,
          "description": "Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).",
          "title": "CommandsRespondToQueuedCommandRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CommandsRespondToQueuedCommandResult",
          "description": "Indicates whether the queued-command response was matched to a pending request."
        },
        "stability": "experimental"
      }
    },
    "telemetry": {
      "getEngagementId": {
        "rpcMethod": "session.telemetry.getEngagementId",
        "description": "Gets the telemetry engagement ID currently associated with the session, when available.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionTelemetryEngagement",
          "description": "Telemetry engagement ID for the session, when available."
        },
        "stability": "experimental"
      },
      "setFeatureOverrides": {
        "rpcMethod": "session.telemetry.setFeatureOverrides",
        "description": "Sets feature override key/value pairs to attach to subsequent telemetry events for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "features": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "description": "Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides."
            }
          },
          "required": [
            "sessionId",
            "features"
          ],
          "additionalProperties": false,
          "description": "Feature override key/value pairs to attach to subsequent telemetry events from this session.",
          "title": "TelemetrySetFeatureOverridesRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      }
    },
    "ui": {
      "ephemeralQuery": {
        "rpcMethod": "session.ui.ephemeralQuery",
        "description": "Runs a transient no-tools model query against the current conversation context.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "question": {
              "type": "string",
              "description": "Question to answer from the current conversation context."
            },
            "onChunk": {
              "description": "In-process streaming callback `(text) => void` invoked with each token as the model emits it. Internal and excluded from the public SDK surface.",
              "visibility": "internal",
              "x-opaque-in-process": true
            },
            "abortSignal": {
              "description": "In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Internal and excluded from the public SDK surface.",
              "visibility": "internal",
              "x-opaque-in-process": true
            }
          },
          "required": [
            "sessionId",
            "question"
          ],
          "additionalProperties": false,
          "description": "Transient question to answer without adding it to conversation history.",
          "title": "UIEphemeralQueryRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIEphemeralQueryResult",
          "description": "Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs."
        },
        "stability": "experimental"
      },
      "elicitation": {
        "rpcMethod": "session.ui.elicitation",
        "description": "Requests structured input from a UI-capable client.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/McpElicitationFormMode",
              "description": "Elicitation mode. Omitted and form are equivalent for structured elicitation."
            },
            "message": {
              "type": "string",
              "description": "Message describing what information is needed from the user"
            },
            "requestedSchema": {
              "$ref": "#/definitions/UIElicitationSchema",
              "description": "JSON Schema describing the form fields to present to the user"
            },
            "_meta": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "MCP request metadata."
            },
            "task": {
              "$ref": "#/definitions/McpTaskMetadata",
              "description": "MCP task metadata."
            }
          },
          "required": [
            "sessionId",
            "message",
            "requestedSchema"
          ],
          "additionalProperties": true,
          "description": "Prompt message and JSON schema describing the form fields to elicit from the user.",
          "title": "UIElicitationRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIElicitationResponse",
          "description": "The elicitation response (accept with form values, decline, or cancel)"
        },
        "stability": "experimental"
      },
      "handlePendingElicitation": {
        "rpcMethod": "session.ui.handlePendingElicitation",
        "description": "Provides the user response for a pending elicitation request.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the elicitation.requested event"
            },
            "result": {
              "$ref": "#/definitions/UIElicitationResponse",
              "description": "The elicitation response (accept with form values, decline, or cancel)"
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "result"
          ],
          "additionalProperties": false,
          "description": "Pending elicitation request ID and the user's response (accept/decline/cancel + form values).",
          "title": "UIHandlePendingElicitationRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIElicitationResult",
          "description": "Indicates whether the elicitation response was accepted; false if it was already resolved by another client."
        },
        "stability": "experimental"
      },
      "handlePendingUserInput": {
        "rpcMethod": "session.ui.handlePendingUserInput",
        "description": "Resolves a pending `user_input.requested` event with the user's response.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the user_input.requested event"
            },
            "response": {
              "$ref": "#/definitions/UIUserInputResponse",
              "description": "User response for a pending user-input request, with answer text and whether it was typed freeform."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "response"
          ],
          "additionalProperties": false,
          "description": "Request ID of a pending `user_input.requested` event and the user's response.",
          "title": "UIHandlePendingUserInputRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIHandlePendingResult",
          "description": "Indicates whether the pending UI request was resolved by this call."
        },
        "stability": "experimental"
      },
      "handlePendingSampling": {
        "rpcMethod": "session.ui.handlePendingSampling",
        "description": "Resolves a pending `sampling.requested` event with a sampling result, or rejects it.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the sampling.requested event"
            },
            "response": {
              "$ref": "#/definitions/UIHandlePendingSamplingResponse",
              "description": "Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result."
            }
          },
          "required": [
            "sessionId",
            "requestId"
          ],
          "additionalProperties": false,
          "description": "Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject).",
          "title": "UIHandlePendingSamplingRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIHandlePendingResult",
          "description": "Indicates whether the pending UI request was resolved by this call."
        },
        "stability": "experimental"
      },
      "handlePendingAutoModeSwitch": {
        "rpcMethod": "session.ui.handlePendingAutoModeSwitch",
        "description": "Resolves a pending `auto_mode_switch.requested` event with the user's accept/decline decision.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the auto_mode_switch.requested event"
            },
            "response": {
              "$ref": "#/definitions/UIAutoModeSwitchResponse",
              "description": "User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline)."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "response"
          ],
          "additionalProperties": false,
          "description": "Request ID of a pending `auto_mode_switch.requested` event and the user's response.",
          "title": "UIHandlePendingAutoModeSwitchRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIHandlePendingResult",
          "description": "Indicates whether the pending UI request was resolved by this call."
        },
        "stability": "experimental"
      },
      "handlePendingSessionLimitsExhausted": {
        "rpcMethod": "session.ui.handlePendingSessionLimitsExhausted",
        "description": "Resolves a pending `session_limits_exhausted.requested` event with the user's selected limit action.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the session_limits_exhausted.requested event"
            },
            "response": {
              "$ref": "#/definitions/UISessionLimitsExhaustedResponse",
              "description": "The selected session-limit action."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "response"
          ],
          "additionalProperties": false,
          "description": "Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action.",
          "title": "UIHandlePendingSessionLimitsExhaustedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIHandlePendingResult",
          "description": "Indicates whether the pending UI request was resolved by this call."
        },
        "stability": "experimental"
      },
      "handlePendingExitPlanMode": {
        "rpcMethod": "session.ui.handlePendingExitPlanMode",
        "description": "Resolves a pending `exit_plan_mode.requested` event with the user's response.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "The unique request ID from the exit_plan_mode.requested event"
            },
            "response": {
              "$ref": "#/definitions/UIExitPlanModeResponse",
              "description": "User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "response"
          ],
          "additionalProperties": false,
          "description": "Request ID of a pending `exit_plan_mode.requested` event and the user's response.",
          "title": "UIHandlePendingExitPlanModeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIHandlePendingResult",
          "description": "Indicates whether the pending UI request was resolved by this call."
        },
        "stability": "experimental"
      },
      "registerDirectAutoModeSwitchHandler": {
        "rpcMethod": "session.ui.registerDirectAutoModeSwitchHandler",
        "description": "Registers an in-process handler for auto-mode-switch requests so the server bridge skips dispatch.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/UIRegisterDirectAutoModeSwitchHandlerResult",
          "description": "Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId)."
        },
        "stability": "experimental"
      },
      "unregisterDirectAutoModeSwitchHandler": {
        "rpcMethod": "session.ui.unregisterDirectAutoModeSwitchHandler",
        "description": "Unregisters a previously-registered in-process auto-mode-switch handler by its opaque handle.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "handle": {
              "type": "string",
              "description": "Handle previously returned by `registerDirectAutoModeSwitchHandler`"
            }
          },
          "required": [
            "sessionId",
            "handle"
          ],
          "additionalProperties": false,
          "description": "Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release.",
          "title": "UIUnregisterDirectAutoModeSwitchHandlerRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UIUnregisterDirectAutoModeSwitchHandlerResult",
          "description": "Indicates whether the handle was active and the registration count was decremented."
        },
        "stability": "experimental"
      }
    },
    "permissions": {
      "configure": {
        "rpcMethod": "session.permissions.configure",
        "description": "Replaces selected permission policy fields (rules, paths, URLs, exclusions, allow-all flags) on the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "approveAllToolPermissionRequests": {
              "type": "boolean",
              "description": "If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged."
            },
            "approveAllReadPermissionRequests": {
              "type": "boolean",
              "description": "If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged."
            },
            "rules": {
              "$ref": "#/definitions/PermissionRulesSet",
              "description": "If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged."
            },
            "paths": {
              "$ref": "#/definitions/PermissionPathsConfig",
              "description": "If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged."
            },
            "urls": {
              "$ref": "#/definitions/PermissionUrlsConfig",
              "description": "If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged."
            },
            "additionalContentExclusionPolicies": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/PermissionsConfigureAdditionalContentExclusionPolicy",
                "description": "Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope."
              },
              "description": "If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Patch of permission policy fields to apply (omit a field to leave it unchanged).",
          "title": "PermissionsConfigureParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsConfigureResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "handlePendingPermissionRequest": {
        "rpcMethod": "session.permissions.handlePendingPermissionRequest",
        "description": "Provides a decision for a pending tool permission request.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Request ID of the pending permission request"
            },
            "result": {
              "$ref": "#/definitions/PermissionDecision",
              "description": "The client's response to the pending permission prompt"
            },
            "decisionContext": {
              "$ref": "#/definitions/PermissionDecisionContext",
              "description": "Optional informational context describing how and where this response was made. Omit it to preserve legacy behavior without attributing an origin."
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "result"
          ],
          "additionalProperties": false,
          "description": "Pending permission request ID and the decision to apply (approve/reject and scope).",
          "title": "PermissionDecisionRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionRequestResult",
          "description": "Indicates whether the permission decision was applied; false when the request was already resolved."
        },
        "stability": "experimental"
      },
      "pendingRequests": {
        "rpcMethod": "session.permissions.pendingRequests",
        "description": "Reconstructs the set of pending tool permission requests from the session's event history.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "No parameters; returns currently-pending permission requests for the session.",
          "title": "PermissionsPendingRequestsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PendingPermissionRequestList",
          "description": "List of pending permission requests reconstructed from event history."
        },
        "stability": "experimental"
      },
      "setApproveAll": {
        "rpcMethod": "session.permissions.setApproveAll",
        "description": "Enables or disables automatic approval of tool permission requests for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "enabled": {
              "type": "boolean",
              "description": "Whether to auto-approve all tool permission requests"
            },
            "source": {
              "$ref": "#/definitions/PermissionsSetApproveAllSource",
              "description": "Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers."
            }
          },
          "required": [
            "sessionId",
            "enabled"
          ],
          "additionalProperties": false,
          "description": "Allow-all toggle for tool permission requests, with an optional telemetry source.",
          "title": "PermissionsSetApproveAllRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsSetApproveAllResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "setMode": {
        "rpcMethod": "session.permissions.setMode",
        "description": "Sets the permission mode for the session. `manual` follows the normal approval flow, `assisted` attaches LLM safety recommendations, and `allow-all` automatically approves permission requests. The result returns the authoritative post-mutation mode so callers can update local state without racing the `session.permissions_changed` notification.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/PermissionMode",
              "description": "Permission mode to apply"
            },
            "assistedApprovalModel": {
              "type": "string",
              "description": "Optional judge model id for assisted mode. When omitted, the session resolves the provider default: `gpt-5.5` for CAPI sessions and the active session model for BYOK sessions."
            },
            "source": {
              "$ref": "#/definitions/PermissionModeSource",
              "description": "Optional source for permission-mode telemetry. Defaults to `rpc` when omitted for SDK callers."
            }
          },
          "required": [
            "sessionId",
            "mode"
          ],
          "additionalProperties": false,
          "description": "Permission mode to apply for the session.",
          "title": "PermissionsSetModeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsSetModeResult",
          "description": "Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode."
        },
        "stability": "experimental"
      },
      "getMode": {
        "rpcMethod": "session.permissions.getMode",
        "description": "Returns the current permission mode for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "No parameters.",
          "title": "PermissionsGetModeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsGetModeResult",
          "description": "Current permission mode."
        },
        "stability": "experimental"
      },
      "modifyRules": {
        "rpcMethod": "session.permissions.modifyRules",
        "description": "Adds or removes session-scoped or location-scoped permission rules.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "scope": {
              "$ref": "#/definitions/PermissionsModifyRulesScope",
              "description": "Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file."
            },
            "add": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/PermissionRule",
                "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
              },
              "description": "Rules to add to the scope. Applied before `remove`/`removeAll`."
            },
            "remove": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/PermissionRule",
                "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
              },
              "description": "Specific rules to remove from the scope. Ignored when `removeAll` is true."
            },
            "removeAll": {
              "type": "boolean",
              "description": "When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale."
            }
          },
          "required": [
            "sessionId",
            "scope"
          ],
          "additionalProperties": false,
          "description": "Scope and add/remove instructions for modifying session- or location-scoped permission rules.",
          "title": "PermissionsModifyRulesParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsModifyRulesResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "setRequired": {
        "rpcMethod": "session.permissions.setRequired",
        "description": "Sets whether the client wants permission prompts bridged into session events.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "required": {
              "type": "boolean",
              "description": "Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`)."
            }
          },
          "required": [
            "sessionId",
            "required"
          ],
          "additionalProperties": false,
          "description": "Toggles whether permission prompts should be bridged into session events for this client.",
          "title": "PermissionsSetRequiredRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsSetRequiredResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "resetSessionApprovals": {
        "rpcMethod": "session.permissions.resetSessionApprovals",
        "description": "Clears session-scoped tool permission approvals.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "includeLocation": {
              "type": "boolean",
              "description": "Whether location-scoped approvals are cleared too. Defaults to `true`."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Clears session-scoped tool permission approvals, and optionally the location-scoped ones.",
          "title": "PermissionsResetSessionApprovalsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsResetSessionApprovalsResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "notifyPromptShown": {
        "rpcMethod": "session.permissions.notifyPromptShown",
        "description": "Notifies the runtime that a permission prompt UI has been shown to the user.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "message": {
              "type": "string",
              "description": "Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification)."
            }
          },
          "required": [
            "sessionId",
            "message"
          ],
          "additionalProperties": false,
          "description": "Notification payload describing the permission prompt that the client just rendered.",
          "title": "PermissionPromptShownNotification",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/PermissionsNotifyPromptShownResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      },
      "paths": {
        "list": {
          "rpcMethod": "session.permissions.paths.list",
          "description": "Returns the session's allowed directories and primary working directory.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              }
            },
            "required": [
              "sessionId"
            ],
            "additionalProperties": false,
            "description": "No parameters; returns the session's allow-listed directories.",
            "title": "PermissionsPathsListRequest",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionPathsList",
            "description": "Snapshot of the session's allow-listed directories and primary working directory."
          },
          "stability": "experimental"
        },
        "add": {
          "rpcMethod": "session.permissions.paths.add",
          "description": "Adds a directory to the session's allow-list and activates conventional skill and agent definitions under it.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Directory to add to the allow-list. The runtime resolves and validates the path before adding, then loads conventional `.github/skills/` and `.github/agents/` definitions under it when their subsystem gates are enabled. Adding the directory is therefore also a trust decision for configuration stored there."
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Directory path to add to the session's allowed directories.",
            "title": "PermissionPathsAddParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionsPathsAddResult",
            "description": "Indicates whether the operation succeeded."
          },
          "stability": "experimental"
        },
        "updatePrimary": {
          "rpcMethod": "session.permissions.paths.updatePrimary",
          "description": "Updates the session's primary working directory used by the permission policy.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Directory to set as the new primary working directory for the session's permission policy."
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Directory path to set as the session's new primary working directory.",
            "title": "PermissionPathsUpdatePrimaryParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionsPathsUpdatePrimaryResult",
            "description": "Indicates whether the operation succeeded."
          },
          "stability": "experimental"
        },
        "isPathWithinAllowedDirectories": {
          "rpcMethod": "session.permissions.paths.isPathWithinAllowedDirectories",
          "description": "Reports whether a path falls within any of the session's allowed directories.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Path to check against the session's allowed directories"
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Path to evaluate against the session's allowed directories.",
            "title": "PermissionPathsAllowedCheckParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionPathsAllowedCheckResult",
            "description": "Indicates whether the supplied path is within the session's allowed directories."
          },
          "stability": "experimental"
        },
        "isPathWithinWorkspace": {
          "rpcMethod": "session.permissions.paths.isPathWithinWorkspace",
          "description": "Reports whether a path falls within the session's workspace (primary) directory.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Path to check against the session workspace directory"
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Path to evaluate against the session's workspace (primary) directory.",
            "title": "PermissionPathsWorkspaceCheckParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionPathsWorkspaceCheckResult",
            "description": "Indicates whether the supplied path is within the session's workspace directory."
          },
          "stability": "experimental"
        }
      },
      "locations": {
        "resolve": {
          "rpcMethod": "session.permissions.locations.resolve",
          "description": "Resolves the permission location key and type for a working directory.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "workingDirectory": {
                "type": "string",
                "description": "Working directory whose permission location should be resolved"
              }
            },
            "required": [
              "sessionId",
              "workingDirectory"
            ],
            "additionalProperties": false,
            "description": "Working directory to resolve into a location-permissions key.",
            "title": "PermissionLocationResolveParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionLocationResolveResult",
            "description": "Resolved location-permissions key and type."
          },
          "stability": "experimental"
        },
        "apply": {
          "rpcMethod": "session.permissions.locations.apply",
          "description": "Applies persisted location-scoped tool approvals and allowed directories for a working directory to this session's permission service.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "workingDirectory": {
                "type": "string",
                "description": "Working directory whose persisted location permissions should be applied"
              }
            },
            "required": [
              "sessionId",
              "workingDirectory"
            ],
            "additionalProperties": false,
            "description": "Working directory to load persisted location permissions for.",
            "title": "PermissionLocationApplyParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionLocationApplyResult",
            "description": "Summary of persisted location permissions applied to the session."
          },
          "stability": "experimental"
        },
        "addToolApproval": {
          "rpcMethod": "session.permissions.locations.addToolApproval",
          "description": "Persists a tool approval for a permission location and applies its rules to this session's live permission service.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "locationKey": {
                "type": "string",
                "description": "Location key (git root or cwd) to persist the approval to"
              },
              "approval": {
                "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetails",
                "description": "Tool approval to persist and apply"
              }
            },
            "required": [
              "sessionId",
              "locationKey",
              "approval"
            ],
            "additionalProperties": false,
            "description": "Location-scoped tool approval to persist.",
            "title": "PermissionLocationAddToolApprovalParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionsLocationsAddToolApprovalResult",
            "description": "Indicates whether the operation succeeded."
          },
          "stability": "experimental"
        }
      },
      "folderTrust": {
        "isTrusted": {
          "rpcMethod": "session.permissions.folderTrust.isTrusted",
          "description": "Reports whether a folder is trusted according to the user's folder trust state.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Folder path to check"
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Folder path to check for trust.",
            "title": "FolderTrustCheckParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/FolderTrustCheckResult",
            "description": "Folder trust check result."
          },
          "stability": "experimental"
        },
        "addTrusted": {
          "rpcMethod": "session.permissions.folderTrust.addTrusted",
          "description": "Adds a folder to the user's trusted folders list.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "path": {
                "type": "string",
                "description": "Folder path to mark as trusted"
              }
            },
            "required": [
              "sessionId",
              "path"
            ],
            "additionalProperties": false,
            "description": "Folder path to add to trusted folders.",
            "title": "FolderTrustAddParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionsFolderTrustAddTrustedResult",
            "description": "Indicates whether the operation succeeded."
          },
          "stability": "experimental"
        }
      },
      "urls": {
        "setUnrestrictedMode": {
          "rpcMethod": "session.permissions.urls.setUnrestrictedMode",
          "description": "Toggles the runtime's URL-permission policy between unrestricted and restricted modes.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "enabled": {
                "type": "boolean",
                "description": "Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place."
              }
            },
            "required": [
              "sessionId",
              "enabled"
            ],
            "additionalProperties": false,
            "description": "Whether the URL-permission policy should run in unrestricted mode.",
            "title": "PermissionUrlsSetUnrestrictedModeParams",
            "stability": "experimental"
          },
          "result": {
            "$ref": "#/definitions/PermissionsUrlsSetUnrestrictedModeResult",
            "description": "Indicates whether the operation succeeded."
          },
          "stability": "experimental"
        }
      }
    },
    "log": {
      "rpcMethod": "session.log",
      "description": "Emits a user-visible session log event.",
      "params": {
        "type": "object",
        "properties": {
          "sessionId": {
            "type": "string",
            "description": "Target session identifier"
          },
          "message": {
            "type": "string",
            "description": "Human-readable message"
          },
          "level": {
            "$ref": "#/definitions/SessionLogLevel",
            "description": "Log severity level. Determines how the message is displayed in the timeline. Defaults to \"info\"."
          },
          "type": {
            "type": "string",
            "description": "Domain category for this log entry (e.g., \"mcp\", \"subscription\", \"policy\", \"model\"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to \"notification\"."
          },
          "ephemeral": {
            "type": "boolean",
            "description": "When true, the message is transient and not persisted to the session event log on disk"
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Optional URL the user can open in their browser for more details"
          },
          "tip": {
            "type": "string",
            "description": "Optional actionable tip displayed alongside the message. Only honored on `level: \"info\"`."
          }
        },
        "required": [
          "sessionId",
          "message"
        ],
        "additionalProperties": false,
        "description": "Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip.",
        "title": "LogRequest",
        "stability": "experimental"
      },
      "result": {
        "$ref": "#/definitions/LogResult",
        "description": "Identifier of the session event that was emitted for the log message."
      },
      "stability": "experimental"
    },
    "metadata": {
      "snapshot": {
        "rpcMethod": "session.metadata.snapshot",
        "description": "Returns a snapshot of the session's identifying metadata, mode, agent, and remote info.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionMetadataSnapshot",
          "description": "Point-in-time snapshot of slow-changing session identifier and state fields"
        },
        "stability": "experimental"
      },
      "isProcessing": {
        "rpcMethod": "session.metadata.isProcessing",
        "description": "Reports whether the local session is currently processing user/agent messages.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/MetadataIsProcessingResult",
          "description": "Indicates whether the local session is currently processing a turn or background continuation."
        },
        "stability": "experimental"
      },
      "activity": {
        "rpcMethod": "session.metadata.activity",
        "description": "Returns a snapshot of activity flags for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionActivity",
          "description": "Current activity flags for the session."
        },
        "stability": "experimental"
      },
      "contextInfo": {
        "rpcMethod": "session.metadata.contextInfo",
        "description": "Returns the token breakdown for the session's current context window for a given model.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "promptTokenLimit": {
              "type": "integer",
              "minimum": 0,
              "description": "Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default."
            },
            "outputTokenLimit": {
              "type": "integer",
              "minimum": 0,
              "description": "Maximum output tokens allowed by the target model. Pass 0 if unknown."
            },
            "selectedModel": {
              "type": "string",
              "description": "Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values."
            }
          },
          "required": [
            "sessionId",
            "promptTokenLimit",
            "outputTokenLimit"
          ],
          "additionalProperties": false,
          "description": "Model identifier and token limits used to compute the context-info breakdown.",
          "title": "MetadataContextInfoRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/MetadataContextInfoResult",
          "description": "Token breakdown for the session's current context window, or null if uninitialized."
        },
        "stability": "experimental"
      },
      "getContextAttribution": {
        "rpcMethod": "session.metadata.getContextAttribution",
        "description": "Returns the experimental per-source attribution breakdown of the session's current context window as a flat list of entries (skills, subagents, MCP servers, built-in tools, plugin rollups, system/tool-definition costs, with nesting via parentId), plus the successful compaction count. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`. Returns null until the session has initialized its system prompt and tool metadata.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/MetadataContextAttributionResult",
          "description": "Per-source attribution breakdown for the session's current context window, or null if uninitialized."
        },
        "stability": "experimental"
      },
      "getContextHeaviestMessages": {
        "rpcMethod": "session.metadata.getContextHeaviestMessages",
        "description": "Returns the largest individual messages currently in the session's context window, most-expensive first. Companion to `metadata.getContextAttribution`. Returns an empty list until the session has initialized.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "description": "Maximum number of messages to return, most-expensive first. Omit for the server default."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Parameters for the heaviest-messages query.",
          "title": "MetadataContextHeaviestMessagesRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/MetadataContextHeaviestMessagesResult",
          "description": "The heaviest individual messages in the session's context window, most-expensive first."
        },
        "stability": "experimental"
      },
      "recordContextChange": {
        "rpcMethod": "session.metadata.recordContextChange",
        "description": "Records a working-directory/git context change and emits a `session.context_changed` event. For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event): a local session's working directory is authoritative and is moved via `metadata.setWorkingDirectory` (or an SDK `session.resume` that supplies a `workingDirectory`), not by this method.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "context": {
              "$ref": "#/definitions/SessionWorkingDirectoryContext",
              "description": "Updated working directory and git context. Emitted as the new payload of `session.context_changed`."
            }
          },
          "required": [
            "sessionId",
            "context"
          ],
          "additionalProperties": false,
          "description": "Updated working-directory/git context to record on the session.",
          "title": "MetadataRecordContextChangeRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/MetadataRecordContextChangeResult",
          "description": "Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead."
        },
        "stability": "experimental"
      },
      "setWorkingDirectory": {
        "rpcMethod": "session.metadata.setWorkingDirectory",
        "description": "Updates the session's working directory. For local sessions the target is validated first (an absolute path that exists on disk) and the permission primary directory is re-based; a rejected validation fails the call before any session state changes.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "workingDirectory": {
              "type": "string",
              "description": "Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it."
            }
          },
          "required": [
            "sessionId",
            "workingDirectory"
          ],
          "additionalProperties": false,
          "description": "Absolute path to set as the session's new working directory. For local sessions the path must be absolute and exist on disk: it is validated before any session state changes, and a failing validation rejects the call with nothing mutated, persisted, or emitted. Remote sessions record the path as-is.",
          "title": "MetadataSetWorkingDirectoryRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/MetadataSetWorkingDirectoryResult",
          "description": "Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path."
        },
        "stability": "experimental"
      },
      "recomputeContextTokens": {
        "rpcMethod": "session.metadata.recomputeContextTokens",
        "description": "Re-tokenizes the session's existing messages against a model and returns aggregate token totals.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "modelId": {
              "type": "string",
              "description": "Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model."
            }
          },
          "required": [
            "sessionId",
            "modelId"
          ],
          "additionalProperties": false,
          "description": "Model identifier to use when re-tokenizing the session's existing messages.",
          "title": "MetadataRecomputeContextTokensRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/MetadataRecomputeContextTokensResult",
          "description": "Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session."
        },
        "stability": "experimental"
      }
    },
    "settings": {
      "snapshot": {
        "rpcMethod": "session.settings.snapshot",
        "description": "Returns a redacted snapshot of session runtime settings, with secrets and raw feature flags excluded. Internal: the runtime settings shape is a runtime-internal surface and is deliberately kept out of the public SDK, because consumers should not depend on the runtime's internal settings layout. It remains callable in-process and is expected to be reworked as the runtime internals are consolidated.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionSettingsSnapshot",
          "description": "Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "evaluatePredicate": {
        "rpcMethod": "session.settings.evaluatePredicate",
        "description": "Evaluates a named Rust-owned settings predicate without exposing raw feature flags. Internal: the raw feature-flag names and composition are runtime-internal, so this predicate-evaluation helper is kept out of the public SDK surface and is callable in-process only.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "$ref": "#/definitions/SessionSettingsPredicateName",
              "description": "Predicate name. The runtime owns the raw feature-flag names and composition logic."
            },
            "toolName": {
              "type": "string",
              "description": "Tool name for tool-scoped predicates such as trivial-change handling."
            }
          },
          "required": [
            "sessionId",
            "name"
          ],
          "additionalProperties": false,
          "description": "Named Rust-owned settings predicate to evaluate for this session.",
          "title": "SessionSettingsEvaluatePredicateRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionSettingsEvaluatePredicateResult",
          "description": "Result of evaluating a Rust-owned settings predicate."
        },
        "stability": "experimental",
        "visibility": "internal"
      }
    },
    "contentExclusion": {
      "checkPaths": {
        "rpcMethod": "session.contentExclusion.checkPaths",
        "description": "Checks local file system absolute paths within the session working directory against its content-exclusion policy. Results preserve input order. Unsupported paths/filesystems and unavailable policy evaluation return available false, and callers must treat every requested path as excluded.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "paths": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates."
            }
          },
          "required": [
            "sessionId",
            "paths"
          ],
          "additionalProperties": false,
          "description": "Local file system absolute paths within the session working directory to check against its content-exclusion policy.",
          "title": "ContentExclusionCheckPathsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ContentExclusionCheckPathsResult",
          "description": "Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable."
        },
        "stability": "experimental"
      }
    },
    "shell": {
      "exec": {
        "rpcMethod": "session.shell.exec",
        "description": "Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via \"shell.kill\", the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via \"setsid\") leaves the signalled group, so either can leave a background process running.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "command": {
              "type": "string",
              "description": "Shell command to execute"
            },
            "cwd": {
              "type": "string",
              "description": "Working directory (defaults to session working directory)"
            },
            "timeout": {
              "type": "integer",
              "minimum": 0,
              "format": "duration",
              "description": "Timeout in milliseconds (default: 30000)"
            }
          },
          "required": [
            "sessionId",
            "command"
          ],
          "additionalProperties": false,
          "description": "Shell command to run, with optional working directory and timeout in milliseconds.",
          "title": "ShellExecRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ShellExecResult",
          "description": "Identifier of the spawned process, used to correlate streamed output and exit notifications."
        },
        "stability": "experimental"
      },
      "kill": {
        "rpcMethod": "session.shell.kill",
        "description": "Sends a signal to a shell process previously started via \"shell.exec\". The signal targets the command's whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via \"setsid\") is no longer in the signalled group and survives.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "processId": {
              "type": "string",
              "description": "Process identifier returned by shell.exec"
            },
            "signal": {
              "$ref": "#/definitions/ShellKillSignal",
              "description": "Signal to send (default: SIGTERM)"
            }
          },
          "required": [
            "sessionId",
            "processId"
          ],
          "additionalProperties": false,
          "description": "Identifier of a process previously returned by \"shell.exec\" and the signal to send.",
          "title": "ShellKillRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ShellKillResult",
          "description": "Indicates whether the signal was delivered; false if the process was unknown or already exited."
        },
        "stability": "experimental"
      },
      "executeUserRequested": {
        "rpcMethod": "session.shell.executeUserRequested",
        "description": "Executes a user-requested shell command through the session runtime.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Caller-provided cancellation handle for this execution"
            },
            "command": {
              "type": "string",
              "description": "Shell command to execute"
            }
          },
          "required": [
            "sessionId",
            "requestId",
            "command"
          ],
          "additionalProperties": false,
          "description": "User-requested shell command and cancellation handle.",
          "title": "ShellExecuteUserRequestedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/UserRequestedShellCommandResult",
          "description": "Result of a user-requested shell command."
        },
        "stability": "experimental"
      },
      "cancelUserRequested": {
        "rpcMethod": "session.shell.cancelUserRequested",
        "description": "Cancels a user-requested shell command by request ID.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "requestId": {
              "type": "string",
              "description": "Request ID previously passed to executeUserRequested"
            }
          },
          "required": [
            "sessionId",
            "requestId"
          ],
          "additionalProperties": false,
          "description": "User-requested shell execution cancellation handle.",
          "title": "ShellCancelUserRequestedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CancelUserRequestedShellCommandResult",
          "description": "Cancellation result for a user-requested shell command."
        },
        "stability": "experimental"
      }
    },
    "history": {
      "compact": {
        "rpcMethod": "session.history.compact",
        "description": "Compacts the session history to reduce context usage.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "customInstructions": {
                  "type": "string",
                  "maxLength": 4000,
                  "description": "Optional user-provided instructions to focus the compaction summary"
                },
                "trigger": {
                  "type": "string",
                  "enum": [
                    "manual",
                    "model_switch"
                  ],
                  "description": "What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown).",
                  "x-enumDescriptions": {
                    "manual": "User-requested compaction, e.g. the /compact command or a direct history.compact call.",
                    "model_switch": "Compaction requested while switching to a model with a smaller context window."
                  }
                },
                "tokenLimit": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Optional compaction parameters.",
          "title": "HistoryCompactRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HistoryCompactResult",
          "description": "Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown."
        },
        "stability": "experimental"
      },
      "truncate": {
        "rpcMethod": "session.history.truncate",
        "description": "Truncates persisted session history to a specific event.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "eventId": {
              "type": "string",
              "description": "Event ID to truncate to. This event and all events after it are removed from the session."
            }
          },
          "required": [
            "sessionId",
            "eventId"
          ],
          "additionalProperties": false,
          "description": "Identifier of the event to truncate to; this event and all later events are removed.",
          "title": "HistoryTruncateRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HistoryTruncateResult",
          "description": "Number of events that were removed by the truncation."
        },
        "stability": "experimental"
      },
      "listRewindPoints": {
        "rpcMethod": "session.history.listRewindPoints",
        "description": "Lists the user turns that the session can rewind to. Never rejects for a busy session: rewind reads need the session's file-change captures to be settled, so a session that still holds active work answers with `unavailableReason: \"session-busy\"` and no points, which the caller can retry.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/HistoryListRewindPointsResult",
          "description": "Rewind points and file-change-tracking availability for the session."
        },
        "stability": "experimental"
      },
      "previewRewind": {
        "rpcMethod": "session.history.previewRewind",
        "description": "Previews the files that a conversation-and-files rewind would restore.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "eventId": {
              "type": "string",
              "description": "ID of the user.message event that begins the discarded suffix."
            }
          },
          "required": [
            "sessionId",
            "eventId"
          ],
          "additionalProperties": false,
          "description": "Event boundary to preview for conversation-and-files rewind.",
          "title": "HistoryPreviewRewindRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HistoryPreviewRewindResult",
          "description": "Files and aggregate changes for a prospective rewind."
        },
        "stability": "experimental"
      },
      "rewind": {
        "rpcMethod": "session.history.rewind",
        "description": "Rewinds the session conversation, optionally restoring files changed by the discarded turns. Not crash-atomic: file restore and conversation truncation are separate stores, applied in that order, so a process crash between them can leave the workspace rewound while the conversation still contains the discarded turns. There is no recovery journal; re-running the same rewind is the recovery path for a crash before truncation lands, since file restore is idempotent (already-restored files are reported as skipped) and truncation is re-derived from the still-retained boundary event. After truncation lands that boundary no longer exists, so the same request is rejected; the only stage that can still be outstanding is snapshot pruning, whose failure leaves orphan snapshots the capture store tolerates. The reverse inconsistency cannot occur, because truncation is never applied before file restore succeeds.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "eventId": {
              "type": "string",
              "description": "ID of the user.message event that begins the discarded suffix."
            },
            "mode": {
              "$ref": "#/definitions/HistoryRewindMode",
              "description": "Whether to rewind only conversation history or also restore captured files."
            }
          },
          "required": [
            "sessionId",
            "eventId",
            "mode"
          ],
          "additionalProperties": false,
          "description": "Boundary and mode for rewinding session history.",
          "title": "HistoryRewindRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HistoryRewindResult",
          "description": "Structured outcome of a rewind request."
        },
        "stability": "experimental"
      },
      "cancelBackgroundCompaction": {
        "rpcMethod": "session.history.cancelBackgroundCompaction",
        "description": "Cancels any in-progress background compaction on a local session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/HistoryCancelBackgroundCompactionResult",
          "description": "Indicates whether an in-progress background compaction was cancelled."
        },
        "stability": "experimental"
      },
      "abortManualCompaction": {
        "rpcMethod": "session.history.abortManualCompaction",
        "description": "Aborts any in-progress manual compaction on a local session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/HistoryAbortManualCompactionResult",
          "description": "Indicates whether an in-progress manual compaction was aborted."
        },
        "stability": "experimental"
      },
      "summarizeForHandoff": {
        "rpcMethod": "session.history.summarizeForHandoff",
        "description": "Produces a markdown summary of the session's conversation context for hand-off scenarios.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/HistorySummarizeForHandoffResult",
          "description": "Markdown summary of the conversation context (empty when not available)."
        },
        "stability": "experimental"
      },
      "clearContext": {
        "rpcMethod": "session.history.clearContext",
        "description": "Clears the session's conversation history, keeping only system and developer messages, and seeds the fresh context window with a first user message. Must be called from inside a tool handler: the clear has to drop the results of the tool calls its wipe orphans, and it rejects when no tool call is in flight.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "prompt": {
              "type": "string",
              "description": "First user message of the fresh context window. Required: a cleared window holding only system and developer messages is not a conversation a model can answer, so every clear seeds the window it creates. Delivered by the enclosing turn driver once the agentic loop exits, which is why the call must be made from inside a tool handler."
            }
          },
          "required": [
            "sessionId",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Parameters for clearing the conversation and seeding the window that replaces it.",
          "title": "HistoryClearContextRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/HistoryClearContextResult",
          "description": "What a successful clear removed. A clear that could not be applied rejects instead of reporting a count."
        },
        "stability": "experimental"
      }
    },
    "queue": {
      "pendingItems": {
        "rpcMethod": "session.queue.pendingItems",
        "description": "Returns the local session's pending user-facing queued items and steering messages.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/QueuePendingItemsResult",
          "description": "Snapshot of the session's pending queued items and immediate-steering messages."
        },
        "stability": "experimental"
      },
      "snapshot": {
        "rpcMethod": "session.queue.snapshot",
        "description": "Returns the internal native queue snapshot for in-process session orchestration.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/QueueSnapshotResult",
          "description": "Internal snapshot of native queue state for local session orchestration."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "moveItem": {
        "rpcMethod": "session.queue.moveItem",
        "description": "Moves an addressable queued item to a public visible position.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable opaque queued-item id."
            },
            "toPosition": {
              "type": "integer",
              "description": "Zero-based target position in the public visible queue. Values outside the queue clamp to an end."
            }
          },
          "required": [
            "sessionId",
            "id",
            "toPosition"
          ],
          "additionalProperties": false,
          "description": "Parameters for moving a queued item by stable id.",
          "title": "QueueMoveItemRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueMoveItemResult",
          "description": "Result of moving a queued item."
        },
        "stability": "experimental"
      },
      "insertAt": {
        "rpcMethod": "session.queue.insertAt",
        "description": "Inserts a new queued message at a public visible position.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "position": {
              "type": "integer",
              "description": "Zero-based position in the public visible queue. Values outside the queue clamp to an end."
            },
            "message": {
              "$ref": "#/definitions/QueueInsertMessage",
              "description": "Queued message contents and delivery metadata."
            }
          },
          "required": [
            "sessionId",
            "position",
            "message"
          ],
          "additionalProperties": false,
          "description": "Parameters for inserting a queued message at a public visible position.",
          "title": "QueueInsertAtRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueInsertAtResult",
          "description": "Result of inserting a queued message."
        },
        "stability": "experimental"
      },
      "removeAt": {
        "rpcMethod": "session.queue.removeAt",
        "description": "Removes an addressable queued item by its stable id.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable opaque ID of the queued item to remove."
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Parameters for removing a queued item by stable id.",
          "title": "QueueRemoveAtRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueRemoveAtResult",
          "description": "Result of removing a queued item."
        },
        "stability": "experimental"
      },
      "updateText": {
        "rpcMethod": "session.queue.updateText",
        "description": "Updates the text of an addressable single-message queue item.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable opaque ID of the queued item to edit."
            },
            "prompt": {
              "type": "string",
              "description": "Replacement prompt sent to the model."
            },
            "displayPrompt": {
              "type": "string",
              "description": "Optional replacement prompt displayed to the user."
            }
          },
          "required": [
            "sessionId",
            "id",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Parameters for editing a single queued message.",
          "title": "QueueUpdateTextRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueUpdateTextResult",
          "description": "Result of editing a queued message."
        },
        "stability": "experimental"
      },
      "duplicateAt": {
        "rpcMethod": "session.queue.duplicateAt",
        "description": "Duplicates an addressable queued item immediately after its source.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable opaque ID of the queued item to duplicate."
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Parameters for duplicating a queued item.",
          "title": "QueueDuplicateAtRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueDuplicateAtResult",
          "description": "Result of duplicating a queued item."
        },
        "stability": "experimental"
      },
      "setDrainPaused": {
        "rpcMethod": "session.queue.setDrainPaused",
        "description": "Acquires or releases the queued-lane drain pause.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "paused": {
              "type": "boolean",
              "description": "Whether queued-lane draining should be paused."
            }
          },
          "required": [
            "sessionId",
            "paused"
          ],
          "additionalProperties": false,
          "description": "Parameters for acquiring or releasing the queued-lane drain pause. Acquisition is exclusive and non-idempotent: `paused: true` against an already-paused session fails with `queue_already_paused`. The pause is never released automatically — it is not tied to the caller's lifetime, so a client that exits without sending `paused: false` leaves the lane frozen. Release is unowned: `paused: false` clears the pause for any caller, including one that never acquired it.",
          "title": "QueueSetDrainPausedRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "sendNow": {
        "rpcMethod": "session.queue.sendNow",
        "description": "Moves an addressable queued message into the live turn's steering lane.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "string",
              "description": "Stable opaque ID of the queued item to steer into the live turn."
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Parameters for steering a queued message into a live turn.",
          "title": "QueueSendNowRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueSendNowResult",
          "description": "Result of trying to steer a queued message into a live turn."
        },
        "stability": "experimental"
      },
      "hasPending": {
        "rpcMethod": "session.queue.hasPending",
        "description": "Reports whether the local session has native queued work pending.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/QueueHasPendingResult",
          "description": "Whether the native queue has pending work."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "beginDeferredIdleDrain": {
        "rpcMethod": "session.queue.beginDeferredIdleDrain",
        "description": "Begins a native deferred-idle drain when background work has quiesced.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "activeBackgroundWork": {
              "type": "boolean",
              "description": "Whether the host still has active background work."
            }
          },
          "required": [
            "sessionId",
            "activeBackgroundWork"
          ],
          "additionalProperties": false,
          "description": "Inputs for starting a deferred-idle drain.",
          "title": "QueueBeginDeferredIdleDrainRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueBeginDeferredIdleDrainResult",
          "description": "Whether a deferred-idle drain should run."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "finishDeferredIdleDrain": {
        "rpcMethod": "session.queue.finishDeferredIdleDrain",
        "description": "Finishes a native deferred-idle drain and reports whether to drain queue work or emit idle.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "activeBackgroundWork": {
              "type": "boolean",
              "description": "Whether the host still has active background work."
            },
            "hasPending": {
              "type": "boolean",
              "description": "Whether native queued work remains."
            }
          },
          "required": [
            "sessionId",
            "activeBackgroundWork",
            "hasPending"
          ],
          "additionalProperties": false,
          "description": "Inputs for completing a deferred-idle drain.",
          "title": "QueueFinishDeferredIdleDrainRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueFinishDeferredIdleDrainResult",
          "description": "Action selected by the native deferred-idle drain."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "deferSessionIdle": {
        "rpcMethod": "session.queue.deferSessionIdle",
        "description": "Marks session.idle as deferred by native background work state.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "aborted": {
              "type": "boolean",
              "description": "Whether the deferred idle was caused by an aborted foreground turn."
            }
          },
          "required": [
            "sessionId",
            "aborted"
          ],
          "additionalProperties": false,
          "description": "Inputs for marking session.idle deferred in native state.",
          "title": "QueueDeferSessionIdleRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "removeMostRecent": {
        "rpcMethod": "session.queue.removeMostRecent",
        "description": "Removes the most recently queued user-facing item (LIFO).",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/QueueRemoveMostRecentResult",
          "description": "Indicates whether a user-facing pending item was removed."
        },
        "stability": "experimental"
      },
      "clear": {
        "rpcMethod": "session.queue.clear",
        "description": "Clears all pending queued items on the local session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "consumeSystemNotifications": {
        "rpcMethod": "session.queue.consumeSystemNotifications",
        "description": "Consumes queued native system notifications matching an internal filter.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "filter": {
              "description": "Opaque runtime-owned filter object.",
              "x-opaque-json": true
            }
          },
          "required": [
            "sessionId",
            "filter"
          ],
          "additionalProperties": false,
          "description": "Internal filter for consuming queued system notifications.",
          "title": "QueueConsumeSystemNotificationsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/QueueRemoveMostRecentResult",
          "description": "Indicates whether a user-facing pending item was removed."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "enqueueResumePending": {
        "rpcMethod": "session.queue.enqueueResumePending",
        "description": "Enqueues the internal resume-pending wake item when orphan handling needs a follow-up turn.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/QueueEnqueueResumePendingResult",
          "description": "Result of enqueueing the resume-pending wake item."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "process": {
        "rpcMethod": "session.queue.process",
        "description": "Drains the native local-session work queue for in-process session orchestration.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      }
    },
    "eventLog": {
      "read": {
        "rpcMethod": "session.eventLog.read",
        "description": "Reads a batch of session events from a cursor, optionally waiting for new events. Supports tail-first reads via `direction: backward`.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "cursor": {
              "type": "string",
              "description": "Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history."
            },
            "max": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 1000,
              "description": "Maximum number of events to return in this batch (1–1000, default 200)."
            },
            "waitMs": {
              "type": "integer",
              "minimum": 0,
              "maximum": 30000,
              "format": "duration",
              "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur."
            },
            "types": {
              "$ref": "#/definitions/EventLogTypes",
              "description": "Either '*' to receive all event types, or a non-empty list of event types to receive"
            },
            "agentScope": {
              "$ref": "#/definitions/EventsAgentScope",
              "description": "Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers."
            },
            "agentIds": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1,
              "description": "Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope."
            },
            "direction": {
              "$ref": "#/definitions/EventsReadDirection",
              "description": "Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion."
            },
            "includeEphemeral": {
              "type": "boolean",
              "description": "When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Cursor, batch size, and optional long-poll/filter parameters for reading session events.",
          "title": "EventLogReadRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/EventsReadResult",
          "description": "Batch of session events returned by a read, with cursor and continuation metadata."
        },
        "stability": "experimental"
      },
      "tail": {
        "rpcMethod": "session.eventLog.tail",
        "description": "Returns a snapshot of the current tail cursor without consuming events.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/EventLogTailResult",
          "description": "Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session)."
        },
        "stability": "experimental"
      },
      "registerInterest": {
        "rpcMethod": "session.eventLog.registerInterest",
        "description": "Registers consumer interest in an event type for runtime gating purposes.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "eventType": {
              "type": "string",
              "description": "The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`."
            }
          },
          "required": [
            "sessionId",
            "eventType"
          ],
          "additionalProperties": false,
          "description": "Event type to register consumer interest for, used by runtime gating logic.",
          "title": "RegisterEventInterestParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/RegisterEventInterestResult",
          "description": "Opaque handle representing an event-type interest registration."
        },
        "stability": "experimental"
      },
      "releaseInterest": {
        "rpcMethod": "session.eventLog.releaseInterest",
        "description": "Releases a consumer's previously-registered interest in an event type.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "handle": {
              "type": "string",
              "description": "Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type."
            }
          },
          "required": [
            "sessionId",
            "handle"
          ],
          "additionalProperties": false,
          "description": "Opaque handle previously returned by `registerInterest` to release.",
          "title": "ReleaseEventInterestParams",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/EventLogReleaseInterestResult",
          "description": "Indicates whether the operation succeeded."
        },
        "stability": "experimental"
      }
    },
    "usage": {
      "getMetrics": {
        "rpcMethod": "session.usage.getMetrics",
        "description": "Gets accumulated usage metrics for the session.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/UsageGetMetricsResult",
          "description": "Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals."
        },
        "stability": "experimental"
      }
    },
    "limitPrediction": {
      "predict": {
        "rpcMethod": "session.limitPrediction.predict",
        "description": "Predicts an AI-credit session limit for the session's resolved model. Returns an unavailable result instead of falling back when the current model is unresolved auto.",
        "params": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "type": "object",
              "properties": {
                "sessionId": {
                  "type": "string",
                  "description": "Target session identifier"
                },
                "modelId": {
                  "type": "string",
                  "description": "Optional model identifier override. If omitted, the session's current model is used."
                },
                "clientType": {
                  "$ref": "#/definitions/SessionLimitPredictionClientType",
                  "description": "Client type to size for. Defaults to `cli-interactive`."
                }
              },
              "required": [
                "sessionId"
              ],
              "additionalProperties": false
            }
          ],
          "description": "Parameters for predicting an AI-credit session limit. Omitting `modelId` uses the session's currently selected model.",
          "title": "SessionLimitPredictionRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionLimitPredictionResult",
          "description": "Prediction result. Available results include prediction details; unavailable results include an explicit reason."
        },
        "stability": "experimental"
      }
    },
    "remote": {
      "enable": {
        "rpcMethod": "session.remote.enable",
        "description": "Enables remote session export or steering.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "mode": {
              "$ref": "#/definitions/RemoteSessionMode",
              "description": "Per-session remote mode. \"off\" disables remote, \"export\" exports session events to GitHub without enabling remote steering, \"on\" enables both export and remote steering."
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Optional remote session mode (\"off\", \"export\", or \"on\"); defaults to enabling both export and remote steering.",
          "title": "RemoteEnableRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/RemoteEnableResult",
          "description": "GitHub URL for the session and a flag indicating whether remote steering is enabled."
        },
        "stability": "experimental"
      },
      "disable": {
        "rpcMethod": "session.remote.disable",
        "description": "Disables remote session export and steering.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "notifySteerableChanged": {
        "rpcMethod": "session.remote.notifySteerableChanged",
        "description": "Persists a remote-steerability change emitted by the host as a session event.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "remoteSteerable": {
              "type": "boolean",
              "description": "Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability."
            }
          },
          "required": [
            "sessionId",
            "remoteSteerable"
          ],
          "additionalProperties": false,
          "description": "New remote-steerability state to persist as a `session.remote_steerable_changed` event.",
          "title": "RemoteNotifySteerableChangedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/RemoteNotifySteerableChangedResult",
          "description": "Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own."
        },
        "stability": "experimental"
      }
    },
    "visibility": {
      "get": {
        "rpcMethod": "session.visibility.get",
        "description": "Returns the session's current Mission Control sharing status and shareable GitHub URL. Reflects whether the synced session is visible to repository readers (\"repo\") or restricted to its creator and collaborators (\"unshared\").",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/VisibilityGetResult",
          "description": "Current sharing status and shareable GitHub URL for a session."
        },
        "stability": "experimental"
      },
      "set": {
        "rpcMethod": "session.visibility.set",
        "description": "Sets the session's Mission Control sharing status, controlling whether the synced session is visible to repository readers. Returns the effective status and shareable GitHub URL after the change.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "status": {
              "$ref": "#/definitions/SessionVisibilityStatus",
              "description": "Sharing status to apply. \"repo\" makes the session visible to repository readers; \"unshared\" restricts it to the creator and collaborators."
            }
          },
          "required": [
            "sessionId",
            "status"
          ],
          "additionalProperties": false,
          "description": "Desired sharing status for the session.",
          "title": "VisibilitySetRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/VisibilitySetResult",
          "description": "Effective sharing status and shareable GitHub URL after updating session visibility."
        },
        "stability": "experimental"
      }
    },
    "schedule": {
      "list": {
        "rpcMethod": "session.schedule.list",
        "description": "Lists the session's currently active scheduled prompts.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/ScheduleList",
          "description": "Snapshot of the currently active recurring prompts for this session."
        },
        "stability": "experimental"
      },
      "hydrate": {
        "rpcMethod": "session.schedule.hydrate",
        "description": "Hydrates the native schedule registry from persisted session events.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "hasSelfPaced": {
        "rpcMethod": "session.schedule.hasSelfPaced",
        "description": "Reports whether the session has an active self-paced scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/ScheduleHasSelfPacedResult",
          "description": "Whether the session currently has an active self-paced schedule."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "add": {
        "rpcMethod": "session.schedule.add",
        "description": "Registers a relative-interval scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "interval": {
              "type": "string",
              "description": "Human-readable interval such as `30s`, `5m`, or `2h`."
            },
            "prompt": {
              "type": "string",
              "description": "Prompt text to enqueue when the schedule fires."
            },
            "recurring": {
              "type": "boolean",
              "description": "Whether the schedule should re-arm after each tick. Defaults to true."
            },
            "displayPrompt": {
              "type": "string",
              "description": "Optional display-only prompt label."
            }
          },
          "required": [
            "sessionId",
            "interval",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Register a relative-interval scheduled prompt.",
          "title": "ScheduleAddRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleAddResult",
          "description": "Result of registering or re-arming a scheduled prompt."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "addCron": {
        "rpcMethod": "session.schedule.addCron",
        "description": "Registers a recurring cron scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "cron": {
              "type": "string",
              "description": "5-field cron expression."
            },
            "prompt": {
              "type": "string",
              "description": "Prompt text to enqueue when the schedule fires."
            },
            "recurring": {
              "type": "boolean",
              "description": "Whether the schedule should re-arm after each tick. Defaults to true."
            },
            "displayPrompt": {
              "type": "string",
              "description": "Optional display-only prompt label."
            },
            "tz": {
              "type": "string",
              "description": "IANA timezone for evaluating the cron expression."
            }
          },
          "required": [
            "sessionId",
            "cron",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Register a cron scheduled prompt.",
          "title": "ScheduleAddCronRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleAddResult",
          "description": "Result of registering or re-arming a scheduled prompt."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "addAt": {
        "rpcMethod": "session.schedule.addAt",
        "description": "Registers an absolute-time scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "at": {
              "type": "integer",
              "description": "Epoch milliseconds when the prompt should fire."
            },
            "prompt": {
              "type": "string",
              "description": "Prompt text to enqueue when the schedule fires."
            },
            "recurring": {
              "type": "boolean",
              "description": "Whether the schedule should re-arm after each tick. Defaults to false."
            },
            "displayPrompt": {
              "type": "string",
              "description": "Optional display-only prompt label."
            }
          },
          "required": [
            "sessionId",
            "at",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Register an absolute-time scheduled prompt.",
          "title": "ScheduleAddAtRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleAddResult",
          "description": "Result of registering or re-arming a scheduled prompt."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "addSelfPaced": {
        "rpcMethod": "session.schedule.addSelfPaced",
        "description": "Registers a self-paced scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "prompt": {
              "type": "string",
              "description": "Prompt text to enqueue when the schedule fires."
            },
            "displayPrompt": {
              "type": "string",
              "description": "Optional display-only prompt label."
            }
          },
          "required": [
            "sessionId",
            "prompt"
          ],
          "additionalProperties": false,
          "description": "Register a self-paced scheduled prompt.",
          "title": "ScheduleAddSelfPacedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleAddResult",
          "description": "Result of registering or re-arming a scheduled prompt."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "rearmSelfPaced": {
        "rpcMethod": "session.schedule.rearmSelfPaced",
        "description": "Re-arms an active self-paced scheduled prompt.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Id of the self-paced scheduled prompt."
            },
            "at": {
              "type": "integer",
              "description": "Epoch milliseconds when the prompt should next fire."
            }
          },
          "required": [
            "sessionId",
            "id",
            "at"
          ],
          "additionalProperties": false,
          "description": "Re-arm a self-paced scheduled prompt.",
          "title": "ScheduleRearmSelfPacedRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleAddResult",
          "description": "Result of registering or re-arming a scheduled prompt."
        },
        "stability": "experimental",
        "visibility": "internal"
      },
      "stop": {
        "rpcMethod": "session.schedule.stop",
        "description": "Removes a scheduled prompt by id.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "id": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "description": "Id of the scheduled prompt to remove."
            }
          },
          "required": [
            "sessionId",
            "id"
          ],
          "additionalProperties": false,
          "description": "Identifier of the scheduled prompt to remove.",
          "title": "ScheduleStopRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ScheduleStopResult",
          "description": "Remove a scheduled prompt by id. The result entry is omitted if the id was unknown."
        },
        "stability": "experimental"
      }
    }
  },
  "clientSession": {
    "providerToken": {
      "getToken": {
        "rpcMethod": "providerToken.getToken",
        "description": "Asks the SDK client to get a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Session-scoped: the runtime calls it back on the connection that most recently supplied that provider's config for the session (the creating connection, or a resuming connection if the session was resumed — distinct providers may be owned by different connections), passing the provider name, and uses the returned token as the Authorization header for the outbound model request. The runtime does no caching — it calls this once per outbound request; the SDK consumer owns token acquisition, caching, and refresh.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "providerName": {
              "type": "string",
              "description": "Name of the BYOK provider needing a token. For the legacy whole-session provider this is the implicit provider name; for named providers it is the configured provider name."
            }
          },
          "required": [
            "sessionId",
            "providerName"
          ],
          "additionalProperties": false,
          "description": "Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request.",
          "title": "ProviderTokenAcquireRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/ProviderTokenAcquireResult",
          "description": "A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh."
        },
        "stability": "experimental"
      }
    },
    "factory": {
      "execute": {
        "rpcMethod": "factory.execute",
        "description": "Asks the owning extension connection to execute a registered factory closure.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "name": {
              "type": "string",
              "description": "Registered factory name."
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "executionToken": {
              "type": "string",
              "description": "Opaque token identifying this factory execution attempt."
            },
            "args": {
              "description": "Factory input value.",
              "x-opaque-json": true
            }
          },
          "required": [
            "sessionId",
            "name",
            "runId",
            "executionToken",
            "args"
          ],
          "additionalProperties": false,
          "description": "Parameters sent to the owning extension to execute a factory closure.",
          "title": "FactoryExecuteRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryExecuteResult",
          "description": "Result returned by an extension factory closure."
        },
        "stability": "experimental"
      },
      "abort": {
        "rpcMethod": "factory.abort",
        "description": "Asks the owning extension connection to abort a running factory cooperatively.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            }
          },
          "required": [
            "sessionId",
            "runId"
          ],
          "additionalProperties": false,
          "description": "Parameters for cooperatively aborting a factory body.",
          "title": "FactoryAbortRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/FactoryAckResult",
          "description": "Acknowledgement that a factory request was accepted."
        },
        "stability": "experimental"
      }
    },
    "sessionFs": {
      "readFile": {
        "rpcMethod": "sessionFs.readFile",
        "description": "Reads a file from the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Path of the file to read from the client-provided session filesystem.",
          "title": "SessionFsReadFileRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsReadFileResult",
          "description": "File content as a UTF-8 string, or a filesystem error if the read failed."
        },
        "stability": "experimental"
      },
      "writeFile": {
        "rpcMethod": "sessionFs.writeFile",
        "description": "Writes a file in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            },
            "content": {
              "type": "string",
              "description": "Content to write"
            },
            "mode": {
              "type": "integer",
              "minimum": 0,
              "description": "Optional POSIX-style mode for newly created files"
            }
          },
          "required": [
            "sessionId",
            "path",
            "content"
          ],
          "additionalProperties": false,
          "description": "File path, content to write, and optional mode for the client-provided session filesystem.",
          "title": "SessionFsWriteFileRequest",
          "stability": "experimental"
        },
        "result": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "$ref": "#/definitions/SessionFsError",
              "description": "Describes a filesystem error."
            }
          ],
          "description": "Describes a filesystem error."
        },
        "stability": "experimental"
      },
      "appendFile": {
        "rpcMethod": "sessionFs.appendFile",
        "description": "Appends content to a file in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            },
            "content": {
              "type": "string",
              "description": "Content to append"
            },
            "mode": {
              "type": "integer",
              "minimum": 0,
              "description": "Optional POSIX-style mode for newly created files"
            }
          },
          "required": [
            "sessionId",
            "path",
            "content"
          ],
          "additionalProperties": false,
          "description": "File path, content to append, and optional mode for the client-provided session filesystem.",
          "title": "SessionFsAppendFileRequest",
          "stability": "experimental"
        },
        "result": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "$ref": "#/definitions/SessionFsError",
              "description": "Describes a filesystem error."
            }
          ],
          "description": "Describes a filesystem error."
        },
        "stability": "experimental"
      },
      "exists": {
        "rpcMethod": "sessionFs.exists",
        "description": "Checks whether a path exists in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Path to test for existence in the client-provided session filesystem.",
          "title": "SessionFsExistsRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsExistsResult",
          "description": "Indicates whether the requested path exists in the client-provided session filesystem."
        },
        "stability": "experimental"
      },
      "stat": {
        "rpcMethod": "sessionFs.stat",
        "description": "Gets metadata for a path in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Path whose metadata should be returned from the client-provided session filesystem.",
          "title": "SessionFsStatRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsStatResult",
          "description": "Filesystem metadata for the requested path, or a filesystem error if the stat failed."
        },
        "stability": "experimental"
      },
      "mkdir": {
        "rpcMethod": "sessionFs.mkdir",
        "description": "Creates a directory in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            },
            "recursive": {
              "type": "boolean",
              "description": "Create parent directories as needed"
            },
            "mode": {
              "type": "integer",
              "minimum": 0,
              "description": "Optional POSIX-style mode for newly created directories"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode.",
          "title": "SessionFsMkdirRequest",
          "stability": "experimental"
        },
        "result": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "$ref": "#/definitions/SessionFsError",
              "description": "Describes a filesystem error."
            }
          ],
          "description": "Describes a filesystem error."
        },
        "stability": "experimental"
      },
      "readdir": {
        "rpcMethod": "sessionFs.readdir",
        "description": "Lists entry names in a directory from the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Directory path whose entries should be listed from the client-provided session filesystem.",
          "title": "SessionFsReaddirRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsReaddirResult",
          "description": "Names of entries in the requested directory, or a filesystem error if the read failed."
        },
        "stability": "experimental"
      },
      "readdirWithTypes": {
        "rpcMethod": "sessionFs.readdirWithTypes",
        "description": "Lists directory entries with type information from the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Directory path whose entries (with type information) should be listed from the client-provided session filesystem.",
          "title": "SessionFsReaddirWithTypesRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsReaddirWithTypesResult",
          "description": "Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed."
        },
        "stability": "experimental"
      },
      "rm": {
        "rpcMethod": "sessionFs.rm",
        "description": "Removes a file or directory from the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "path": {
              "type": "string",
              "description": "Path using SessionFs conventions"
            },
            "recursive": {
              "type": "boolean",
              "description": "Remove directories and their contents recursively"
            },
            "force": {
              "type": "boolean",
              "description": "Ignore errors if the path does not exist"
            }
          },
          "required": [
            "sessionId",
            "path"
          ],
          "additionalProperties": false,
          "description": "Path to remove from the client-provided session filesystem, with options for recursive removal and force.",
          "title": "SessionFsRmRequest",
          "stability": "experimental"
        },
        "result": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "$ref": "#/definitions/SessionFsError",
              "description": "Describes a filesystem error."
            }
          ],
          "description": "Describes a filesystem error."
        },
        "stability": "experimental"
      },
      "rename": {
        "rpcMethod": "sessionFs.rename",
        "description": "Renames or moves a path in the client-provided session filesystem.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "src": {
              "type": "string",
              "description": "Source path using SessionFs conventions"
            },
            "dest": {
              "type": "string",
              "description": "Destination path using SessionFs conventions"
            }
          },
          "required": [
            "sessionId",
            "src",
            "dest"
          ],
          "additionalProperties": false,
          "description": "Source and destination paths for renaming or moving an entry in the client-provided session filesystem.",
          "title": "SessionFsRenameRequest",
          "stability": "experimental"
        },
        "result": {
          "anyOf": [
            {
              "not": {}
            },
            {
              "$ref": "#/definitions/SessionFsError",
              "description": "Describes a filesystem error."
            }
          ],
          "description": "Describes a filesystem error."
        },
        "stability": "experimental"
      },
      "sqliteQuery": {
        "rpcMethod": "sessionFs.sqliteQuery",
        "description": "Executes a SQLite query against the per-session database. Providers apply busy handling for every call.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "query": {
              "type": "string",
              "description": "SQL query to execute"
            },
            "queryType": {
              "$ref": "#/definitions/SessionFsSqliteQueryType",
              "description": "How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected)"
            },
            "params": {
              "type": "object",
              "additionalProperties": {
                "x-opaque-json": true
              },
              "description": "Optional named bind parameters"
            }
          },
          "required": [
            "sessionId",
            "query",
            "queryType"
          ],
          "additionalProperties": false,
          "description": "SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call.",
          "title": "SessionFsSqliteQueryRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsSqliteQueryResult",
          "description": "Query results including rows, columns, and rows affected, or a filesystem error if execution failed."
        },
        "stability": "experimental"
      },
      "sqliteTransaction": {
        "rpcMethod": "sessionFs.sqliteTransaction",
        "description": "Executes SQLite statements atomically on the provider-owned connection.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "statements": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/SessionFsSqliteTransactionStatement",
                "description": "One statement in an atomic SQLite transaction."
              },
              "description": "Ordered SQL statements to execute in one transaction."
            }
          },
          "required": [
            "sessionId",
            "statements"
          ],
          "additionalProperties": false,
          "description": "Statements to execute atomically. Providers apply busy handling for every call.",
          "title": "SessionFsSqliteTransactionRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/SessionFsSqliteTransactionResult",
          "description": "Per-statement results, or a classified transaction error."
        },
        "stability": "experimental"
      },
      "sqliteExists": {
        "rpcMethod": "sessionFs.sqliteExists",
        "description": "Checks whether the per-session SQLite database already exists, without creating it.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            }
          },
          "required": [
            "sessionId"
          ],
          "additionalProperties": false,
          "description": "Identifies the target session."
        },
        "result": {
          "$ref": "#/definitions/SessionFsSqliteExistsResult",
          "description": "Indicates whether the per-session SQLite database already exists."
        },
        "stability": "experimental"
      }
    },
    "canvas": {
      "open": {
        "rpcMethod": "canvas.open",
        "description": "Opens a canvas instance on the provider.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "extensionId": {
              "type": "string",
              "description": "Owning provider identifier"
            },
            "canvasId": {
              "type": "string",
              "description": "Provider-local canvas identifier"
            },
            "instanceId": {
              "type": "string",
              "description": "Stable caller-supplied canvas instance identifier"
            },
            "input": {
              "description": "Canvas open input",
              "x-opaque-json": true
            },
            "host": {
              "$ref": "#/definitions/CanvasHostContext",
              "description": "Host context supplied by the runtime."
            },
            "session": {
              "$ref": "#/definitions/CanvasSessionContext",
              "description": "Session context supplied by the runtime."
            }
          },
          "required": [
            "sessionId",
            "extensionId",
            "canvasId",
            "instanceId"
          ],
          "additionalProperties": false,
          "description": "Canvas open parameters sent to the provider.",
          "title": "CanvasProviderOpenRequest",
          "stability": "experimental"
        },
        "result": {
          "$ref": "#/definitions/CanvasProviderOpenResult",
          "description": "Canvas open result returned by the provider."
        },
        "stability": "experimental"
      },
      "close": {
        "rpcMethod": "canvas.close",
        "description": "Closes a canvas instance on the provider.",
        "params": {
          "type": "object",
          "properties": {
            "sessionId": {
              "type": "string",
              "description": "Target session identifier"
            },
            "extensionId": {
              "type": "string",
              "description": "Owning provider identifier"
            },
            "canvasId": {
              "type": "string",
              "description": "Provider-local canvas identifier"
            },
            "instanceId": {
              "type": "string",
              "description": "Canvas instance identifier"
            },
            "host": {
              "$ref": "#/definitions/CanvasHostContext",
              "description": "Host context supplied by the runtime."
            },
            "session": {
              "$ref": "#/definitions/CanvasSessionContext",
              "description": "Session context supplied by the runtime."
            }
          },
          "required": [
            "sessionId",
            "extensionId",
            "canvasId",
            "instanceId"
          ],
          "additionalProperties": false,
          "description": "Canvas close parameters sent to the provider.",
          "title": "CanvasProviderCloseRequest",
          "stability": "experimental"
        },
        "result": {
          "type": "null"
        },
        "stability": "experimental"
      },
      "action": {
        "invoke": {
          "rpcMethod": "canvas.action.invoke",
          "description": "Invokes an action on an open canvas instance via the provider.",
          "params": {
            "type": "object",
            "properties": {
              "sessionId": {
                "type": "string",
                "description": "Target session identifier"
              },
              "extensionId": {
                "type": "string",
                "description": "Owning provider identifier"
              },
              "canvasId": {
                "type": "string",
                "description": "Provider-local canvas identifier"
              },
              "instanceId": {
                "type": "string",
                "description": "Canvas instance identifier"
              },
              "actionName": {
                "type": "string",
                "description": "Action name to invoke"
              },
              "input": {
                "description": "Action input",
                "x-opaque-json": true
              },
              "host": {
                "$ref": "#/definitions/CanvasHostContext",
                "description": "Host context supplied by the runtime."
              },
              "session": {
                "$ref": "#/definitions/CanvasSessionContext",
                "description": "Session context supplied by the runtime."
              }
            },
            "required": [
              "sessionId",
              "extensionId",
              "canvasId",
              "instanceId",
              "actionName"
            ],
            "additionalProperties": false,
            "description": "Canvas action invocation parameters sent to the provider.",
            "title": "CanvasProviderInvokeActionRequest",
            "stability": "experimental"
          },
          "result": {
            "description": "Provider-supplied action result.",
            "x-opaque-json": true
          },
          "stability": "experimental"
        }
      }
    }
  },
  "clientGlobal": {
    "hooks": {
      "invoke": {
        "rpcMethod": "hooks.invoke",
        "description": "Dispatches one SDK callback hook from the runtime to the connection that registered it. Internal transport plumbing: clients opt in through session initialization and the Rust hook processor owns ordering, policy, timeout, and callback routing.",
        "params": {
          "$ref": "#/definitions/HookInvokeRequest",
          "description": "Runtime-owned wire payload for a server-to-client hook callback invocation.",
          "visibility": "internal"
        },
        "result": {
          "$ref": "#/definitions/HookInvokeResponse",
          "description": "Optional output returned by an SDK callback hook.",
          "visibility": "internal"
        },
        "stability": "experimental",
        "visibility": "internal"
      }
    },
    "extensionLaunchProvider": {
      "resolve": {
        "rpcMethod": "extensionLaunchProvider.resolve",
        "description": "Asks the registered SDK client to resolve an opaque process launch profile for one discovered extension entrypoint immediately before launch or reload. The provider must respond within 15 seconds.",
        "params": {
          "$ref": "#/definitions/ExtensionLaunchProviderResolveRequest",
          "description": "A discovered extension entrypoint that the registered integrator may classify and resolve to an opaque launch profile."
        },
        "result": {
          "$ref": "#/definitions/ExtensionLaunchProviderResolveResult",
          "description": "The launch profile for a supported entrypoint. Omit launch when the provider does not support the entrypoint."
        },
        "stability": "experimental"
      }
    },
    "llmInference": {
      "httpRequestStart": {
        "rpcMethod": "llmInference.httpRequestStart",
        "description": "Announces an outbound model-layer HTTP request the runtime wants the SDK client to service. Carries the request head only; the body always follows as one or more httpRequestChunk frames keyed by the same requestId, even when the body is empty (a single chunk with end=true).",
        "params": {
          "$ref": "#/definitions/LlmInferenceHttpRequestStartRequest",
          "description": "The head of an outbound model-layer HTTP request."
        },
        "result": {
          "$ref": "#/definitions/LlmInferenceHttpRequestStartResult",
          "description": "Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed."
        },
        "stability": "experimental"
      },
      "httpRequestChunk": {
        "rpcMethod": "llmInference.httpRequestChunk",
        "description": "Delivers a body byte range (or a cancellation signal) for a request previously announced via httpRequestStart, correlated by requestId. The runtime fires at least one chunk per request — when there is no body, a single chunk with empty data and end=true. Mid-stream the runtime may send a chunk with cancel=true to abort the request; the SDK then stops issuing httpResponseChunk frames and may emit a terminal httpResponseChunk with error set.",
        "params": {
          "$ref": "#/definitions/LlmInferenceHttpRequestChunkRequest",
          "description": "A request body chunk or cancellation signal."
        },
        "result": {
          "$ref": "#/definitions/LlmInferenceHttpRequestChunkResult",
          "description": "Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget."
        },
        "stability": "experimental"
      }
    },
    "gitHubTelemetry": {
      "event": {
        "rpcMethod": "gitHubTelemetry.event",
        "description": "Forwards a single GitHub telemetry event to a host connection that opted into telemetry forwarding during the `server.connect` handshake. Opted-in connections receive every event the runtime emits after the handshake — across all sessions, plus sessionless events (for example, `server.sendTelemetry` calls with no session id).",
        "params": {
          "$ref": "#/definitions/GitHubTelemetryNotification",
          "description": "Payload for a `gitHubTelemetry.event` notification: a single GitHub telemetry event the runtime forwards to a host connection that opted into telemetry forwarding during the `server.connect` handshake."
        },
        "result": {
          "type": "null"
        },
        "notification": true,
        "stability": "experimental"
      }
    },
    "gitHubToken": {
      "getToken": {
        "rpcMethod": "gitHubToken.getToken",
        "description": "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.",
        "params": {
          "$ref": "#/definitions/GitHubTokenAcquireRequest",
          "description": "Asks the SDK client to acquire a GitHub access token from an opaque callback registration."
        },
        "result": {
          "$ref": "#/definitions/GitHubTokenAcquireResult",
          "description": "SDK host response to a GitHub credential request."
        },
        "stability": "experimental"
      }
    }
  },
  "definitions": {
    "AbortReason": {
      "type": "string",
      "enum": [
        "user_initiated",
        "remote_command",
        "user_abort",
        "autopilot_credit_limit"
      ],
      "description": "Finite reason code describing why the current turn was aborted",
      "title": "AbortReason",
      "x-enumDescriptions": {
        "user_initiated": "The local user requested the abort, for example by pressing Ctrl+C in the CLI.",
        "remote_command": "A remote command requested the abort.",
        "user_abort": "An MCP server delivered a user.abort notification.",
        "autopilot_credit_limit": "Autopilot stopped the run because the active objective reached its user-set --max-ai-credits limit."
      }
    },
    "AbortRequest": {
      "type": "object",
      "properties": {
        "reason": {
          "$ref": "#/definitions/AbortReason",
          "description": "Finite reason code describing why the current turn was aborted"
        }
      },
      "additionalProperties": false,
      "description": "Parameters for aborting the current turn",
      "title": "AbortRequest",
      "stability": "experimental"
    },
    "AbortResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the abort completed successfully"
        },
        "error": {
          "type": "string",
          "description": "Error message if the abort failed"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Result of aborting the current turn",
      "title": "AbortResult"
    },
    "AccountAllUsers": {
      "type": "object",
      "properties": {
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Authentication information for this user"
        },
        "selectionId": {
          "type": "string",
          "description": "Opaque identifier accepted by account and model selection APIs"
        },
        "token": {
          "type": "string",
          "description": "Associated token, if available"
        }
      },
      "required": [
        "authInfo"
      ],
      "additionalProperties": false,
      "description": "Authenticated account entry returned by `account.getAllUsers`.",
      "title": "AccountAllUsers"
    },
    "AccountGetCurrentAuthResult": {
      "type": "object",
      "properties": {
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Current authentication information, if authenticated"
        },
        "authErrors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Authentication errors from the last auth attempt, if any"
        }
      },
      "additionalProperties": false,
      "description": "Current authentication state",
      "title": "AccountGetCurrentAuthResult"
    },
    "AccountGetQuotaRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "selectionId": {
              "type": "string",
              "description": "Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used."
            },
            "gitHubToken": {
              "type": "string",
              "description": "GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional opaque account selection or compatibility GitHub token used to look up quota.",
      "title": "AccountGetQuotaRequest"
    },
    "AccountGetQuotaResult": {
      "type": "object",
      "properties": {
        "quotaSnapshots": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/AccountQuotaSnapshot",
            "description": "Quota usage snapshot for a Copilot quota type, including entitlement, used requests, overage, reset date, and remaining percentage."
          },
          "description": "Quota snapshots keyed by type (e.g., chat, completions, premium_interactions)"
        }
      },
      "required": [
        "quotaSnapshots"
      ],
      "additionalProperties": false,
      "description": "Quota usage snapshots for the resolved user, keyed by quota type.",
      "title": "AccountGetQuotaResult"
    },
    "AccountLoginRequest": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "GitHub host URL"
        },
        "login": {
          "type": "string",
          "description": "User login/username. When omitted, the runtime validates the token and resolves the login from GitHub."
        },
        "token": {
          "type": "string",
          "description": "GitHub authentication token"
        }
      },
      "required": [
        "host",
        "token"
      ],
      "additionalProperties": false,
      "description": "Credentials to validate and store. Omit login to resolve the authenticated user from the token.",
      "title": "AccountLoginRequest"
    },
    "AccountLoginResult": {
      "type": "object",
      "properties": {
        "storedInVault": {
          "type": "boolean",
          "description": "Whether the credential was persisted to a secure store (system keychain, or the config file when plaintext storage is enabled). False when no secure store was available and the token was not saved, so the consumer can decide how to proceed."
        }
      },
      "required": [
        "storedInVault"
      ],
      "additionalProperties": false,
      "description": "Result of a successful login; throws on failure",
      "title": "AccountLoginResult"
    },
    "AccountLogoutRequest": {
      "anyOf": [
        {
          "required": [
            "selectionId"
          ]
        },
        {
          "required": [
            "authInfo"
          ]
        }
      ],
      "type": "object",
      "properties": {
        "selectionId": {
          "type": "string",
          "description": "Opaque account identifier returned by `account.getAllUsers`"
        },
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Authentication information for the user to log out"
        }
      },
      "additionalProperties": false,
      "description": "User to log out",
      "title": "AccountLogoutRequest"
    },
    "AccountLogoutResult": {
      "type": "object",
      "properties": {
        "hasMoreUsers": {
          "type": "boolean",
          "description": "Whether other authenticated users remain after logout"
        }
      },
      "required": [
        "hasMoreUsers"
      ],
      "additionalProperties": false,
      "description": "Logout result indicating if more users remain",
      "title": "AccountLogoutResult"
    },
    "AccountQuotaSnapshot": {
      "type": "object",
      "properties": {
        "isUnlimitedEntitlement": {
          "type": "boolean",
          "description": "Whether the user has an unlimited usage entitlement"
        },
        "entitlementRequests": {
          "type": "integer",
          "minimum": -1,
          "description": "Number of requests included in the entitlement, or -1 for unlimited entitlements"
        },
        "usedRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of requests used so far this period"
        },
        "usageAllowedWithExhaustedQuota": {
          "type": "boolean",
          "description": "Whether usage is still permitted after quota exhaustion"
        },
        "remainingPercentage": {
          "type": "number",
          "description": "Percentage of entitlement remaining"
        },
        "overage": {
          "type": "number",
          "minimum": 0,
          "description": "Number of additional usage requests made this period"
        },
        "overageAllowedWithExhaustedQuota": {
          "type": "boolean",
          "description": "Whether additional usage is allowed when quota is exhausted"
        },
        "resetDate": {
          "type": "string",
          "format": "date-time",
          "description": "Date when the quota resets (ISO 8601 string)"
        }
      },
      "required": [
        "isUnlimitedEntitlement",
        "entitlementRequests",
        "usedRequests",
        "usageAllowedWithExhaustedQuota",
        "remainingPercentage",
        "overage",
        "overageAllowedWithExhaustedQuota"
      ],
      "additionalProperties": false,
      "description": "Quota usage snapshot for a Copilot quota type, including entitlement, used requests, overage, reset date, and remaining percentage.",
      "title": "AccountQuotaSnapshot"
    },
    "AdaptiveThinkingSupport": {
      "type": "string",
      "enum": [
        "unsupported",
        "optional",
        "required"
      ],
      "description": "Resolved Anthropic adaptive-thinking capability for a model.",
      "title": "AdaptiveThinkingSupport",
      "x-enumDescriptions": {
        "unsupported": "The model does not accept thinking.type='adaptive'",
        "optional": "The model accepts adaptive thinking but also accepts thinking.type='enabled'",
        "required": "The model only accepts adaptive thinking and rejects thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8)"
      }
    },
    "AgentDiscoveryPath": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Absolute path of the search/create directory (may not exist on disk yet)"
        },
        "scope": {
          "$ref": "#/definitions/AgentDiscoveryPathScope",
          "description": "Which tier this directory belongs to"
        },
        "preferredForCreation": {
          "type": "boolean",
          "description": "Whether this is the canonical directory to create a new agent in its tier. At most one entry per tier is preferred."
        },
        "projectPath": {
          "type": "string",
          "description": "The input project path this directory was derived from (only for project scope)"
        }
      },
      "required": [
        "path",
        "scope",
        "preferredForCreation"
      ],
      "additionalProperties": false,
      "description": "Canonical directory where custom agents can be discovered or created, with scope, preference, and optional project path.",
      "title": "AgentDiscoveryPath"
    },
    "AgentDiscoveryPathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AgentDiscoveryPath",
            "description": "Canonical directory where custom agents can be discovered or created, with scope, preference, and optional project path."
          },
          "description": "Canonical agent create/discovery directories, in priority order"
        }
      },
      "required": [
        "paths"
      ],
      "additionalProperties": false,
      "description": "Canonical locations where custom agents can be created so the runtime will recognize them.",
      "title": "AgentDiscoveryPathList"
    },
    "AgentDiscoveryPathScope": {
      "type": "string",
      "enum": [
        "user",
        "project"
      ],
      "description": "Which tier this directory belongs to",
      "title": "AgentDiscoveryPathScope",
      "x-enumDescriptions": {
        "user": "The user's personal agent configuration directory.",
        "project": "A project's repository agent directory."
      }
    },
    "AgentGetCurrentResult": {
      "type": "object",
      "properties": {
        "agent": {
          "$ref": "#/definitions/AgentInfo",
          "description": "Currently selected custom agent, or null if using the default agent"
        }
      },
      "required": [
        "agent"
      ],
      "additionalProperties": false,
      "description": "The currently selected custom agent, or null when using the default agent.",
      "title": "AgentGetCurrentResult"
    },
    "AgentInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the agent. Use `id` as the stable selection identifier."
        },
        "displayName": {
          "type": "string",
          "description": "Human-readable display name"
        },
        "description": {
          "type": "string",
          "description": "Description of the agent's purpose"
        },
        "path": {
          "type": "string",
          "description": "Absolute local file path of the agent definition. Only set for file-based agents loaded from disk; remote agents do not have a path."
        },
        "id": {
          "type": "string",
          "description": "Stable identifier for selection. For most agents this is the same as `name`; for plugin/builtin agents it may differ. Always populated; defaults to `name` when no distinct id was assigned."
        },
        "source": {
          "$ref": "#/definitions/AgentInfoSource",
          "description": "Where the agent definition was loaded from"
        },
        "userInvocable": {
          "type": "boolean",
          "description": "Whether the agent can be selected directly by the user. Agents marked `false` are subagent-only."
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed tool names for this agent. Empty array means none; omitted means inherit defaults."
        },
        "model": {
          "type": "string",
          "description": "Authored preferred model id for this agent. Runtime model selection may choose a different model; omitted means no authored preference."
        },
        "models": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Authored preferred model ids for this agent, in priority order. Runtime model selection chooses the first available model; omitted means no authored preference."
        },
        "modelPolicy": {
          "$ref": "#/definitions/AgentModelPolicy",
          "description": "Whether authored models are preferences or required constraints."
        },
        "mcpServers": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "MCP server configurations attached to this agent, keyed by server name. Server config shape mirrors the MCP `mcpServers` schema.",
          "stability": "experimental"
        },
        "skills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Skill names preloaded into this agent's context. Omitted means none."
        },
        "prompt": {
          "type": "string",
          "description": "Authored base prompt for the agent. Runtime prompt assembly may add dynamic context at invocation time. Omitted from `session.agent.list` unless `includePrompt` is true."
        }
      },
      "required": [
        "name",
        "displayName",
        "description",
        "id"
      ],
      "additionalProperties": false,
      "description": "Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path.",
      "title": "AgentInfo"
    },
    "AgentInfoSource": {
      "type": "string",
      "enum": [
        "user",
        "project",
        "inherited",
        "remote",
        "plugin",
        "builtin"
      ],
      "description": "Where the agent definition was loaded from",
      "title": "AgentInfoSource",
      "x-enumDescriptions": {
        "user": "Agent loaded from the user's personal agent configuration.",
        "project": "Agent loaded from the current project's repository configuration.",
        "inherited": "Agent inherited from a parent project or workspace.",
        "remote": "Agent provided by a remote runtime or service.",
        "plugin": "Agent contributed by an installed plugin.",
        "builtin": "Agent built into the Copilot runtime."
      }
    },
    "AgentList": {
      "type": "object",
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AgentInfo",
            "description": "Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path."
          },
          "description": "Available agents"
        }
      },
      "required": [
        "agents"
      ],
      "additionalProperties": false,
      "description": "Agents available to the session.",
      "title": "AgentList"
    },
    "AgentListRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "includeBuiltInAgents": {
              "type": "boolean",
              "description": "When true, request the session's configured built-in agents alongside custom agents. Listing applies feature, context, inclusion, exclusion, and user-disabled-agent policy, but does not evaluate transient invocation requirements such as model availability. Built-in metadata may be omitted when the session cannot project it, such as a relay session."
            },
            "includePrompt": {
              "type": "boolean",
              "description": "When true, request authored base prompt text on each AgentInfo. Prompt text may be omitted when unavailable, such as for agents projected through a relay session."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Controls whether built-in agents and authored prompt text are included.",
      "title": "AgentListRequest",
      "stability": "experimental"
    },
    "AgentModelPolicy": {
      "type": "string",
      "enum": [
        "preferred",
        "required"
      ],
      "description": "Whether configured models are advisory preferences or required constraints",
      "title": "AgentModelPolicy",
      "x-enumDescriptions": {
        "preferred": "Treat the authored models as advisory preferences that callers may override.",
        "required": "Require subagent execution to use one of the authored models."
      }
    },
    "AgentRegistryLiveTargetEntry": {
      "type": "object",
      "properties": {
        "schemaVersion": {
          "type": "integer",
          "description": "Registry entry schema version (1 = ui-server, 2 = managed-server)"
        },
        "kind": {
          "$ref": "#/definitions/AgentRegistryLiveTargetEntryKind",
          "description": "Process kind tag for the registry entry"
        },
        "pid": {
          "type": "integer",
          "description": "Operating-system pid of the process owning this entry"
        },
        "host": {
          "type": "string",
          "description": "Bind host for the entry's JSON-RPC server"
        },
        "port": {
          "type": "integer",
          "description": "TCP port the entry's JSON-RPC server is listening on"
        },
        "sessionId": {
          "type": "string",
          "description": "Session ID of the foreground session for this entry"
        },
        "sessionName": {
          "type": "string",
          "description": "Friendly session name (when set)"
        },
        "cwd": {
          "type": "string",
          "description": "Working directory of the session (when known)"
        },
        "branch": {
          "type": "string",
          "description": "Git branch of the session (when known)"
        },
        "model": {
          "type": "string",
          "description": "Model identifier currently selected for the session"
        },
        "status": {
          "$ref": "#/definitions/AgentRegistryLiveTargetEntryStatus",
          "description": "Coarse lifecycle status of the foreground session"
        },
        "attentionKind": {
          "$ref": "#/definitions/AgentRegistryLiveTargetEntryAttentionKind",
          "description": "Kind of attention required when status === \"attention\". Meaningful only when status === \"attention\"."
        },
        "statusRevision": {
          "type": "integer",
          "minimum": 0,
          "description": "Monotonic per-publisher revision counter incremented on every status update. Lets watchers detect transient flips."
        },
        "lastTerminalEvent": {
          "$ref": "#/definitions/AgentRegistryLiveTargetEntryLastTerminalEvent",
          "description": "How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled."
        },
        "startedAt": {
          "type": "string",
          "description": "ISO 8601 timestamp captured at registration"
        },
        "copilotVersion": {
          "type": "string",
          "description": "Copilot CLI version that wrote the entry"
        },
        "lastSeenMs": {
          "type": "integer",
          "description": "Wall-clock milliseconds since the watcher last observed this entry (heartbeat freshness)"
        },
        "token": {
          "type": [
            "string",
            "null"
          ],
          "description": "Connection token (null when the target is unauthenticated)",
          "visibility": "internal"
        }
      },
      "required": [
        "schemaVersion",
        "kind",
        "pid",
        "host",
        "port",
        "startedAt",
        "copilotVersion",
        "lastSeenMs"
      ],
      "additionalProperties": false,
      "description": "Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window).",
      "title": "AgentRegistryLiveTargetEntry"
    },
    "AgentRegistryLiveTargetEntryAttentionKind": {
      "type": "string",
      "enum": [
        "error",
        "permission",
        "exit_plan",
        "elicitation",
        "user_input"
      ],
      "description": "Kind of attention required when status === \"attention\". Meaningful only when status === \"attention\".",
      "title": "AgentRegistryLiveTargetEntryAttentionKind",
      "x-enumDescriptions": {
        "error": "Session is blocked on an unrecoverable error",
        "permission": "Session is waiting for a tool-permission decision",
        "exit_plan": "Session is waiting for the user to approve or reject a plan",
        "elicitation": "Session is waiting on an elicitation prompt",
        "user_input": "Session is waiting for free-form user input"
      }
    },
    "AgentRegistryLiveTargetEntryKind": {
      "type": "string",
      "enum": [
        "ui-server",
        "managed-server"
      ],
      "description": "Process kind tag for the registry entry",
      "title": "AgentRegistryLiveTargetEntryKind",
      "x-enumDescriptions": {
        "ui-server": "Interactive Copilot CLI exposing a UI server (legacy/normal CLI process)",
        "managed-server": "Headless `--server --managed-server` child spawned by a controller"
      }
    },
    "AgentRegistryLiveTargetEntryLastTerminalEvent": {
      "type": "string",
      "enum": [
        "turn_end",
        "abort"
      ],
      "description": "How the most recent turn ended (clean vs aborted). Lets the renderer distinguish done from done_cancelled.",
      "title": "AgentRegistryLiveTargetEntryLastTerminalEvent",
      "x-enumDescriptions": {
        "turn_end": "Last turn ended cleanly (model returned a final assistant message)",
        "abort": "Last turn was aborted (e.g. user interrupted)"
      }
    },
    "AgentRegistryLiveTargetEntryStatus": {
      "type": "string",
      "enum": [
        "working",
        "waiting",
        "done",
        "attention"
      ],
      "description": "Coarse lifecycle status of the foreground session",
      "title": "AgentRegistryLiveTargetEntryStatus",
      "x-enumDescriptions": {
        "working": "Session is actively processing a turn",
        "waiting": "Session is idle, waiting for input",
        "done": "Last turn completed successfully",
        "attention": "Session needs user attention (see attentionKind for the specific reason)"
      }
    },
    "AgentRegistryLogCapture": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether per-spawn log capture is on (false when env-disabled or open failed)"
        },
        "path": {
          "type": "string",
          "description": "Absolute path to the per-spawn log file (only set when enabled)"
        },
        "openError": {
          "type": "string",
          "description": "Human-readable open failure message (only set when enabled === false AND the env-disable opt-out was NOT used)"
        },
        "openErrorReason": {
          "$ref": "#/definitions/AgentRegistryLogCaptureOpenErrorReason",
          "description": "Categorized reason for log-open failure"
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Per-spawn log-capture outcome; populated from spawnLiveTarget.",
      "title": "AgentRegistryLogCapture"
    },
    "AgentRegistryLogCaptureOpenErrorReason": {
      "type": "string",
      "enum": [
        "permission",
        "disk_full",
        "other"
      ],
      "description": "Categorized reason for log-open failure",
      "title": "AgentRegistryLogCaptureOpenErrorReason",
      "x-enumDescriptions": {
        "permission": "Filesystem permission denied opening the log file",
        "disk_full": "No space left on device",
        "other": "Other / uncategorized open failure"
      }
    },
    "AgentRegistrySpawnError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "spawn-error",
          "description": "Discriminator: child_process.spawn itself failed"
        },
        "message": {
          "type": "string",
          "description": "Human-readable error message"
        },
        "code": {
          "type": "string",
          "description": "Underlying errno code (e.g. ENOENT, EACCES) when available"
        }
      },
      "required": [
        "kind",
        "message"
      ],
      "additionalProperties": false,
      "description": "`child_process.spawn` itself failed before the child entered the registry.",
      "title": "AgentRegistrySpawnError"
    },
    "AgentRegistrySpawnPermissionMode": {
      "type": "string",
      "enum": [
        "default",
        "yolo"
      ],
      "description": "Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode.",
      "title": "AgentRegistrySpawnPermissionMode",
      "x-enumDescriptions": {
        "default": "Standard permission posture (prompts for each request)",
        "yolo": "Full allow-all (requires the controller-local session to currently be in allow-all mode)"
      }
    },
    "AgentRegistrySpawnRegistryTimeout": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "registry-timeout",
          "description": "Discriminator: spawn succeeded but child never registered"
        },
        "childPid": {
          "type": "integer",
          "description": "Process ID of the orphaned child (so the caller can offer 'kill the pid' guidance)"
        },
        "logCapture": {
          "$ref": "#/definitions/AgentRegistryLogCapture",
          "description": "Per-spawn log-capture outcome; populated from spawnLiveTarget."
        }
      },
      "required": [
        "kind",
        "childPid"
      ],
      "additionalProperties": false,
      "description": "Spawn succeeded but the child did not publish a matching managed-server entry within the timeout.",
      "title": "AgentRegistrySpawnRegistryTimeout"
    },
    "AgentRegistrySpawnRequest": {
      "type": "object",
      "properties": {
        "cwd": {
          "type": "string",
          "description": "Working directory for the spawned child (must be an existing directory)"
        },
        "agentName": {
          "type": "string",
          "description": "Custom or built-in agent name (e.g. 'explore'). When omitted, the child uses its own default."
        },
        "model": {
          "type": "string",
          "description": "Model identifier to apply to the new session"
        },
        "name": {
          "type": "string",
          "description": "Friendly session name. Must satisfy validateSessionName: non-empty, no leading/trailing whitespace, <=100 chars, no control chars, no double quotes."
        },
        "permissionMode": {
          "$ref": "#/definitions/AgentRegistrySpawnPermissionMode",
          "description": "Permission posture for the new session. 'yolo' requires the controller-local session to currently be in allow-all mode."
        },
        "initialPrompt": {
          "type": "string",
          "description": "Optional first user message. Forwarded to the caller (the CLI's spawn wrapper sends it post-attach via the standard LocalRpcSession.send path)."
        }
      },
      "required": [
        "cwd"
      ],
      "additionalProperties": false,
      "description": "Inputs to spawn a managed-server child via the controller's spawn delegate.",
      "title": "AgentRegistrySpawnRequest"
    },
    "AgentRegistrySpawnResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/AgentRegistrySpawnSpawned",
          "description": "Managed-server child was spawned and registered successfully."
        },
        {
          "$ref": "#/definitions/AgentRegistrySpawnError",
          "description": "`child_process.spawn` itself failed before the child entered the registry."
        },
        {
          "$ref": "#/definitions/AgentRegistrySpawnRegistryTimeout",
          "description": "Spawn succeeded but the child did not publish a matching managed-server entry within the timeout."
        },
        {
          "$ref": "#/definitions/AgentRegistrySpawnValidationError",
          "description": "Synchronous pre-validation rejected the spawn request."
        }
      ],
      "description": "Outcome of an agentRegistry.spawn call.",
      "title": "AgentRegistrySpawnResult"
    },
    "AgentRegistrySpawnSpawned": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "spawned",
          "description": "Discriminator: managed-server child spawned successfully"
        },
        "entry": {
          "$ref": "#/definitions/AgentRegistryLiveTargetEntry",
          "description": "Full registry entry for the spawned child. Lets the controller call `handleLiveTargetSelected(entry)` directly without re-reading the registry (avoids a TOCTOU window)."
        },
        "initialPromptSent": {
          "type": "boolean",
          "description": "Whether the delegate already sent the initial prompt. Always omitted in the current wiring: the controller sends the prompt post-attach via the standard LocalRpcSession.send path."
        },
        "initialPromptError": {
          "type": "string",
          "description": "If the delegate attempted to send the initial prompt and failed, the categorized error message."
        },
        "logCapture": {
          "$ref": "#/definitions/AgentRegistryLogCapture",
          "description": "Per-spawn log-capture outcome; populated from spawnLiveTarget."
        }
      },
      "required": [
        "kind",
        "entry"
      ],
      "additionalProperties": false,
      "description": "Managed-server child was spawned and registered successfully.",
      "title": "AgentRegistrySpawnSpawned"
    },
    "AgentRegistrySpawnValidationError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "validation-error",
          "description": "Discriminator: synchronous pre-validation rejected the request"
        },
        "reason": {
          "$ref": "#/definitions/AgentRegistrySpawnValidationErrorReason",
          "description": "Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names."
        },
        "field": {
          "$ref": "#/definitions/AgentRegistrySpawnValidationErrorField",
          "description": "Which parameter field was invalid. Omitted when the rejection is not field-specific."
        },
        "message": {
          "type": "string",
          "description": "Human-readable explanation; safe to surface in the UI banner. Never logged to unrestricted telemetry."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "Synchronous pre-validation rejected the spawn request.",
      "title": "AgentRegistrySpawnValidationError"
    },
    "AgentRegistrySpawnValidationErrorField": {
      "type": "string",
      "enum": [
        "cwd",
        "name",
        "agentName",
        "model",
        "permissionMode"
      ],
      "description": "Which parameter field was invalid. Omitted when the rejection is not field-specific.",
      "title": "AgentRegistrySpawnValidationErrorField",
      "x-enumDescriptions": {
        "cwd": "The cwd parameter",
        "name": "The session name parameter",
        "agentName": "The agentName parameter",
        "model": "The model parameter",
        "permissionMode": "The permissionMode parameter"
      }
    },
    "AgentRegistrySpawnValidationErrorReason": {
      "type": "string",
      "enum": [
        "cwd-not-found",
        "cwd-not-directory",
        "invalid-name",
        "unknown-agent",
        "unknown-model",
        "yolo-not-allowed"
      ],
      "description": "Categorized reason for the rejection. Low-cardinality enum so telemetry can aggregate by reason without leaking raw paths or agent/model names.",
      "title": "AgentRegistrySpawnValidationErrorReason",
      "x-enumDescriptions": {
        "cwd-not-found": "Provided cwd does not exist on disk",
        "cwd-not-directory": "Provided cwd exists but is not a directory",
        "invalid-name": "Session name failed validateSessionName",
        "unknown-agent": "Requested agent name was not found in builtin or custom agents",
        "unknown-model": "Requested model is not available to this session",
        "yolo-not-allowed": "Caller asked for permissionMode='yolo' but the controller is not currently in allow-all mode"
      }
    },
    "AgentReloadResult": {
      "type": "object",
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AgentInfo",
            "description": "Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path."
          },
          "description": "Reloaded custom agents"
        }
      },
      "required": [
        "agents"
      ],
      "additionalProperties": false,
      "description": "Custom agents available to the session after reloading definitions from disk.",
      "title": "AgentReloadResult"
    },
    "AgentsDiscoverRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths to scan for project-scoped agents. When omitted or empty, only user/plugin/remote-independent agents are returned (no project scan)."
        },
        "excludeHostAgents": {
          "type": "boolean",
          "description": "When true, omit the host's agents (the user-level agent directory and all plugin agents), leaving only project and remote agents. For multitenant deployments."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths to include in agent discovery.",
      "title": "AgentsDiscoverRequest"
    },
    "AgentSelectRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the custom agent to select"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name of the custom agent to select for subsequent turns.",
      "title": "AgentSelectRequest",
      "stability": "experimental"
    },
    "AgentSelectResult": {
      "type": "object",
      "properties": {
        "agent": {
          "$ref": "#/definitions/AgentInfo",
          "description": "The newly selected custom agent"
        }
      },
      "required": [
        "agent"
      ],
      "additionalProperties": false,
      "description": "The newly selected custom agent.",
      "title": "AgentSelectResult"
    },
    "AgentSetPromptRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable effective agent id. Plugin namespace separators are normalized."
        },
        "prompt": {
          "type": "string",
          "description": "Replacement authored prompt. Empty text is valid."
        }
      },
      "required": [
        "id",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "An in-memory authored prompt override for an available agent.",
      "title": "AgentSetPromptRequest",
      "stability": "experimental"
    },
    "AgentsGetDiscoveryPathsRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths. When omitted or empty, only the user-level directory is returned."
        },
        "excludeHostAgents": {
          "type": "boolean",
          "description": "When true, omit the host's user-level agent directory, leaving only project directories. For multitenant deployments (mirrors `discover`'s `excludeHostAgents`)."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths to include when enumerating agent discovery directories.",
      "title": "AgentsGetDiscoveryPathsRequest"
    },
    "ApiKeyAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "api-key",
          "description": "API-key authentication for non-GitHub LLM providers (e.g. when running BYOM-style)."
        },
        "apiKey": {
          "type": "string",
          "description": "The API key. Treat as a secret."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "apiKey",
        "host"
      ],
      "additionalProperties": false,
      "description": "Authentication-info input variant for API-key authentication to a non-GitHub LLM provider, carrying the secret `apiKey` and host.",
      "title": "ApiKeyAuthInfo"
    },
    "Attachment": {
      "anyOf": [
        {
          "$ref": "#/definitions/AttachmentFile",
          "description": "File attachment"
        },
        {
          "$ref": "#/definitions/AttachmentDirectory",
          "description": "Directory attachment"
        },
        {
          "$ref": "#/definitions/AttachmentSelection",
          "description": "Code selection attachment from an editor"
        },
        {
          "$ref": "#/definitions/AttachmentGitHubReference",
          "description": "GitHub issue, pull request, or discussion reference"
        },
        {
          "$ref": "#/definitions/AttachmentGitHubCommit",
          "description": "Pointer to a GitHub commit."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubRelease",
          "description": "Pointer to a GitHub release."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubActionsJob",
          "description": "Pointer to a GitHub Actions job."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubRepository",
          "description": "Pointer to a GitHub repository."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubFileDiff",
          "description": "Pointer to a single-file diff. At least one of `head` and `base` must be present."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubTreeComparison",
          "description": "Pointer to a comparison between two git revisions."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubUrl",
          "description": "Generic GitHub URL reference."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubFile",
          "description": "Pointer to a file in a GitHub repository at a specific ref."
        },
        {
          "$ref": "#/definitions/AttachmentGitHubSnippet",
          "description": "Pointer to a line range inside a file in a GitHub repository."
        },
        {
          "$ref": "#/definitions/AttachmentBlob",
          "description": "Blob attachment with inline base64-encoded data"
        },
        {
          "$ref": "#/definitions/AttachmentExtensionContext",
          "description": "Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block."
        }
      ],
      "description": "A user message attachment — a file, directory, code selection, blob, GitHub-anchored pointer, or extension-supplied context payload",
      "title": "Attachment"
    },
    "AttachmentBlob": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "blob",
          "description": "Attachment type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded content. Present on input and for external consumers; replaced by an internal `assetId` reference in persisted events when interned to a content-addressed asset.",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the inline data"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        },
        "assetId": {
          "type": "string",
          "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally."
        },
        "byteLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally."
        },
        "omittedReason": {
          "$ref": "#/definitions/OmittedBinaryOmittedReason",
          "description": "Internal: why model-facing bytes are absent from persistence. Absent externally."
        }
      },
      "required": [
        "type",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Blob attachment with inline base64-encoded data",
      "title": "AttachmentBlob"
    },
    "AttachmentDirectory": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "directory",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute directory path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        },
        "taggedFilesEntry": {
          "type": "string",
          "description": "Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. \"* /path (12 items)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes."
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "Directory attachment",
      "title": "AttachmentDirectory"
    },
    "AttachmentExtensionContext": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "extension_context",
          "description": "Attachment type discriminator"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning extension identifier. Runtime-derived from the caller's connection when produced via session.extensions.sendAttachmentsToMessage; preserved verbatim on subsequent transports."
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier when the push was bound to a canvas instance"
        },
        "instanceId": {
          "type": "string",
          "description": "Open canvas instance identifier when the push was bound to a canvas instance"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable composer pill label"
        },
        "payload": {
          "description": "Caller-supplied JSON payload",
          "x-opaque-json": true
        },
        "capturedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp captured by the runtime when the push was accepted"
        }
      },
      "required": [
        "type",
        "extensionId",
        "title",
        "capturedAt"
      ],
      "additionalProperties": false,
      "description": "Structured context contributed by an extension. Composer pills displayed in the host are forwarded back through session.send.attachments, then rendered into the model prompt as an <extension_context> XML block.",
      "title": "AttachmentExtensionContext"
    },
    "AttachmentFile": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute file path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        },
        "lineRange": {
          "$ref": "#/definitions/AttachmentFileLineRange",
          "description": "Optional line range to scope the attachment to a specific section of the file"
        },
        "mimeType": {
          "type": "string",
          "description": "Internal: MIME type of the file's model-facing bytes (post-resize for images). Set when the file's bytes are interned to an asset. Absent externally."
        },
        "assetId": {
          "type": "string",
          "description": "Internal: content-addressed id of the session.binary_asset event holding this attachment's model-facing bytes (e.g. \"sha256:...\"). Absent externally."
        },
        "byteLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Internal: decoded byte length of the attachment's model-facing bytes. Absent externally."
        },
        "omittedReason": {
          "$ref": "#/definitions/OmittedBinaryOmittedReason",
          "description": "Internal: why model-facing bytes are absent from persistence. Absent externally."
        },
        "taggedFilesEntry": {
          "type": "string",
          "description": "Frozen rendered line this attachment contributed to the <tagged_files> prompt block (e.g. \"* /path (123 lines)\"). Captured at send time so resumed history reproduces the exact text the model saw, independent of later filesystem changes. Present only for attachments routed to <tagged_files> (mutually exclusive with assetId, which marks bytes sent natively)."
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "File attachment",
      "title": "AttachmentFile"
    },
    "AttachmentFileLineRange": {
      "type": "object",
      "properties": {
        "start": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Start line number (1-based)"
        },
        "end": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "End line number (1-based, inclusive)"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Optional line range to scope the attachment to a specific section of the file",
      "title": "AttachmentFileLineRange"
    },
    "AttachmentGitHubActionsJob": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_actions_job",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the workflow run belongs to"
        },
        "jobId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Job id within the workflow run"
        },
        "jobName": {
          "type": "string",
          "description": "Display name of the job"
        },
        "workflowName": {
          "type": "string",
          "description": "Display name of the workflow the job ran in"
        },
        "url": {
          "type": "string",
          "description": "URL to the job on GitHub"
        },
        "conclusion": {
          "type": "string",
          "description": "Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs."
        }
      },
      "required": [
        "type",
        "repo",
        "jobId",
        "jobName",
        "workflowName",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub Actions job.",
      "title": "AttachmentGitHubActionsJob"
    },
    "AttachmentGitHubCommit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_commit",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the commit belongs to"
        },
        "oid": {
          "type": "string",
          "description": "Full commit SHA"
        },
        "message": {
          "type": "string",
          "description": "First line of the commit message"
        },
        "url": {
          "type": "string",
          "description": "URL to the commit on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "oid",
        "message",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub commit.",
      "title": "AttachmentGitHubCommit"
    },
    "AttachmentGitHubFile": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_file",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref the file is read at (branch, tag, or commit SHA)"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        },
        "url": {
          "type": "string",
          "description": "URL to the file on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "ref",
        "path",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a file in a GitHub repository at a specific ref.",
      "title": "AttachmentGitHubFile"
    },
    "AttachmentGitHubFileDiff": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_file_diff",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL)"
        },
        "head": {
          "$ref": "#/definitions/AttachmentGitHubFileDiffSide",
          "description": "File location on the head side of the diff. Absent for deletions."
        },
        "base": {
          "$ref": "#/definitions/AttachmentGitHubFileDiffSide",
          "description": "File location on the base side of the diff. Absent for additions."
        }
      },
      "required": [
        "type",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a single-file diff. At least one of `head` and `base` must be present.",
      "title": "AttachmentGitHubFileDiff"
    },
    "AttachmentGitHubFileDiffSide": {
      "type": "object",
      "properties": {
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref (branch, tag, or commit SHA) the file is read at"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        }
      },
      "required": [
        "repo",
        "ref",
        "path"
      ],
      "additionalProperties": false,
      "description": "One side of a file diff (head or base)",
      "title": "AttachmentGitHubFileDiffSide"
    },
    "AttachmentGitHubReference": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_reference",
          "description": "Attachment type discriminator"
        },
        "number": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Issue, pull request, or discussion number"
        },
        "title": {
          "type": "string",
          "description": "Title of the referenced item"
        },
        "referenceType": {
          "$ref": "#/definitions/AttachmentGitHubReferenceType",
          "description": "Type of GitHub reference"
        },
        "state": {
          "type": "string",
          "description": "Current state of the referenced item (e.g., open, closed, merged)"
        },
        "url": {
          "type": "string",
          "description": "URL to the referenced item on GitHub"
        }
      },
      "required": [
        "type",
        "number",
        "title",
        "referenceType",
        "state",
        "url"
      ],
      "additionalProperties": false,
      "description": "GitHub issue, pull request, or discussion reference",
      "title": "AttachmentGitHubReference"
    },
    "AttachmentGitHubReferenceType": {
      "type": "string",
      "enum": [
        "issue",
        "pr",
        "discussion"
      ],
      "description": "Type of GitHub reference",
      "title": "AttachmentGitHubReferenceType",
      "x-enumDescriptions": {
        "issue": "GitHub issue reference.",
        "pr": "GitHub pull request reference.",
        "discussion": "GitHub discussion reference."
      }
    },
    "AttachmentGitHubRelease": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_release",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the release belongs to"
        },
        "tagName": {
          "type": "string",
          "description": "Git tag the release is anchored to"
        },
        "name": {
          "type": "string",
          "description": "Human-readable release name"
        },
        "url": {
          "type": "string",
          "description": "URL to the release on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "tagName",
        "name",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub release.",
      "title": "AttachmentGitHubRelease"
    },
    "AttachmentGitHubRepository": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_repository",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository pointer"
        },
        "url": {
          "type": "string",
          "description": "URL to the repository on GitHub"
        },
        "description": {
          "type": "string",
          "description": "Short description of the repository"
        },
        "ref": {
          "type": "string",
          "description": "Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied."
        }
      },
      "required": [
        "type",
        "repo",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub repository.",
      "title": "AttachmentGitHubRepository"
    },
    "AttachmentGitHubSnippet": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_snippet",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref the file is read at (branch, tag, or commit SHA)"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        },
        "url": {
          "type": "string",
          "description": "URL to the snippet on GitHub (with line anchor)"
        },
        "lineRange": {
          "$ref": "#/definitions/AttachmentFileLineRange",
          "description": "Line range the snippet covers"
        }
      },
      "required": [
        "type",
        "repo",
        "ref",
        "path",
        "url",
        "lineRange"
      ],
      "additionalProperties": false,
      "description": "Pointer to a line range inside a file in a GitHub repository.",
      "title": "AttachmentGitHubSnippet"
    },
    "AttachmentGitHubTreeComparison": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_tree_comparison",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the comparison on GitHub"
        },
        "base": {
          "$ref": "#/definitions/AttachmentGitHubTreeComparisonSide",
          "description": "Base side of the comparison"
        },
        "head": {
          "$ref": "#/definitions/AttachmentGitHubTreeComparisonSide",
          "description": "Head side of the comparison"
        }
      },
      "required": [
        "type",
        "url",
        "base",
        "head"
      ],
      "additionalProperties": false,
      "description": "Pointer to a comparison between two git revisions.",
      "title": "AttachmentGitHubTreeComparison"
    },
    "AttachmentGitHubTreeComparisonSide": {
      "type": "object",
      "properties": {
        "repo": {
          "$ref": "#/definitions/GitHubRepoRef",
          "description": "Repository the revision belongs to"
        },
        "revision": {
          "type": "string",
          "description": "Git revision (branch, tag, or commit SHA)"
        }
      },
      "required": [
        "repo",
        "revision"
      ],
      "additionalProperties": false,
      "description": "One side of a tree comparison (head or base)",
      "title": "AttachmentGitHubTreeComparisonSide"
    },
    "AttachmentGitHubUrl": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_url",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the GitHub resource"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "additionalProperties": false,
      "description": "Generic GitHub URL reference.",
      "title": "AttachmentGitHubUrl"
    },
    "AttachmentSelection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "selection",
          "description": "Attachment type discriminator"
        },
        "filePath": {
          "type": "string",
          "description": "Absolute path to the file containing the selection"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the selection"
        },
        "text": {
          "type": "string",
          "description": "The selected text content"
        },
        "selection": {
          "$ref": "#/definitions/AttachmentSelectionDetails",
          "description": "Position range of the selection within the file"
        }
      },
      "required": [
        "type",
        "filePath",
        "displayName",
        "text",
        "selection"
      ],
      "additionalProperties": false,
      "description": "Code selection attachment from an editor",
      "title": "AttachmentSelection"
    },
    "AttachmentSelectionDetails": {
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/definitions/AttachmentSelectionDetailsStart",
          "description": "Start position of the selection"
        },
        "end": {
          "$ref": "#/definitions/AttachmentSelectionDetailsEnd",
          "description": "End position of the selection"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Position range of the selection within the file",
      "title": "AttachmentSelectionDetails"
    },
    "AttachmentSelectionDetailsEnd": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "End line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "End character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "End position of the selection",
      "title": "AttachmentSelectionDetailsEnd"
    },
    "AttachmentSelectionDetailsStart": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "Start line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "Start character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "Start position of the selection",
      "title": "AttachmentSelectionDetailsStart"
    },
    "AuthIdentity": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/AuthInfoType",
          "description": "Authentication type"
        },
        "host": {
          "type": "string",
          "description": "Authentication host"
        },
        "login": {
          "type": "string",
          "description": "Authenticated login, when available"
        },
        "envVar": {
          "type": "string",
          "description": "Name of the environment variable that supplied the credential, when applicable"
        },
        "registrationId": {
          "type": "string",
          "description": "Opaque SDK GitHub credential registration backing this identity. Routing metadata only; never a credential."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known"
        }
      },
      "required": [
        "type",
        "host"
      ],
      "additionalProperties": false,
      "description": "Credential-free authentication identity safe to expose to hosts and user interfaces.",
      "title": "AuthIdentity"
    },
    "AuthInfo": {
      "anyOf": [
        {
          "$ref": "#/definitions/HMACAuthInfo",
          "description": "Authentication-info input variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret."
        },
        {
          "$ref": "#/definitions/EnvAuthInfo",
          "description": "Authentication-info input variant for a token sourced from an environment variable, with host, optional login, token, and env var name."
        },
        {
          "$ref": "#/definitions/TokenAuthInfo",
          "description": "Authentication-info input variant for SDK-configured token authentication, carrying host and the secret token value."
        },
        {
          "$ref": "#/definitions/TokenProviderAuthInfo",
          "description": "Authentication-info variant backed by an SDK GitHub token callback. It carries routing metadata but never a plaintext token."
        },
        {
          "$ref": "#/definitions/CopilotApiTokenAuthInfo",
          "description": "Authentication-info variant for direct Copilot API token auth sourced from environment variables, with public GitHub host."
        },
        {
          "$ref": "#/definitions/UserAuthInfo",
          "description": "Authentication-info variant for OAuth user auth, with host and login; the token remains in the runtime secret store."
        },
        {
          "$ref": "#/definitions/GhCliAuthInfo",
          "description": "Authentication-info input variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value."
        },
        {
          "$ref": "#/definitions/ApiKeyAuthInfo",
          "description": "Authentication-info input variant for API-key authentication to a non-GitHub LLM provider, carrying the secret `apiKey` and host."
        }
      ],
      "description": "Authentication credentials accepted only at native protocol ingress. Runtime outputs use credential-free `AuthIdentity` metadata.",
      "title": "AuthInfo"
    },
    "AuthInfoType": {
      "type": "string",
      "enum": [
        "hmac",
        "env",
        "user",
        "gh-cli",
        "api-key",
        "token",
        "token-provider",
        "copilot-api-token"
      ],
      "description": "Authentication type",
      "title": "AuthInfoType",
      "x-enumDescriptions": {
        "hmac": "Authentication provided by a GitHub App HMAC credential.",
        "env": "Authentication resolved from environment-provided credentials.",
        "user": "Authentication from an interactive user sign-in.",
        "gh-cli": "Authentication delegated to the GitHub CLI.",
        "api-key": "Authentication from an API key credential.",
        "token": "Authentication from a GitHub token.",
        "token-provider": "Authentication from an SDK GitHub token callback.",
        "copilot-api-token": "Authentication from a Copilot API token."
      }
    },
    "AuthValidationError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Authentication validation error message"
        },
        "githubMessage": {
          "type": "string",
          "description": "Optional message returned by GitHub"
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Validation error from an authentication attempt.",
      "title": "AuthValidationError"
    },
    "AuthValidationErrors": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/AuthValidationError",
        "description": "Validation error from an authentication attempt."
      },
      "description": "Validation errors from the most recent authentication attempt.",
      "title": "AuthValidationErrors"
    },
    "AutoTier": {
      "type": "string",
      "enum": [
        "efficiency",
        "balance",
        "intelligence"
      ],
      "description": "Routing preference used when the session model is `auto`.",
      "title": "AutoTier",
      "x-enumDescriptions": {
        "efficiency": "Optimize for efficiency.",
        "balance": "Balance efficiency and intelligence.",
        "intelligence": "Optimize for intelligence."
      }
    },
    "BuiltInModelCatalog": {
      "type": "object",
      "properties": {
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BuiltInModelCatalogEntry",
            "description": "A well-known model in the runtime's built-in catalog."
          },
          "description": "Built-in model entries."
        }
      },
      "required": [
        "models"
      ],
      "additionalProperties": false,
      "description": "The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata.",
      "title": "BuiltInModelCatalog"
    },
    "BuiltInModelCatalogEntry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Well-known runtime model ID suitable for provider or provider-model metadata. This is not necessarily the provider-facing deployment or model name and does not indicate CAPI entitlement or provider availability."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "A well-known model in the runtime's built-in catalog.",
      "title": "BuiltInModelCatalogEntry"
    },
    "BuiltinToolDescriptor": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Stable name used to invoke the built-in tool."
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional human-readable title for the tool."
        },
        "description": {
          "type": "string",
          "description": "Model-facing description of the tool's behavior."
        },
        "inputSchema": {
          "anyOf": [
            {
              "$ref": "#/definitions/BuiltinToolInputSchema",
              "description": "JSON Schema object accepted by a built-in tool."
            },
            {
              "type": "null"
            }
          ],
          "description": "JSON Schema for the tool input, or null when the tool uses a custom format."
        },
        "instructions": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional supplemental usage instructions for the tool."
        },
        "type": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional tool category discriminator."
        },
        "format": {
          "anyOf": [
            {
              "$ref": "#/definitions/BuiltinToolFormat",
              "description": "Custom grammar input format accepted by a built-in tool."
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional custom input format used instead of a JSON Schema."
        },
        "safeForTelemetry": {
          "$ref": "#/definitions/BuiltinToolSafeForTelemetry",
          "description": "Policy describing which tool metadata may be recorded without obfuscation."
        },
        "isTerminal": {
          "type": "boolean",
          "description": "Whether the tool executes commands in a terminal."
        },
        "hasSummariseIntention": {
          "type": "boolean",
          "description": "Whether the tool provides a specialized intention summary."
        }
      },
      "required": [
        "name",
        "title",
        "description",
        "inputSchema",
        "instructions",
        "type",
        "format",
        "safeForTelemetry",
        "isTerminal",
        "hasSummariseIntention"
      ],
      "additionalProperties": false,
      "description": "Rust-owned metadata and input schema for a built-in tool.",
      "title": "BuiltinToolDescriptor",
      "stability": "experimental"
    },
    "BuiltinToolFormat": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/BuiltinToolFormatType",
          "description": "Custom input-format discriminator."
        },
        "syntax": {
          "type": "string",
          "description": "Grammar syntax used by the format definition."
        },
        "definition": {
          "type": "string",
          "description": "Grammar definition accepted by the tool."
        }
      },
      "required": [
        "type",
        "syntax",
        "definition"
      ],
      "additionalProperties": false,
      "description": "Custom grammar input format accepted by a built-in tool.",
      "stability": "experimental"
    },
    "BuiltinToolFormatType": {
      "type": "string",
      "enum": [
        "grammar"
      ],
      "description": "Custom input-format kind.",
      "x-enumDescriptions": {
        "grammar": "The tool input is parsed with the supplied grammar."
      },
      "stability": "experimental"
    },
    "BuiltinToolInputSchema": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/BuiltinToolInputSchemaType",
          "description": "Root type of the tool input schema."
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": {
        "x-opaque-json": true
      },
      "description": "JSON Schema object accepted by a built-in tool.",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "BuiltinToolInputSchemaType": {
      "type": "string",
      "enum": [
        "object"
      ],
      "description": "Root JSON Schema type for a built-in tool input.",
      "x-enumDescriptions": {
        "object": "The tool accepts a JSON object."
      },
      "stability": "experimental"
    },
    "BuiltinToolSafeForTelemetry": {
      "anyOf": [
        {
          "type": "boolean",
          "description": "Whether all tool metadata is telemetry-safe"
        },
        {
          "$ref": "#/definitions/BuiltinToolSafeTelemetryFields",
          "description": "Per-field telemetry safety"
        }
      ],
      "description": "Telemetry-safety policy for a built-in tool.",
      "title": "BuiltinToolSafeForTelemetry",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "BuiltinToolSafeTelemetryFields": {
      "type": "object",
      "properties": {
        "name": {
          "type": "boolean",
          "description": "Whether the tool name may be included in telemetry without obfuscation."
        },
        "inputsNames": {
          "type": "boolean",
          "description": "Whether tool input names may be included in telemetry without obfuscation."
        }
      },
      "additionalProperties": false,
      "description": "Per-field telemetry-safety policy for a built-in tool.",
      "stability": "experimental"
    },
    "CancelUserRequestedShellCommandResult": {
      "type": "object",
      "properties": {
        "cancelled": {
          "type": "boolean",
          "description": "Whether an in-flight execution was found and signalled to cancel"
        }
      },
      "required": [
        "cancelled"
      ],
      "additionalProperties": false,
      "description": "Cancellation result for a user-requested shell command.",
      "title": "CancelUserRequestedShellCommandResult"
    },
    "CanvasAction": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Action name exposed by the canvas provider"
        },
        "description": {
          "type": "string",
          "description": "Description of the action"
        },
        "inputSchema": {
          "$ref": "#/definitions/CanvasJsonSchema",
          "description": "JSON Schema for the action input"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool.",
      "title": "CanvasAction",
      "stability": "experimental"
    },
    "CanvasActionInvokeRequest": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "description": "Open canvas instance identifier"
        },
        "actionName": {
          "type": "string",
          "description": "Action name to invoke"
        },
        "input": {
          "description": "Action input",
          "x-opaque-json": true
        }
      },
      "required": [
        "instanceId",
        "actionName"
      ],
      "additionalProperties": false,
      "description": "Canvas action invocation parameters.",
      "title": "CanvasActionInvokeRequest",
      "stability": "experimental"
    },
    "CanvasActionInvokeResult": {
      "type": "object",
      "properties": {
        "result": {
          "description": "Provider-supplied action result",
          "x-opaque-json": true
        }
      },
      "additionalProperties": false,
      "description": "Canvas action invocation result.",
      "title": "CanvasActionInvokeResult",
      "stability": "experimental"
    },
    "CanvasCloseRequest": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "description": "Open canvas instance identifier"
        }
      },
      "required": [
        "instanceId"
      ],
      "additionalProperties": false,
      "description": "Canvas close parameters.",
      "title": "CanvasCloseRequest",
      "stability": "experimental"
    },
    "CanvasHostContext": {
      "type": "object",
      "properties": {
        "capabilities": {
          "$ref": "#/definitions/CanvasHostContextCapabilities",
          "description": "Host capabilities"
        }
      },
      "additionalProperties": false,
      "description": "Host context supplied by the runtime.",
      "title": "CanvasHostContext",
      "stability": "experimental"
    },
    "CanvasHostContextCapabilities": {
      "type": "object",
      "properties": {
        "canvases": {
          "type": "boolean",
          "description": "Whether canvas rendering is supported"
        }
      },
      "additionalProperties": false,
      "description": "Host capabilities",
      "title": "CanvasHostContextCapabilities",
      "stability": "experimental"
    },
    "CanvasJsonSchema": {
      "description": "JSON Schema for canvas open input",
      "title": "CanvasJsonSchema",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "CanvasList": {
      "type": "object",
      "properties": {
        "canvases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DiscoveredCanvas",
            "description": "Canvas available in the current session."
          },
          "description": "Declared canvases available in this session"
        }
      },
      "required": [
        "canvases"
      ],
      "additionalProperties": false,
      "description": "Declared canvases available in this session.",
      "title": "CanvasList",
      "stability": "experimental"
    },
    "CanvasListOpenResult": {
      "type": "object",
      "properties": {
        "openCanvases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OpenCanvasInstance",
            "description": "Open canvas instance snapshot."
          },
          "description": "Currently open canvas instances"
        }
      },
      "required": [
        "openCanvases"
      ],
      "additionalProperties": false,
      "description": "Live open-canvas snapshot.",
      "title": "CanvasListOpenResult",
      "stability": "experimental"
    },
    "CanvasOpenRequest": {
      "type": "object",
      "properties": {
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier. Optional when the canvasId is unique across providers; required to disambiguate when multiple providers register the same canvasId."
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "instanceId": {
          "type": "string",
          "description": "Caller-supplied stable instance identifier"
        },
        "input": {
          "description": "Canvas open input",
          "x-opaque-json": true
        }
      },
      "required": [
        "canvasId",
        "instanceId"
      ],
      "additionalProperties": false,
      "description": "Canvas open parameters.",
      "title": "CanvasOpenRequest",
      "stability": "experimental"
    },
    "CanvasProviderCloseRequest": {
      "type": "object",
      "properties": {
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "instanceId": {
          "type": "string",
          "description": "Canvas instance identifier"
        },
        "host": {
          "$ref": "#/definitions/CanvasHostContext",
          "description": "Host context supplied by the runtime."
        },
        "session": {
          "$ref": "#/definitions/CanvasSessionContext",
          "description": "Session context supplied by the runtime."
        }
      },
      "required": [
        "extensionId",
        "canvasId",
        "instanceId"
      ],
      "additionalProperties": false,
      "description": "Canvas close parameters sent to the provider.",
      "title": "CanvasProviderCloseRequest",
      "stability": "experimental"
    },
    "CanvasProviderInvokeActionRequest": {
      "type": "object",
      "properties": {
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "instanceId": {
          "type": "string",
          "description": "Canvas instance identifier"
        },
        "actionName": {
          "type": "string",
          "description": "Action name to invoke"
        },
        "input": {
          "description": "Action input",
          "x-opaque-json": true
        },
        "host": {
          "$ref": "#/definitions/CanvasHostContext",
          "description": "Host context supplied by the runtime."
        },
        "session": {
          "$ref": "#/definitions/CanvasSessionContext",
          "description": "Session context supplied by the runtime."
        }
      },
      "required": [
        "extensionId",
        "canvasId",
        "instanceId",
        "actionName"
      ],
      "additionalProperties": false,
      "description": "Canvas action invocation parameters sent to the provider.",
      "title": "CanvasProviderInvokeActionRequest",
      "stability": "experimental"
    },
    "CanvasProviderOpenRequest": {
      "type": "object",
      "properties": {
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "instanceId": {
          "type": "string",
          "description": "Stable caller-supplied canvas instance identifier"
        },
        "input": {
          "description": "Canvas open input",
          "x-opaque-json": true
        },
        "host": {
          "$ref": "#/definitions/CanvasHostContext",
          "description": "Host context supplied by the runtime."
        },
        "session": {
          "$ref": "#/definitions/CanvasSessionContext",
          "description": "Session context supplied by the runtime."
        }
      },
      "required": [
        "extensionId",
        "canvasId",
        "instanceId"
      ],
      "additionalProperties": false,
      "description": "Canvas open parameters sent to the provider.",
      "title": "CanvasProviderOpenRequest",
      "stability": "experimental"
    },
    "CanvasProviderOpenResult": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "URL for web-rendered canvases"
        },
        "title": {
          "type": "string",
          "description": "Provider-supplied title"
        },
        "status": {
          "type": "string",
          "description": "Provider-supplied status text"
        }
      },
      "additionalProperties": false,
      "description": "Canvas open result returned by the provider.",
      "title": "CanvasProviderOpenResult",
      "stability": "experimental"
    },
    "CanvasProviderRegisterRequest": {
      "type": "object",
      "properties": {
        "connectionId": {
          "type": "string",
          "description": "Connection identifier for callback routing"
        },
        "info": {
          "description": "Provider metadata supplied by the host",
          "x-opaque-json": true
        },
        "canvases": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          },
          "description": "Canvas contributions supplied by the provider"
        }
      },
      "required": [
        "connectionId",
        "info",
        "canvases"
      ],
      "additionalProperties": false,
      "description": "Internal canvas provider registration parameters.",
      "title": "CanvasProviderRegisterRequest",
      "stability": "experimental"
    },
    "CanvasProviderUnregisterRequest": {
      "type": "object",
      "properties": {
        "connectionId": {
          "type": "string",
          "description": "Connection identifier to unregister"
        }
      },
      "required": [
        "connectionId"
      ],
      "additionalProperties": false,
      "description": "Internal canvas provider unregistration parameters.",
      "title": "CanvasProviderUnregisterRequest",
      "stability": "experimental"
    },
    "CanvasSessionContext": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Active session working directory, when known."
        }
      },
      "additionalProperties": false,
      "description": "Session context supplied by the runtime.",
      "title": "CanvasSessionContext",
      "stability": "experimental"
    },
    "CapiSessionOptions": {
      "type": "object",
      "properties": {
        "autoTier": {
          "$ref": "#/definitions/AutoTier",
          "description": "Routing preference used when the session model is `auto`. The runtime persists the preference across cold resume. When omitted, the default routing behavior is used. Resuming an already-resident session cannot change its preference."
        },
        "enableWebSocketResponses": {
          "type": "boolean",
          "description": "Whether to use WebSocket transport for the CAPI Responses API. Enabled by default when the model advertises `ws:/responses` support; set to `false` to force the HTTP Responses transport in environments where WebSockets are blocked (e.g. behind a proxy). Setting this to `false` is equivalent to the `COPILOT_CLI_DISABLE_WEBSOCKET_RESPONSES` environment variable."
        }
      },
      "additionalProperties": false,
      "description": "Options scoped to the built-in CAPI (Copilot API) provider.",
      "title": "CapiSessionOptions"
    },
    "CardDigest": {
      "type": "object",
      "properties": {
        "algorithm": {
          "$ref": "#/definitions/CardDigestAlgorithm",
          "const": "sha256-rfc8785",
          "description": "Digest algorithm and canonical representation"
        },
        "value": {
          "$ref": "#/definitions/CardDigestValue",
          "minLength": 64,
          "maxLength": 64,
          "pattern": "^[0-9a-f]{64}$",
          "description": "SHA-256 digest of the RFC 8785 canonical UTF-8 bytes, encoded as exactly 64 lowercase hexadecimal characters."
        }
      },
      "required": [
        "algorithm",
        "value"
      ],
      "additionalProperties": false,
      "description": "Semantic digest of a strictly parsed and schema-validated JSON MCP card. Both URL-backed and embedded cards are canonicalised with RFC 8785 JSON Canonicalization Scheme, encoded as UTF-8, and hashed with SHA-256.",
      "title": "CardDigest"
    },
    "CardDigestAlgorithm": {
      "type": "string",
      "enum": [
        "sha256-rfc8785"
      ],
      "description": "Canonical digest algorithm for a validated MCP card",
      "title": "CardDigestAlgorithm",
      "x-enumDescriptions": {
        "sha256-rfc8785": "SHA-256 over RFC 8785 canonical JSON encoded as UTF-8."
      }
    },
    "CardDigestValue": {
      "type": "string",
      "minLength": 64,
      "maxLength": 64,
      "pattern": "^[0-9a-f]{64}$",
      "description": "SHA-256 digest encoded as exactly 64 lowercase hexadecimal characters.",
      "title": "CardDigestValue"
    },
    "CatalogAiSkillCandidate": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "minLength": 1,
          "description": "Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged."
        },
        "handleExpiresAt": {
          "type": "string",
          "description": "ISO 8601 timestamp after which the handle is stale and will be rejected."
        },
        "kind": {
          "type": "string",
          "const": "ai-skill",
          "description": "Discriminator: this candidate describes an AI skill"
        },
        "mediaType": {
          "type": "string",
          "const": "application/ai-skill",
          "description": "Media type of the underlying AI skill card"
        },
        "installability": {
          "type": "string",
          "const": "not-installable-kind",
          "description": "AI skills are discovery-only and cannot be installed through this surface"
        },
        "displayName": {
          "type": "string",
          "maxLength": 200,
          "description": "Display name taken verbatim from the card. Inert untrusted text."
        },
        "description": {
          "type": "string",
          "maxLength": 1000,
          "description": "Description taken verbatim from the card. Inert untrusted text."
        },
        "publisher": {
          "type": "string",
          "maxLength": 200,
          "description": "Publisher taken verbatim from the card. Inert untrusted text."
        },
        "source": {
          "$ref": "#/definitions/CatalogCandidateSource",
          "description": "Where the card came from: exactly one of a URL or embedded data, encoded as a tagged union so neither both nor neither can be represented."
        },
        "provenance": {
          "$ref": "#/definitions/CatalogAiSkillCandidateProvenance",
          "description": "Where the catalog reference was observed, without the card itself or any content digest."
        }
      },
      "required": [
        "handle",
        "handleExpiresAt",
        "kind",
        "mediaType",
        "installability",
        "displayName",
        "source",
        "provenance"
      ],
      "additionalProperties": false,
      "description": "An inert AI skill catalog result. AI skills are discovery-only and cannot be represented as installable through this surface.",
      "title": "CatalogAiSkillCandidate"
    },
    "CatalogAiSkillCandidateProvenance": {
      "type": "object",
      "properties": {
        "authority": {
          "type": "string",
          "minLength": 1,
          "description": "Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data."
        },
        "observedAt": {
          "type": "string",
          "description": "ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp."
        },
        "mediaType": {
          "type": "string",
          "const": "application/ai-skill",
          "description": "Media type advertised for the referenced AI skill card"
        }
      },
      "required": [
        "authority",
        "observedAt",
        "mediaType"
      ],
      "additionalProperties": false,
      "description": "Where and when an AI skill catalog reference was observed. Discovery provenance deliberately carries no content digest because search does not establish the exact validated content a later plan will bind.",
      "title": "CatalogAiSkillCandidateProvenance"
    },
    "CatalogAuthenticationRequiredError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "authentication-required",
          "description": "Discriminator: the caller is not authenticated"
        },
        "reason": {
          "$ref": "#/definitions/CatalogAuthenticationRequiredReason",
          "description": "Why authentication failed. Only an expired credential justifies attempting a silent refresh; an absent or rejected credential requires sign-in."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a credential or token, nor a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "An optional catalog authentication exchange did not establish the caller's identity. Anonymous search remains supported; this refusal is reserved for an operation that cannot continue after the attempted exchange. It is distinct from `policy-rejected` and from a network failure, and the reason identifies the recovery action.",
      "title": "CatalogAuthenticationRequiredError"
    },
    "CatalogAuthenticationRequiredReason": {
      "type": "string",
      "enum": [
        "no-credential",
        "credential-expired",
        "credential-rejected"
      ],
      "description": "Why the catalog authority did not accept the caller's identity",
      "title": "CatalogAuthenticationRequiredReason",
      "x-enumDescriptions": {
        "no-credential": "No credential was presented, so there is nothing to refresh and the caller must sign in.",
        "credential-expired": "A credential was presented and its lifetime has elapsed. A silent refresh is worth attempting before prompting anyone.",
        "credential-rejected": "A credential was presented and the authority refused it, for example because it was revoked, malformed, or issued for another audience. Refreshing the same rejected credential is not useful; the caller must sign in again."
      }
    },
    "CatalogCandidate": {
      "anyOf": [
        {
          "$ref": "#/definitions/CatalogMcpServerCandidate",
          "description": "An inert MCP server catalog result. Every free-text field is untrusted external data and must never be treated as an instruction, and the handle is the only way to refer to the candidate in a later operation."
        },
        {
          "$ref": "#/definitions/CatalogAiSkillCandidate",
          "description": "An inert AI skill catalog result. AI skills are discovery-only and cannot be represented as installable through this surface."
        }
      ],
      "description": "One inert catalog result, represented as an MCP server or discovery-only AI skill variant so kind, media type, provenance, and installability cannot contradict each other.",
      "title": "CatalogCandidate"
    },
    "CatalogCandidateKind": {
      "type": "string",
      "enum": [
        "mcp-server",
        "ai-skill"
      ],
      "description": "What kind of resource a catalog candidate describes",
      "title": "CatalogCandidateKind",
      "x-enumDescriptions": {
        "mcp-server": "An MCP server, which can be planned for installation.",
        "ai-skill": "An AI skill, which is discoverable but not installable through this surface."
      }
    },
    "CatalogCandidateSource": {
      "anyOf": [
        {
          "$ref": "#/definitions/CatalogCandidateSourceUrl",
          "description": "Candidate whose card is retrieved from a URL through the runtime's hardened fetch boundary."
        },
        {
          "$ref": "#/definitions/CatalogCandidateSourceEmbedded",
          "description": "Candidate whose card reference arrived inline. The document and its content-derived properties stay behind the runtime boundary."
        }
      ],
      "description": "Where a candidate's card came from. Exactly one of a URL or embedded data: the union has no variant carrying both, and no variant carrying neither, so the rule holds structurally rather than by validation.",
      "title": "CatalogCandidateSource"
    },
    "CatalogCandidateSourceEmbedded": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "embedded",
          "description": "Discriminator: the card is embedded, and carries no URL"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Candidate whose card reference arrived inline. The document and its content-derived properties stay behind the runtime boundary.",
      "title": "CatalogCandidateSourceEmbedded"
    },
    "CatalogCandidateSourceUrl": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "url",
          "description": "Discriminator: the card is URL-backed, and carries no embedded data"
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "description": "Card URL as advertised. Inert untrusted data: the runtime retrieves it only through its own hardened boundary, and it is never logged."
        }
      },
      "required": [
        "kind",
        "url"
      ],
      "additionalProperties": false,
      "description": "Candidate whose card is retrieved from a URL through the runtime's hardened fetch boundary.",
      "title": "CatalogCandidateSourceUrl"
    },
    "CatalogCapability": {
      "type": "string",
      "enum": [
        "mcp-server-card",
        "legacy-mcp-server-card",
        "ai-skill-discovery",
        "mcp-install-planning",
        "multiple-transport-choice"
      ],
      "description": "A wire feature a caller can require of the catalog surface, negotiated per request. A grant means the runtime understands the feature's contract, not that the deployment has enabled the operation; typed unavailable results report availability separately.",
      "title": "CatalogCapability",
      "x-enumDescriptions": {
        "mcp-server-card": "Understands the current `application/mcp-server-card+json` media type.",
        "legacy-mcp-server-card": "Understands the legacy `application/mcp-server+json` media type.",
        "ai-skill-discovery": "Understands `application/ai-skill` candidates as discovery-only and typed non-installable.",
        "mcp-install-planning": "Understands side-effect-free MCP install-plan requests, results, and plan handles; `planning-unavailable` separately reports that planning is not enabled.",
        "multiple-transport-choice": "Understands plans that enumerate every eligible transport rather than a single preferred one."
      }
    },
    "CatalogCapabilityId": {
      "type": "string",
      "minLength": 1,
      "maxLength": 64,
      "pattern": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$",
      "description": "Bounded extensible wire-feature identifier. Known values are described by `CatalogCapability`; newer callers may send future identifiers so an older runtime can return a typed negotiation refusal instead of failing schema validation. Capability negotiation establishes contract understanding, while each operation's result separately reports runtime availability.",
      "title": "CatalogCapabilityId"
    },
    "CatalogClientContract": {
      "type": "object",
      "properties": {
        "protocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 4294967295,
          "description": "SDK protocol version the caller was generated against. A caller below the runtime's minimum supported version is refused rather than served a partial result."
        },
        "requiredCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCapabilityId",
            "description": "Bounded extensible wire-feature identifier. Known values are described by `CatalogCapability`; newer callers may send future identifiers so an older runtime can return a typed negotiation refusal instead of failing schema validation. Capability negotiation establishes contract understanding, while each operation's result separately reports runtime availability."
          },
          "maxItems": 32,
          "uniqueItems": true,
          "description": "Wire features the caller requires the runtime to understand. Identifiers are bounded but extensible so a newer caller can negotiate with an older runtime. Requiring an unknown feature yields a typed refusal listing what is understood, never a partial grant. A grant does not promise that a deployment has enabled the operation; typed unavailable results report that separately."
        }
      },
      "required": [
        "protocolVersion",
        "requiredCapabilities"
      ],
      "additionalProperties": false,
      "description": "The protocol version and capability set a caller requires, supplied on every catalog request so negotiation cannot be skipped by omission.",
      "title": "CatalogClientContract"
    },
    "CatalogContractViolationError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "contract-violation",
          "description": "Discriminator: the upstream response broke the contract"
        },
        "reason": {
          "$ref": "#/definitions/CatalogContractViolationReason",
          "description": "Which rule the response broke."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never echoes response content, nor a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "An upstream catalog response broke the wire contract. Most importantly, every result must carry exactly one of a URL or embedded data: a result carrying both, or neither, is refused here rather than being guessed at.",
      "title": "CatalogContractViolationError"
    },
    "CatalogContractViolationReason": {
      "type": "string",
      "enum": [
        "both-url-and-data",
        "neither-url-nor-data",
        "duplicate-identity",
        "unknown-media-type"
      ],
      "description": "Which wire-contract rule an upstream response broke",
      "title": "CatalogContractViolationReason",
      "x-enumDescriptions": {
        "both-url-and-data": "A result carried both a URL and embedded data, when exactly one is permitted.",
        "neither-url-nor-data": "A result carried neither a URL nor embedded data, when exactly one is required.",
        "duplicate-identity": "Two results claimed the same normalised identity.",
        "unknown-media-type": "A result declared no media type, or one this contract does not model."
      }
    },
    "CatalogHandleRejectedError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "handle-rejected",
          "description": "Discriminator: a handle was rejected"
        },
        "handleType": {
          "$ref": "#/definitions/CatalogHandleType",
          "description": "Which kind of handle was presented."
        },
        "reason": {
          "$ref": "#/definitions/CatalogHandleRejectionReason",
          "description": "Why the handle was rejected."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains the handle itself, nor a query, URL, or secret."
        }
      },
      "required": [
        "kind",
        "handleType",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "A presented handle was not accepted. Handles are runtime-instance scoped, TTL-bound, and single-use, so each way of failing is reported distinctly.",
      "title": "CatalogHandleRejectedError"
    },
    "CatalogHandleRejectionReason": {
      "type": "string",
      "enum": [
        "invalid",
        "stale",
        "replayed",
        "foreign"
      ],
      "description": "Why a presented handle was rejected",
      "title": "CatalogHandleRejectionReason",
      "x-enumDescriptions": {
        "invalid": "The handle is unparseable, unknown, or was issued for a different operation.",
        "stale": "The handle's time to live has elapsed.",
        "replayed": "The handle has already been used, and handles are single-use.",
        "foreign": "The handle was issued by a different runtime instance."
      }
    },
    "CatalogHandleType": {
      "type": "string",
      "enum": [
        "candidate",
        "plan"
      ],
      "description": "Which kind of opaque handle was presented",
      "title": "CatalogHandleType",
      "x-enumDescriptions": {
        "candidate": "A search candidate handle.",
        "plan": "An install plan handle."
      }
    },
    "CatalogInvalidRequestError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "invalid-request",
          "description": "Discriminator: the request itself was invalid"
        },
        "field": {
          "$ref": "#/definitions/CatalogInvalidRequestField",
          "description": "Which request field was rejected."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never echoes the offending value, nor a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "field",
        "message"
      ],
      "additionalProperties": false,
      "description": "The request was rejected before any work was done, because a bounded field fell outside its permitted range or a required field was unusable.",
      "title": "CatalogInvalidRequestError"
    },
    "CatalogInvalidRequestField": {
      "type": "string",
      "enum": [
        "query",
        "limit",
        "kinds",
        "contract",
        "source",
        "card",
        "scope"
      ],
      "description": "Which request field was rejected before any work was done",
      "title": "CatalogInvalidRequestField",
      "x-enumDescriptions": {
        "query": "The search query was empty or longer than permitted.",
        "limit": "The requested result count fell outside its permitted range.",
        "kinds": "The requested candidate kinds were empty or contained a duplicate.",
        "contract": "The negotiation block was missing or malformed.",
        "source": "The plan source was missing or malformed.",
        "card": "The supplied card was missing its media type, URL, or data.",
        "scope": "The requested configuration scope is not one this runtime writes."
      }
    },
    "CatalogMalformedCardError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "malformed-card",
          "description": "Discriminator: the card was malformed"
        },
        "reason": {
          "$ref": "#/definitions/CatalogMalformedCardReason",
          "description": "How the card failed validation."
        },
        "mediaType": {
          "$ref": "#/definitions/CatalogMediaType",
          "description": "Media type the card was interpreted as, when it declared one this runtime recognises."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never echoes card content, nor a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "A card could not be parsed or did not satisfy its declared media type's schema.",
      "title": "CatalogMalformedCardError"
    },
    "CatalogMalformedCardReason": {
      "type": "string",
      "enum": [
        "invalid-json",
        "schema-violation",
        "unsupported-media-type",
        "missing-required-field",
        "size-limit-exceeded"
      ],
      "description": "How a card failed validation",
      "title": "CatalogMalformedCardReason",
      "x-enumDescriptions": {
        "invalid-json": "The document is not well-formed JSON.",
        "schema-violation": "The document does not satisfy its media type's schema.",
        "unsupported-media-type": "The declared media type is not one this runtime understands.",
        "missing-required-field": "A field the media type requires is absent.",
        "size-limit-exceeded": "The document exceeded the permitted size."
      }
    },
    "CatalogMcpServerCandidate": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "minLength": 1,
          "description": "Opaque, runtime-instance scoped, TTL-bound, single-use handle for this candidate. Carries no readable information and is rejected when stale, replayed, or presented to a different runtime instance. Never logged."
        },
        "handleExpiresAt": {
          "type": "string",
          "description": "ISO 8601 timestamp after which the handle is stale and will be rejected."
        },
        "kind": {
          "type": "string",
          "const": "mcp-server",
          "description": "Discriminator: this candidate describes an MCP server"
        },
        "mediaType": {
          "$ref": "#/definitions/McpServerCardMediaType",
          "description": "JSON MCP media type of the underlying card."
        },
        "installability": {
          "$ref": "#/definitions/CatalogMcpServerInstallability",
          "description": "Whether this MCP server can be planned for installation, and if policy prevents it."
        },
        "displayName": {
          "type": "string",
          "maxLength": 200,
          "description": "Display name taken verbatim from the card. Inert untrusted text."
        },
        "description": {
          "type": "string",
          "maxLength": 1000,
          "description": "Description taken verbatim from the card. Inert untrusted text."
        },
        "publisher": {
          "type": "string",
          "maxLength": 200,
          "description": "Publisher taken verbatim from the card. Inert untrusted text."
        },
        "source": {
          "$ref": "#/definitions/CatalogCandidateSource",
          "description": "Where the card came from: exactly one of a URL or embedded data, encoded as a tagged union so neither both nor neither can be represented."
        },
        "provenance": {
          "$ref": "#/definitions/CatalogMcpServerCandidateProvenance",
          "description": "Where the catalog reference was observed, without the card itself or any content digest."
        }
      },
      "required": [
        "handle",
        "handleExpiresAt",
        "kind",
        "mediaType",
        "installability",
        "displayName",
        "source",
        "provenance"
      ],
      "additionalProperties": false,
      "description": "An inert MCP server catalog result. Every free-text field is untrusted external data and must never be treated as an instruction, and the handle is the only way to refer to the candidate in a later operation.",
      "title": "CatalogMcpServerCandidate"
    },
    "CatalogMcpServerCandidateProvenance": {
      "type": "object",
      "properties": {
        "authority": {
          "type": "string",
          "minLength": 1,
          "description": "Host of the catalog authority that advertised the reference, without path, query, or credentials. Inert untrusted data."
        },
        "observedAt": {
          "type": "string",
          "description": "ISO 8601 timestamp at which the runtime observed the catalog reference. This is not a retrieval or validation timestamp."
        },
        "mediaType": {
          "$ref": "#/definitions/McpServerCardMediaType",
          "description": "JSON MCP media type advertised for the referenced card."
        }
      },
      "required": [
        "authority",
        "observedAt",
        "mediaType"
      ],
      "additionalProperties": false,
      "description": "Where and when an MCP server catalog reference was observed. Discovery provenance deliberately carries no content digest because search does not establish the exact validated content a later plan will bind.",
      "title": "CatalogMcpServerCandidateProvenance"
    },
    "CatalogMcpServerInstallability": {
      "type": "string",
      "enum": [
        "installable",
        "not-installable-policy"
      ],
      "description": "Whether an MCP server candidate can be planned for installation",
      "title": "CatalogMcpServerInstallability",
      "x-enumDescriptions": {
        "installable": "An install plan can be computed for this MCP server candidate.",
        "not-installable-policy": "Policy forbids installing this MCP server candidate."
      }
    },
    "CatalogMediaType": {
      "type": "string",
      "enum": [
        "application/mcp-server-card+json",
        "application/mcp-server+json",
        "application/ai-skill"
      ],
      "description": "Media type a catalog card is interpreted as",
      "title": "CatalogMediaType",
      "x-enumDescriptions": {
        "application/mcp-server-card+json": "The current MCP server card media type.",
        "application/mcp-server+json": "The legacy MCP server card media type, accepted for compatibility.",
        "application/ai-skill": "An AI skill card. Representable and searchable, but typed non-installable."
      }
    },
    "CatalogNegotiatedContract": {
      "type": "object",
      "properties": {
        "runtimeProtocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Protocol version of the runtime that served the request."
        },
        "grantedCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCapability",
            "description": "A wire feature a caller can require of the catalog surface, negotiated per request. A grant means the runtime understands the feature's contract, not that the deployment has enabled the operation; typed unavailable results report availability separately."
          },
          "description": "Wire features the runtime understood for this operation. Always a superset of the caller's required features, because any shortfall is a refusal instead. Operation availability remains a separate typed result."
        }
      },
      "required": [
        "runtimeProtocolVersion",
        "grantedCapabilities"
      ],
      "additionalProperties": false,
      "description": "The protocol version and capability set the runtime actually honoured for a successful catalog operation.",
      "title": "CatalogNegotiatedContract"
    },
    "CatalogNegotiationRefusedError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "negotiation-refused",
          "description": "Discriminator: capability or protocol-version negotiation failed"
        },
        "reason": {
          "$ref": "#/definitions/CatalogNegotiationRefusedReason",
          "description": "Whether the version or the capability set was the problem."
        },
        "runtimeProtocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Protocol version of the runtime that refused the request."
        },
        "minimumSupportedProtocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Lowest caller protocol version this runtime will serve."
        },
        "supportedCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCapability",
            "description": "A wire feature a caller can require of the catalog surface, negotiated per request. A grant means the runtime understands the feature's contract, not that the deployment has enabled the operation; typed unavailable results report availability separately."
          },
          "description": "Every wire feature this runtime understands, so the caller can retry within that contract. This list does not imply that every deployment has enabled every operation."
        },
        "unsupportedCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCapabilityId",
            "description": "Bounded extensible wire-feature identifier. Known values are described by `CatalogCapability`; newer callers may send future identifiers so an older runtime can return a typed negotiation refusal instead of failing schema validation. Capability negotiation establishes contract understanding, while each operation's result separately reports runtime availability."
          },
          "maxItems": 32,
          "uniqueItems": true,
          "description": "The subset of the caller's bounded extensible capability identifiers this runtime cannot honour."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "runtimeProtocolVersion",
        "minimumSupportedProtocolVersion",
        "supportedCapabilities",
        "unsupportedCapabilities",
        "message"
      ],
      "additionalProperties": false,
      "description": "The caller's protocol version or required capabilities cannot be honoured. Returned instead of a partial or ambiguous success.",
      "title": "CatalogNegotiationRefusedError"
    },
    "CatalogNegotiationRefusedReason": {
      "type": "string",
      "enum": [
        "unsupported-protocol-version",
        "unsupported-capability"
      ],
      "description": "Why capability and protocol-version negotiation refused a caller",
      "title": "CatalogNegotiationRefusedReason",
      "x-enumDescriptions": {
        "unsupported-protocol-version": "The caller's protocol version is below the lowest this runtime serves.",
        "unsupported-capability": "The caller requires at least one capability this runtime cannot honour."
      }
    },
    "CatalogNetworkFailureError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "network-failure",
          "description": "Discriminator: the network operation failed"
        },
        "reason": {
          "$ref": "#/definitions/CatalogNetworkFailureReason",
          "description": "Categorised failure, low cardinality so it can be aggregated without carrying a URL."
        },
        "statusCode": {
          "type": "integer",
          "minimum": 100,
          "maximum": 599,
          "description": "HTTP status code, when the failure was a rejected response."
        },
        "retryAfterSeconds": {
          "type": "integer",
          "minimum": 1,
          "maximum": 300,
          "format": "duration",
          "description": "Bounded cooldown in seconds before another catalog request should be attempted, when the authority supplied a numeric Retry-After value or the runtime applied its documented fallback."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "The runtime could not reach the catalog authority or retrieve a card. Covers being offline as well as transport-level failure.",
      "title": "CatalogNetworkFailureError"
    },
    "CatalogNetworkFailureReason": {
      "type": "string",
      "enum": [
        "offline",
        "dns",
        "timeout",
        "tls",
        "connection-refused",
        "proxy-authentication-required",
        "rate-limited",
        "service-unavailable",
        "http-status",
        "response-too-large",
        "redirect-rejected"
      ],
      "description": "Categorised network failure, low cardinality so it can be aggregated without carrying a URL",
      "title": "CatalogNetworkFailureReason",
      "x-enumDescriptions": {
        "offline": "No network is available, so nothing was attempted.",
        "dns": "The authority's name could not be resolved.",
        "timeout": "The request exceeded its time budget.",
        "tls": "The TLS handshake or certificate validation failed.",
        "connection-refused": "The connection was refused or reset.",
        "proxy-authentication-required": "The configured proxy returned 407 and requires authentication.",
        "rate-limited": "The authority rate-limited requests and supplied or implied a bounded cooldown.",
        "service-unavailable": "The authority returned a transient 5xx response.",
        "http-status": "The authority returned another status the runtime treats as a failure.",
        "response-too-large": "The response exceeded the permitted size.",
        "redirect-rejected": "A redirect was refused by the runtime's redirect policy."
      }
    },
    "CatalogNotInstallableError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "not-installable",
          "description": "Discriminator: the candidate cannot be installed"
        },
        "reason": {
          "$ref": "#/definitions/CatalogNotInstallableReason",
          "description": "Why the candidate cannot be installed."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "The candidate is discoverable but cannot be installed. `application/ai-skill` resolves here, because it stays searchable while remaining typed non-installable.",
      "title": "CatalogNotInstallableError"
    },
    "CatalogNotInstallableReason": {
      "type": "string",
      "enum": [
        "kind-not-installable",
        "ai-skill-not-installable",
        "policy-forbids"
      ],
      "description": "Why a discoverable candidate cannot be installed",
      "title": "CatalogNotInstallableReason",
      "x-enumDescriptions": {
        "kind-not-installable": "This kind of resource is not installable through this surface.",
        "ai-skill-not-installable": "AI skills are discoverable but have no typed importer in this phase.",
        "policy-forbids": "Policy forbids installing this candidate."
      }
    },
    "CatalogPolicyRejectedError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "policy-rejected",
          "description": "Discriminator: policy refused the operation"
        },
        "source": {
          "$ref": "#/definitions/McpPlanPolicySource",
          "description": "Which authority produced the decision."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "source",
        "message"
      ],
      "additionalProperties": false,
      "description": "Registry or enterprise policy refused the operation.",
      "title": "CatalogPolicyRejectedError"
    },
    "CatalogSearchRequest": {
      "type": "object",
      "properties": {
        "contract": {
          "$ref": "#/definitions/CatalogClientContract",
          "description": "Protocol version and capabilities the caller requires."
        },
        "query": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "pattern": "\\S",
          "description": "Free-text search query. Persisted as tool input for session continuity, but omitted from telemetry."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50,
          "default": 10,
          "description": "Maximum number of candidates to return. Defaults to 10 when omitted."
        },
        "kinds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCandidateKind",
            "description": "What kind of resource a catalog candidate describes"
          },
          "minItems": 1,
          "maxItems": 2,
          "uniqueItems": true,
          "description": "Restrict results to these candidate kinds. When omitted, every kind the runtime supports is searched."
        }
      },
      "required": [
        "contract",
        "query"
      ],
      "additionalProperties": false,
      "description": "A bounded catalog search. Both the query length and the result count are capped by the schema so a caller cannot request an unbounded scan.",
      "title": "CatalogSearchRequest"
    },
    "CatalogSearchResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/CatalogSearchSucceeded",
          "description": "A completed catalog search: inert candidate summaries, each carrying a single-use handle."
        },
        {
          "$ref": "#/definitions/CatalogNegotiationRefusedError",
          "description": "The caller's protocol version or required capabilities cannot be honoured. Returned instead of a partial or ambiguous success."
        },
        {
          "$ref": "#/definitions/CatalogUnsupportedKindError",
          "description": "The request asked for a candidate kind this runtime does not serve."
        },
        {
          "$ref": "#/definitions/CatalogInvalidRequestError",
          "description": "The request was rejected before any work was done, because a bounded field fell outside its permitted range or a required field was unusable."
        },
        {
          "$ref": "#/definitions/CatalogAuthenticationRequiredError",
          "description": "An optional catalog authentication exchange did not establish the caller's identity. Anonymous search remains supported; this refusal is reserved for an operation that cannot continue after the attempted exchange. It is distinct from `policy-rejected` and from a network failure, and the reason identifies the recovery action."
        },
        {
          "$ref": "#/definitions/CatalogPolicyRejectedError",
          "description": "Registry or enterprise policy refused the operation."
        },
        {
          "$ref": "#/definitions/CatalogNetworkFailureError",
          "description": "The runtime could not reach the catalog authority or retrieve a card. Covers being offline as well as transport-level failure."
        },
        {
          "$ref": "#/definitions/CatalogUnsafeRetrievalError",
          "description": "Retrieval was refused by the runtime's hardened fetch boundary before any request left the process, or before a redirect was followed."
        },
        {
          "$ref": "#/definitions/CatalogMalformedCardError",
          "description": "A card could not be parsed or did not satisfy its declared media type's schema."
        },
        {
          "$ref": "#/definitions/CatalogContractViolationError",
          "description": "An upstream catalog response broke the wire contract. Most importantly, every result must carry exactly one of a URL or embedded data: a result carrying both, or neither, is refused here rather than being guessed at."
        },
        {
          "$ref": "#/definitions/CatalogUnavailableError",
          "description": "The operation is not available on this runtime. Distinct from a network failure: nothing was attempted."
        }
      ],
      "description": "Outcome of a catalog.search call: either bounded inert candidates, or one typed refusal. Never a partial success.",
      "title": "CatalogSearchResult"
    },
    "CatalogSearchSucceeded": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "succeeded",
          "description": "Discriminator: the search completed"
        },
        "searchId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "description": "Pseudonymous identifier for this search, issued by the runtime or by the catalog authority it queried and never by the caller, so it cannot be forged or replayed to attribute an install to a search that never happened. Always present on a success, so a result set can be tied to the installs it leads to. It identifies a search rather than a person: it is derived from no user, account, device, or query data, and must never be joined with user identity to re-identify anyone."
        },
        "candidates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCandidate",
            "description": "One inert catalog result, represented as an MCP server or discovery-only AI skill variant so kind, media type, provenance, and installability cannot contradict each other."
          },
          "maxItems": 50,
          "description": "Matching candidates, never more than the requested limit. All text is inert untrusted data."
        },
        "truncated": {
          "type": "boolean",
          "description": "Whether further matches existed beyond the requested limit."
        },
        "negotiated": {
          "$ref": "#/definitions/CatalogNegotiatedContract",
          "description": "Protocol version and capabilities the runtime honoured."
        }
      },
      "required": [
        "kind",
        "searchId",
        "candidates",
        "truncated",
        "negotiated"
      ],
      "additionalProperties": false,
      "description": "A completed catalog search: inert candidate summaries, each carrying a single-use handle.",
      "title": "CatalogSearchSucceeded"
    },
    "CatalogUnavailableError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "unavailable",
          "description": "Discriminator: the operation is not available"
        },
        "reason": {
          "$ref": "#/definitions/CatalogUnavailableReason",
          "description": "Why the operation is unavailable."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "The operation is not available on this runtime. Distinct from a network failure: nothing was attempted.",
      "title": "CatalogUnavailableError"
    },
    "CatalogUnavailableReason": {
      "type": "string",
      "enum": [
        "search-unavailable",
        "planning-unavailable",
        "authority-not-configured",
        "disabled-by-policy"
      ],
      "description": "Why a catalog operation is not available on this runtime",
      "title": "CatalogUnavailableReason",
      "x-enumDescriptions": {
        "search-unavailable": "Bounded search is not wired up on this runtime build.",
        "planning-unavailable": "Install planning is not wired up on this runtime build.",
        "authority-not-configured": "No catalog authority is configured for this runtime.",
        "disabled-by-policy": "The surface is disabled by policy on this runtime."
      }
    },
    "CatalogUnavailableTransportError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "unavailable-transport",
          "description": "Discriminator: no usable transport is available"
        },
        "reason": {
          "$ref": "#/definitions/CatalogUnavailableTransportReason",
          "description": "Why no transport could be offered."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "No transport this runtime can use is available for the requested server.",
      "title": "CatalogUnavailableTransportError"
    },
    "CatalogUnavailableTransportReason": {
      "type": "string",
      "enum": [
        "no-eligible-transport",
        "transport-not-supported",
        "remote-enumeration-unavailable"
      ],
      "description": "Why no usable transport could be offered",
      "title": "CatalogUnavailableTransportReason",
      "x-enumDescriptions": {
        "no-eligible-transport": "The card advertises no transport this runtime can use.",
        "transport-not-supported": "Every advertised transport is of a kind this runtime does not implement.",
        "remote-enumeration-unavailable": "Eligible remotes could not be enumerated, so no explicit choice can be offered."
      }
    },
    "CatalogUnsafeRetrievalError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "unsafe-retrieval",
          "description": "Discriminator: retrieval was refused as unsafe"
        },
        "reason": {
          "$ref": "#/definitions/CatalogUnsafeRetrievalReason",
          "description": "Which control refused the retrieval, low cardinality so it can be aggregated without carrying a URL."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains the refused URL, nor a query, handle, or secret."
        }
      },
      "required": [
        "kind",
        "reason",
        "message"
      ],
      "additionalProperties": false,
      "description": "Retrieval was refused by the runtime's hardened fetch boundary before any request left the process, or before a redirect was followed.",
      "title": "CatalogUnsafeRetrievalError"
    },
    "CatalogUnsafeRetrievalReason": {
      "type": "string",
      "enum": [
        "blocked-scheme",
        "credentials-in-url",
        "blocked-address",
        "redirect-to-blocked-address",
        "proxy-rejected",
        "host-not-permitted"
      ],
      "description": "Which hardened-fetch control refused a retrieval",
      "title": "CatalogUnsafeRetrievalReason",
      "x-enumDescriptions": {
        "blocked-scheme": "The URL used a scheme the runtime refuses to fetch.",
        "credentials-in-url": "The URL embedded credentials.",
        "blocked-address": "The URL resolved to a loopback, private, link-local, or cloud metadata address.",
        "redirect-to-blocked-address": "A redirect target resolved to a blocked address.",
        "proxy-rejected": "The configured proxy policy refused the request.",
        "host-not-permitted": "The authority is not permitted for card retrieval."
      }
    },
    "CatalogUnsupportedKindError": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "unsupported-kind",
          "description": "Discriminator: an unsupported candidate kind was requested"
        },
        "requestedKinds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCandidateKind",
            "description": "What kind of resource a catalog candidate describes"
          },
          "description": "The kinds from the request that are not supported."
        },
        "supportedKinds": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CatalogCandidateKind",
            "description": "What kind of resource a catalog candidate describes"
          },
          "description": "Every candidate kind this runtime can serve."
        },
        "message": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "kind",
        "requestedKinds",
        "supportedKinds",
        "message"
      ],
      "additionalProperties": false,
      "description": "The request asked for a candidate kind this runtime does not serve.",
      "title": "CatalogUnsupportedKindError"
    },
    "CommandList": {
      "type": "object",
      "properties": {
        "commands": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SlashCommandInfo",
            "description": "Slash-command metadata with name, aliases, description, kind, input hint, execution allowance, and schedulability."
          },
          "description": "Commands available in this session"
        }
      },
      "required": [
        "commands"
      ],
      "additionalProperties": false,
      "description": "Slash commands available in the session, after applying any include/exclude filters.",
      "title": "CommandList"
    },
    "CommandsFinalizeInvocationEffectRequest": {
      "type": "object",
      "properties": {
        "effect": {
          "type": "object",
          "properties": {},
          "description": "The slash-command result object that produced the pending effect, echoed back unchanged."
        },
        "outcome": {
          "$ref": "#/definitions/CommandsInvocationEffectOutcome",
          "description": "Whether the host applied or cancelled the pending invocation effect."
        }
      },
      "required": [
        "effect",
        "outcome"
      ],
      "additionalProperties": false,
      "description": "The pending slash-command invocation effect to finalize, plus whether the host applied or cancelled it.",
      "title": "CommandsFinalizeInvocationEffectRequest",
      "stability": "experimental"
    },
    "CommandsFinalizeInvocationEffectResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the pending invocation effect was finalized successfully."
        },
        "error": {
          "type": "string",
          "description": "Failure reason when the invocation effect could not be finalized."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Whether finalizing the invocation effect succeeded, and the failure reason when it did not.",
      "title": "CommandsFinalizeInvocationEffectResult",
      "stability": "experimental"
    },
    "CommandsHandlePendingCommandRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID from the command invocation event"
        },
        "error": {
          "type": "string",
          "description": "Error message if the command handler failed"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Pending command request ID and an optional error if the client handler failed.",
      "title": "CommandsHandlePendingCommandRequest",
      "stability": "experimental"
    },
    "CommandsHandlePendingCommandResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the command was handled successfully"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the pending client-handled command was completed successfully.",
      "title": "CommandsHandlePendingCommandResult"
    },
    "CommandsInvocationEffectOutcome": {
      "type": "string",
      "enum": [
        "applied",
        "cancelled"
      ],
      "description": "Whether a pending slash-command invocation effect was applied or cancelled by the host.",
      "title": "CommandsInvocationEffectOutcome",
      "x-enumDescriptions": {
        "applied": "The host applied the pending invocation effect.",
        "cancelled": "The host cancelled the pending invocation effect, so any provisional state must be reverted."
      },
      "stability": "experimental"
    },
    "CommandsInvocationOrigin": {
      "type": "string",
      "enum": [
        "settings"
      ]
    },
    "CommandsInvokeRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Command name. Leading slashes are stripped and the name is matched case-insensitively."
        },
        "input": {
          "type": "string",
          "description": "Raw input after the command name"
        },
        "origin": {
          "$ref": "#/definitions/CommandsInvocationOrigin",
          "description": "Optional client surface that initiated the invocation"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Slash command name and optional raw input string to invoke.",
      "title": "CommandsInvokeRequest",
      "stability": "experimental"
    },
    "CommandsListRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "includeBuiltins": {
              "type": "boolean",
              "description": "Include runtime built-in commands"
            },
            "includeSkills": {
              "type": "boolean",
              "description": "Include enabled user-invocable skills and commands"
            },
            "includeClientCommands": {
              "type": "boolean",
              "description": "Include commands registered by protocol clients, including SDK clients and extensions"
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional filters controlling which command sources to include in the listing.",
      "title": "CommandsListRequest",
      "stability": "experimental"
    },
    "CommandsRespondToQueuedCommandRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID from the `command.queued` event the host is responding to."
        },
        "result": {
          "$ref": "#/definitions/QueuedCommandResult",
          "description": "Result of the queued command execution."
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "Queued-command request ID and the result indicating whether the host executed it (and whether to stop processing further queued commands).",
      "title": "CommandsRespondToQueuedCommandRequest",
      "stability": "experimental"
    },
    "CommandsRespondToQueuedCommandResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether a pending queued command with the given request ID was found and resolved. False when the request was already resolved, cancelled, or unknown."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the queued-command response was matched to a pending request.",
      "title": "CommandsRespondToQueuedCommandResult"
    },
    "CompletionsGetTriggerCharactersResult": {
      "type": "object",
      "properties": {
        "triggerCharacters": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Trigger characters advertised by the host (e.g. `[\"@\", \"#\"]`). Empty disables host-driven completions for the session."
        }
      },
      "required": [
        "triggerCharacters"
      ],
      "additionalProperties": false,
      "description": "Characters that, when typed in the composer, should trigger a `completions.request`. Empty when the session has no host-driven completions (e.g. local sessions, or a relay host that does not advertise `completionTriggerCharacters`).",
      "title": "CompletionsGetTriggerCharactersResult"
    },
    "CompletionsRequestRequest": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string",
          "description": "The full composed composer input."
        },
        "offset": {
          "type": "integer",
          "minimum": 0,
          "description": "Cursor offset within `text`, in UTF-16 code units."
        }
      },
      "required": [
        "text",
        "offset"
      ],
      "additionalProperties": false,
      "description": "Request host-driven completions for the current composer input.",
      "title": "CompletionsRequestRequest",
      "stability": "experimental"
    },
    "CompletionsRequestResult": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionCompletionItem",
            "description": "A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced."
          },
          "description": "Completion items in host-ranked order."
        }
      },
      "required": [
        "items"
      ],
      "additionalProperties": false,
      "description": "Host-driven completion items for the current composer input. Empty when the host returns no items or does not support completions.",
      "title": "CompletionsRequestResult"
    },
    "ConfigureSessionExtensionsParams": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session to attach the extension controller delegate to."
        },
        "controller": {
          "description": "In-process ExtensionController delegate (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. The post-SDK extension surface exposes list/enable/disable/reload via dedicated RPCs served by the runtime.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Params to attach or detach an in-process ExtensionController delegate.",
      "title": "ConfigureSessionExtensionsParams",
      "visibility": "internal"
    },
    "ConnectClientInfo": {
      "type": "object",
      "properties": {
        "editorName": {
          "type": "string",
          "description": "Name of the host editor, e.g. `\"vscode\"`."
        },
        "editorVersion": {
          "type": "string",
          "description": "Version of the host editor, e.g. `\"1.124.2\"`. Ignored unless it looks like a version string."
        },
        "extensionName": {
          "type": "string",
          "description": "Name of the Copilot extension within the host, e.g. `\"copilot-chat\"`."
        },
        "extensionVersion": {
          "type": "string",
          "description": "Version of the Copilot extension within the host, e.g. `\"0.54.0\"`. Ignored unless it looks like a version string."
        }
      },
      "additionalProperties": false,
      "description": "Identity of the integrating host, declared once on the `server.connect` handshake so telemetry from this connection is attributed to a single, consistent surface. All fields are optional; omit them to keep the default attribution.",
      "title": "ConnectClientInfo",
      "visibility": "internal"
    },
    "ConnectedRemoteSessionMetadata": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "SDK session ID for the connected remote session."
        },
        "name": {
          "type": "string",
          "description": "Optional friendly session name."
        },
        "summary": {
          "type": "string",
          "description": "Optional session summary."
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "Session start time as an ISO 8601 string."
        },
        "modifiedTime": {
          "type": "string",
          "format": "date-time",
          "description": "Last session update time as an ISO 8601 string."
        },
        "repository": {
          "$ref": "#/definitions/ConnectedRemoteSessionMetadataRepository",
          "description": "Repository associated with the connected remote session."
        },
        "pullRequestNumber": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Pull request number associated with the session."
        },
        "resourceId": {
          "type": "string",
          "description": "Original remote resource identifier."
        },
        "kind": {
          "$ref": "#/definitions/ConnectedRemoteSessionMetadataKind",
          "description": "Neutral SDK discriminator for the connected remote session kind."
        },
        "staleAt": {
          "type": "string",
          "format": "date-time",
          "description": "Remote session staleness deadline as an ISO 8601 string."
        },
        "state": {
          "type": "string",
          "description": "Remote session state returned by the backing service."
        }
      },
      "required": [
        "sessionId",
        "startTime",
        "modifiedTime",
        "repository",
        "kind"
      ],
      "additionalProperties": false,
      "description": "Metadata for a connected remote session.",
      "title": "ConnectedRemoteSessionMetadata"
    },
    "ConnectedRemoteSessionMetadataKind": {
      "type": "string",
      "enum": [
        "remote-session",
        "coding-agent"
      ],
      "description": "Neutral SDK discriminator for the connected remote session kind.",
      "title": "ConnectedRemoteSessionMetadataKind",
      "x-enumDescriptions": {
        "remote-session": "Remote CLI session.",
        "coding-agent": "GitHub Copilot coding agent session."
      }
    },
    "ConnectedRemoteSessionMetadataRepository": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "Repository owner or organization login."
        },
        "name": {
          "type": "string",
          "description": "Repository name."
        },
        "branch": {
          "type": "string",
          "description": "Branch associated with the remote session."
        }
      },
      "required": [
        "owner",
        "name",
        "branch"
      ],
      "additionalProperties": false,
      "description": "Repository associated with the connected remote session.",
      "title": "ConnectedRemoteSessionMetadataRepository"
    },
    "ConnectRemoteSessionParams": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID to connect to."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Remote session connection parameters.",
      "title": "ConnectRemoteSessionParams"
    },
    "ConnectRequest": {
      "type": "object",
      "properties": {
        "enableGitHubTelemetryForwarding": {
          "type": "boolean",
          "description": "Opt this connection in to GitHub telemetry forwarding for its lifetime. When set, the runtime forwards every internal telemetry event it emits — across all sessions, plus sessionless events — to this connection over the `gitHubTelemetry.event` notification. Regular events are also written to the runtime's normal GitHub/CTS path (dual-write); host-only compatibility events are forward-only and intentionally skip that path. Intended for first-party hosts that re-emit the events into their own telemetry stores. Both unrestricted and restricted events are forwarded, each tagged with a `restricted` discriminator; a backstop drops restricted events when restricted telemetry is disabled — using the process-global gate for ordinary events and an explicit session-scoped decision for host-only events."
        },
        "clientInfo": {
          "$ref": "#/definitions/ConnectClientInfo",
          "description": "Identity of the integrating host. Optional; omit it to keep the default attribution."
        },
        "token": {
          "type": "string",
          "description": "Connection token; required when the server was started with COPILOT_CONNECTION_TOKEN"
        }
      },
      "additionalProperties": false,
      "description": "Connection-level opt-ins for the `server.connect` handshake. Transport authentication is consumed by the native protocol boundary before dispatch.",
      "title": "ConnectRequest",
      "visibility": "internal"
    },
    "ConnectResult": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true,
          "description": "Always true on success"
        },
        "protocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Server protocol version number"
        },
        "version": {
          "type": "string",
          "description": "Server package version"
        }
      },
      "required": [
        "ok",
        "protocolVersion",
        "version"
      ],
      "additionalProperties": false,
      "description": "Handshake result reporting the server's protocol version and package version on success.",
      "title": "ConnectResult",
      "visibility": "internal"
    },
    "ContentExclusionCheckPathsRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Local file system absolute paths within the session working directory to check. Results are returned in the same order, including duplicates."
        }
      },
      "required": [
        "paths"
      ],
      "additionalProperties": false,
      "description": "Local file system absolute paths within the session working directory to check against its content-exclusion policy.",
      "title": "ContentExclusionCheckPathsRequest",
      "stability": "experimental"
    },
    "ContentExclusionCheckPathsResult": {
      "type": "object",
      "properties": {
        "available": {
          "type": "boolean",
          "description": "Whether the session's policy service was available for the complete batch. When false, checks is empty and callers must treat every requested path as excluded."
        },
        "checks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ContentExclusionPathCheck",
            "description": "Content-exclusion decision for one requested path."
          },
          "description": "Per-path decisions in request order. Empty when available is false."
        }
      },
      "required": [
        "available",
        "checks"
      ],
      "additionalProperties": false,
      "description": "Batch content-exclusion result. Callers must fail closed when policy evaluation is unavailable.",
      "title": "ContentExclusionCheckPathsResult",
      "stability": "experimental"
    },
    "ContentExclusionPathCheck": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "The path supplied by the caller."
        },
        "excluded": {
          "type": "boolean",
          "description": "Whether the session's complete content-exclusion policy excludes the path."
        }
      },
      "required": [
        "path",
        "excluded"
      ],
      "additionalProperties": false,
      "description": "Content-exclusion decision for one requested path.",
      "title": "ContentExclusionPathCheck",
      "stability": "experimental"
    },
    "ContentFilterMode": {
      "type": "string",
      "enum": [
        "none",
        "markdown",
        "hidden_characters"
      ],
      "description": "Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives.",
      "title": "ContentFilterMode",
      "x-enumDescriptions": {
        "none": "Leave MCP tool result content unchanged.",
        "markdown": "Sanitize HTML while preserving Markdown-friendly output.",
        "hidden_characters": "Remove characters that can hide directives."
      }
    },
    "ContextHeaviestMessage": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier for this message within the snapshot."
        },
        "label": {
          "type": "string",
          "description": "Human-readable source label, e.g. `tool: bash` or `skill: tmux`. Presentation-only."
        },
        "role": {
          "type": "string",
          "description": "Role of the chat message (`user`, `assistant`, or `tool`)."
        },
        "tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count currently in context for this individual message."
        }
      },
      "required": [
        "id",
        "label",
        "role",
        "tokens"
      ],
      "additionalProperties": false,
      "description": "A single large message currently in context.",
      "title": "ContextHeaviestMessage"
    },
    "ContextTier": {
      "type": "string",
      "enum": [
        "default",
        "long_context"
      ],
      "description": "Context tier for models that support multiple context-window sizes.",
      "title": "ContextTier",
      "x-enumDescriptions": {
        "default": "Use the model's default context window.",
        "long_context": "Pin the session to the long-context tier when supported."
      }
    },
    "CopilotApiTokenAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "copilot-api-token",
          "description": "Direct Copilot API authentication via the `GITHUB_COPILOT_API_TOKEN` + `COPILOT_API_URL` environment-variable pair. The token itself is read from the environment by the runtime, not carried in this struct."
        },
        "host": {
          "type": "string",
          "const": "https://github.com",
          "description": "Authentication host (always the public GitHub host)."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host"
      ],
      "additionalProperties": false,
      "description": "Authentication-info variant for direct Copilot API token auth sourced from environment variables, with public GitHub host.",
      "title": "CopilotApiTokenAuthInfo"
    },
    "CopilotUserResponse": {
      "type": "object",
      "properties": {
        "login": {
          "type": "string",
          "description": "GitHub login of the authenticated user."
        },
        "access_type_sku": {
          "type": "string",
          "description": "Copilot access SKU identifier (e.g. `free_limited_copilot`, `copilot_for_business_seat_quota`) used to gate model and feature access."
        },
        "analytics_tracking_id": {
          "type": "string",
          "description": "Opaque analytics tracking identifier for the user, forwarded from the Copilot API."
        },
        "assigned_date": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "string"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Date the Copilot seat was assigned to the user, if applicable."
        },
        "can_signup_for_limited": {
          "type": "boolean",
          "description": "Whether the user is eligible to sign up for the free/limited Copilot tier."
        },
        "chat_enabled": {
          "type": "boolean",
          "description": "Whether Copilot chat is enabled for the user."
        },
        "copilot_plan": {
          "type": "string",
          "description": "Copilot plan name for the user (e.g. `individual`, `business`, `enterprise`)."
        },
        "copilotignore_enabled": {
          "type": "boolean",
          "description": "Whether `.copilotignore` content-exclusion support is enabled for the user."
        },
        "endpoints": {
          "$ref": "#/definitions/CopilotUserResponseEndpoints",
          "description": "Endpoint URLs from the raw Copilot `/copilot_internal/v2/token` user-response passthrough."
        },
        "organization_login_list": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Logins of the organizations the user belongs to."
        },
        "organization_list": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "array",
                  "items": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "login": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "not": {}
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "GitHub login of the organization."
                          },
                          "name": {
                            "anyOf": [
                              {
                                "anyOf": [
                                  {
                                    "not": {}
                                  },
                                  {
                                    "type": "string"
                                  }
                                ]
                              },
                              {
                                "type": "null"
                              }
                            ],
                            "description": "Display name of the organization."
                          }
                        },
                        "additionalProperties": false
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Organizations the user belongs to, each with an optional login and display name."
        },
        "codex_agent_enabled": {
          "type": "boolean",
          "description": "Whether the Codex agent is enabled for the user."
        },
        "is_mcp_enabled": {
          "anyOf": [
            {
              "anyOf": [
                {
                  "not": {}
                },
                {
                  "type": "boolean"
                }
              ]
            },
            {
              "type": "null"
            }
          ],
          "description": "Whether MCP (Model Context Protocol) support is enabled for the user."
        },
        "quota_reset_date": {
          "type": "string",
          "description": "Date the user's usage quota next resets, as a raw string from the Copilot API; see `quota_reset_date_utc` for the UTC-normalized value."
        },
        "quota_snapshots": {
          "$ref": "#/definitions/CopilotUserResponseQuotaSnapshots",
          "description": "Quota snapshot map from the raw Copilot user-response passthrough, with chat, completions, premium-interactions, and other entries."
        },
        "restricted_telemetry": {
          "type": "boolean",
          "description": "Whether the user's telemetry is subject to restricted-data handling."
        },
        "is_staff": {
          "type": "boolean",
          "description": "Whether the user is a GitHub/Microsoft staff member."
        },
        "te": {
          "type": "boolean",
          "description": "Raw passthrough of the Copilot API `te` flag for the user (an opaque server-side eligibility signal surfaced in telemetry); not otherwise interpreted by the runtime."
        },
        "token_based_billing": {
          "type": "boolean",
          "description": "Whether the account is on usage-based (token/AI-credit) billing rather than a fixed premium-request quota."
        },
        "can_upgrade_plan": {
          "type": "boolean",
          "description": "Whether the user is able to upgrade their Copilot plan."
        },
        "quota_reset_date_utc": {
          "type": "string",
          "description": "UTC-normalized form of `quota_reset_date` (the date the user's usage quota next resets)."
        },
        "limited_user_quotas": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Per-category quota allotments for free/limited-tier users, keyed by quota category."
        },
        "limited_user_reset_date": {
          "type": "string",
          "description": "Date the free/limited-tier user's quotas next reset, as a raw string from the Copilot API."
        },
        "monthly_quotas": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Per-category monthly quota allotments, keyed by quota category."
        },
        "cloud_session_storage_enabled": {
          "type": "boolean",
          "description": "Whether cloud session storage is enabled for the user."
        },
        "cli_remote_control_enabled": {
          "type": "boolean",
          "description": "Whether CLI remote control is enabled for the user."
        }
      },
      "additionalProperties": false,
      "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set.",
      "title": "CopilotUserResponse"
    },
    "CopilotUserResponseEndpoints": {
      "type": "object",
      "properties": {
        "api": {
          "type": "string",
          "description": "Copilot API endpoint URL."
        },
        "origin-tracker": {
          "type": "string",
          "description": "Origin-tracker endpoint URL."
        },
        "proxy": {
          "type": "string",
          "description": "Copilot proxy endpoint URL."
        },
        "telemetry": {
          "type": "string",
          "description": "Copilot telemetry endpoint URL."
        },
        "exp": {
          "type": "string",
          "description": "Experimental-service endpoint URL."
        }
      },
      "additionalProperties": false,
      "description": "Endpoint URLs from the raw Copilot `/copilot_internal/v2/token` user-response passthrough.",
      "title": "CopilotUserResponseEndpoints"
    },
    "CopilotUserResponseQuotaSnapshots": {
      "type": "object",
      "properties": {
        "chat": {
          "$ref": "#/definitions/CopilotUserResponseQuotaSnapshotsChat",
          "description": "Chat quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields."
        },
        "completions": {
          "$ref": "#/definitions/CopilotUserResponseQuotaSnapshotsCompletions",
          "description": "Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields."
        },
        "premium_interactions": {
          "$ref": "#/definitions/CopilotUserResponseQuotaSnapshotsPremiumInteractions",
          "description": "Premium-interactions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields."
        }
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "object",
            "properties": {
              "entitlement": {
                "type": "number"
              },
              "overage_count": {
                "type": "number"
              },
              "overage_permitted": {
                "type": "boolean"
              },
              "percent_remaining": {
                "type": "number"
              },
              "quota_id": {
                "type": "string"
              },
              "quota_remaining": {
                "type": "number"
              },
              "remaining": {
                "type": "number"
              },
              "unlimited": {
                "type": "boolean"
              },
              "timestamp_utc": {
                "type": "string"
              },
              "has_quota": {
                "type": "boolean"
              },
              "quota_reset_at": {
                "type": "number"
              },
              "token_based_billing": {
                "type": "boolean"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "null"
          }
        ]
      },
      "description": "Quota snapshot map from the raw Copilot user-response passthrough, with chat, completions, premium-interactions, and other entries.",
      "title": "CopilotUserResponseQuotaSnapshots",
      "x-opaque-json": true
    },
    "CopilotUserResponseQuotaSnapshotsChat": {
      "type": "object",
      "properties": {
        "entitlement": {
          "type": "number",
          "description": "Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement."
        },
        "overage_count": {
          "type": "number",
          "description": "Count of additional pay-per-request usage consumed this period beyond the entitlement."
        },
        "overage_permitted": {
          "type": "boolean",
          "description": "Whether usage may continue at pay-per-request rates once the entitlement is exhausted."
        },
        "percent_remaining": {
          "type": "number",
          "description": "Percentage of the entitlement remaining at the snapshot timestamp."
        },
        "quota_id": {
          "type": "string",
          "description": "Identifier of the quota bucket this snapshot describes."
        },
        "quota_remaining": {
          "type": "number",
          "description": "Amount of quota remaining at the snapshot timestamp."
        },
        "remaining": {
          "type": "number",
          "description": "Remaining entitlement/quota amount at the snapshot timestamp."
        },
        "unlimited": {
          "type": "boolean",
          "description": "Whether the entitlement for this category is unlimited."
        },
        "timestamp_utc": {
          "type": "string",
          "description": "UTC timestamp when this snapshot was captured."
        },
        "has_quota": {
          "type": "boolean",
          "description": "Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets."
        },
        "quota_reset_at": {
          "type": "number",
          "description": "Unix epoch time, in seconds, when this quota next resets."
        },
        "token_based_billing": {
          "type": "boolean",
          "description": "Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count."
        }
      },
      "additionalProperties": false,
      "description": "Chat quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.",
      "title": "CopilotUserResponseQuotaSnapshotsChat"
    },
    "CopilotUserResponseQuotaSnapshotsCompletions": {
      "type": "object",
      "properties": {
        "entitlement": {
          "type": "number",
          "description": "Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement."
        },
        "overage_count": {
          "type": "number",
          "description": "Count of additional pay-per-request usage consumed this period beyond the entitlement."
        },
        "overage_permitted": {
          "type": "boolean",
          "description": "Whether usage may continue at pay-per-request rates once the entitlement is exhausted."
        },
        "percent_remaining": {
          "type": "number",
          "description": "Percentage of the entitlement remaining at the snapshot timestamp."
        },
        "quota_id": {
          "type": "string",
          "description": "Identifier of the quota bucket this snapshot describes."
        },
        "quota_remaining": {
          "type": "number",
          "description": "Amount of quota remaining at the snapshot timestamp."
        },
        "remaining": {
          "type": "number",
          "description": "Remaining entitlement/quota amount at the snapshot timestamp."
        },
        "unlimited": {
          "type": "boolean",
          "description": "Whether the entitlement for this category is unlimited."
        },
        "timestamp_utc": {
          "type": "string",
          "description": "UTC timestamp when this snapshot was captured."
        },
        "has_quota": {
          "type": "boolean",
          "description": "Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets."
        },
        "quota_reset_at": {
          "type": "number",
          "description": "Unix epoch time, in seconds, when this quota next resets."
        },
        "token_based_billing": {
          "type": "boolean",
          "description": "Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count."
        }
      },
      "additionalProperties": false,
      "description": "Completions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.",
      "title": "CopilotUserResponseQuotaSnapshotsCompletions"
    },
    "CopilotUserResponseQuotaSnapshotsPremiumInteractions": {
      "type": "object",
      "properties": {
        "entitlement": {
          "type": "number",
          "description": "Number of requests/units included in the entitlement for this period; `-1` denotes an unlimited entitlement."
        },
        "overage_count": {
          "type": "number",
          "description": "Count of additional pay-per-request usage consumed this period beyond the entitlement."
        },
        "overage_permitted": {
          "type": "boolean",
          "description": "Whether usage may continue at pay-per-request rates once the entitlement is exhausted."
        },
        "percent_remaining": {
          "type": "number",
          "description": "Percentage of the entitlement remaining at the snapshot timestamp."
        },
        "quota_id": {
          "type": "string",
          "description": "Identifier of the quota bucket this snapshot describes."
        },
        "quota_remaining": {
          "type": "number",
          "description": "Amount of quota remaining at the snapshot timestamp."
        },
        "remaining": {
          "type": "number",
          "description": "Remaining entitlement/quota amount at the snapshot timestamp."
        },
        "unlimited": {
          "type": "boolean",
          "description": "Whether the entitlement for this category is unlimited."
        },
        "timestamp_utc": {
          "type": "string",
          "description": "UTC timestamp when this snapshot was captured."
        },
        "has_quota": {
          "type": "boolean",
          "description": "Whether the user currently has quota available; when `false` and not unlimited, further requests are blocked until the quota resets."
        },
        "quota_reset_at": {
          "type": "number",
          "description": "Unix epoch time, in seconds, when this quota next resets."
        },
        "token_based_billing": {
          "type": "boolean",
          "description": "Whether this category uses usage-based (token/AI-credit) billing rather than a fixed premium-request count."
        }
      },
      "additionalProperties": false,
      "description": "Premium-interactions quota snapshot from the raw Copilot user-response passthrough, with entitlement, overage, remaining quota, reset, and billing fields.",
      "title": "CopilotUserResponseQuotaSnapshotsPremiumInteractions"
    },
    "CurrentModel": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "Currently active model identifier"
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level currently applied to the active model, when one is set. Reads `Session.getReasoningEffort()` synchronously after `getSelectedModel()` resolves so the two values are reported as a snapshot."
        },
        "contextTier": {
          "$ref": "#/definitions/ContextTier",
          "description": "Context tier for models that support multiple context-window sizes."
        }
      },
      "additionalProperties": false,
      "description": "The currently selected model, reasoning effort, and context tier for the session. The context tier reflects `Session.getContextTier()`, restored from the session journal on resume.",
      "title": "CurrentModel"
    },
    "CurrentToolMetadata": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Model-facing tool name"
        },
        "namespacedName": {
          "type": "string",
          "description": "Optional MCP/config namespaced tool name"
        },
        "mcpServerName": {
          "type": "string",
          "description": "MCP server name for MCP-backed tools"
        },
        "mcpToolName": {
          "type": "string",
          "description": "Raw MCP tool name for MCP-backed tools"
        },
        "description": {
          "type": "string",
          "description": "Tool description"
        },
        "input_schema": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "JSON Schema for tool input"
        },
        "deferLoading": {
          "type": "boolean",
          "description": "Whether the tool is loaded on demand via tool search"
        }
      },
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "Lightweight metadata for a currently initialized session tool",
      "title": "CurrentToolMetadata"
    },
    "DebugCollectLogsCollectedEntry": {
      "type": "object",
      "properties": {
        "bundlePath": {
          "type": "string",
          "description": "Relative path of the file in the staged bundle/archive."
        },
        "source": {
          "$ref": "#/definitions/DebugCollectLogsSource",
          "description": "Source category for this entry."
        },
        "sizeBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Redacted output size in bytes."
        }
      },
      "required": [
        "bundlePath",
        "source",
        "sizeBytes"
      ],
      "additionalProperties": false,
      "description": "A file included in the redacted debug bundle.",
      "title": "DebugCollectLogsCollectedEntry"
    },
    "DebugCollectLogsDestination": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "outputPath": {
              "type": "string",
              "description": "Absolute or server-relative path for the .tgz archive to create."
            },
            "noOverwrite": {
              "type": "boolean",
              "description": "When true, create the archive atomically without overwriting an existing file by appending ` (N)` before the extension as needed. Defaults to false."
            },
            "kind": {
              "type": "string",
              "const": "archive",
              "description": "Destination variant discriminator."
            }
          },
          "required": [
            "kind",
            "outputPath"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "outputDirectory": {
              "type": "string",
              "description": "Directory where redacted files should be staged. The directory is created if needed."
            },
            "kind": {
              "type": "string",
              "const": "directory",
              "description": "Destination variant discriminator."
            }
          },
          "required": [
            "kind",
            "outputDirectory"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Destination for the redacted debug bundle.",
      "title": "DebugCollectLogsDestination"
    },
    "DebugCollectLogsEntry": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/DebugCollectLogsEntryKind",
          "description": "Kind of source path to include."
        },
        "path": {
          "type": "string",
          "description": "Server-local source path to read."
        },
        "bundlePath": {
          "type": "string",
          "description": "Relative path to use inside the staged bundle/archive."
        },
        "redaction": {
          "$ref": "#/definitions/DebugCollectLogsRedaction",
          "description": "How text content from this entry should be redacted. Defaults to plain-text."
        },
        "required": {
          "type": "boolean",
          "description": "When true, collection fails if this entry cannot be read. Defaults to false, which records the entry in `skippedEntries`."
        }
      },
      "required": [
        "kind",
        "path",
        "bundlePath"
      ],
      "additionalProperties": false,
      "description": "A caller-provided server-local file or directory to include in the debug bundle.",
      "title": "DebugCollectLogsEntry"
    },
    "DebugCollectLogsEntryKind": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ],
      "description": "Kind of caller-provided debug log entry.",
      "title": "DebugCollectLogsEntryKind",
      "x-enumDescriptions": {
        "file": "Include a single server-local file.",
        "directory": "Include files from a server-local directory recursively."
      }
    },
    "DebugCollectLogsInclude": {
      "type": "object",
      "properties": {
        "events": {
          "type": "boolean",
          "description": "Include the session event log (`events.jsonl`). Defaults to true."
        },
        "processLogs": {
          "type": "boolean",
          "description": "Include process logs for the session. Defaults to true."
        },
        "shellLogs": {
          "type": "boolean",
          "description": "Include interactive shell logs written under the session's `shell-logs` directory. Defaults to true."
        },
        "eventsPath": {
          "type": "string",
          "description": "Server-local path to the session's events.jsonl file. Internal callers normally omit this and let the runtime derive it from the session."
        },
        "currentProcessLogPath": {
          "type": "string",
          "description": "Server-local path to the current process log. When set, it is included as `process.log` and its directory is searched for prior logs from the same session."
        },
        "processLogDirectory": {
          "type": "string",
          "description": "Server-local process log directory to search when `currentProcessLogPath` is unavailable, useful for collecting logs for inactive sessions."
        },
        "previousProcessLogLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of previous process logs to include. Defaults to 5."
        }
      },
      "additionalProperties": false,
      "description": "Built-in session diagnostics to include in the bundle. Omitted fields default to true.",
      "title": "DebugCollectLogsInclude"
    },
    "DebugCollectLogsRedaction": {
      "type": "string",
      "enum": [
        "plain-text",
        "events-jsonl"
      ],
      "description": "How a collected debug entry should be redacted before being staged.",
      "title": "DebugCollectLogsRedaction",
      "x-enumDescriptions": {
        "plain-text": "Redact the file as plain UTF-8 log text.",
        "events-jsonl": "Redact each non-empty line as a session event JSON object, falling back to plain-text redaction for malformed lines."
      }
    },
    "DebugCollectLogsRequest": {
      "type": "object",
      "properties": {
        "destination": {
          "$ref": "#/definitions/DebugCollectLogsDestination",
          "description": "Where the redacted bundle should be written. Use `archive` to produce a .tgz, or `directory` to stage redacted files for caller-managed upload/post-processing."
        },
        "include": {
          "$ref": "#/definitions/DebugCollectLogsInclude",
          "description": "Which built-in session diagnostics to include. Omitted fields default to true."
        },
        "additionalEntries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DebugCollectLogsEntry",
            "description": "A caller-provided server-local file or directory to include in the debug bundle."
          },
          "description": "Caller-provided server-local files or directories to include in addition to the runtime's built-in session diagnostics. This lets host applications add their own diagnostics without changing the API shape."
        }
      },
      "required": [
        "destination"
      ],
      "additionalProperties": false,
      "description": "Options for collecting a redacted session debug bundle.",
      "title": "DebugCollectLogsRequest",
      "stability": "experimental"
    },
    "DebugCollectLogsResult": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/DebugCollectLogsResultKind",
          "description": "Destination kind that was written."
        },
        "path": {
          "type": "string",
          "description": "Actual archive path or staging directory path written. This may differ from the requested path when no-overwrite suffixing or fallback-to-temp-directory was needed."
        },
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DebugCollectLogsCollectedEntry",
            "description": "A file included in the redacted debug bundle."
          },
          "description": "Files included in the redacted bundle."
        },
        "skippedEntries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DebugCollectLogsSkippedEntry",
            "description": "An optional debug bundle entry that could not be included."
          },
          "description": "Optional files or directories that could not be included."
        }
      },
      "required": [
        "kind",
        "path",
        "entries"
      ],
      "additionalProperties": false,
      "description": "Result of collecting a redacted debug bundle.",
      "title": "DebugCollectLogsResult"
    },
    "DebugCollectLogsResultKind": {
      "type": "string",
      "enum": [
        "archive",
        "directory"
      ],
      "description": "Destination kind that was written.",
      "title": "DebugCollectLogsResultKind",
      "x-enumDescriptions": {
        "archive": "A .tgz archive was written.",
        "directory": "A directory containing redacted files was written."
      }
    },
    "DebugCollectLogsSkippedEntry": {
      "type": "object",
      "properties": {
        "bundlePath": {
          "type": "string",
          "description": "Relative path requested for this bundle entry."
        },
        "path": {
          "type": "string",
          "description": "Server-local source path that could not be read."
        },
        "reason": {
          "type": "string",
          "description": "Reason the entry was skipped."
        }
      },
      "required": [
        "bundlePath",
        "reason"
      ],
      "additionalProperties": false,
      "description": "An optional debug bundle entry that could not be included.",
      "title": "DebugCollectLogsSkippedEntry"
    },
    "DebugCollectLogsSource": {
      "type": "string",
      "enum": [
        "events",
        "process-log",
        "shell-log",
        "additional"
      ],
      "description": "Source category for a collected debug bundle entry.",
      "title": "DebugCollectLogsSource",
      "x-enumDescriptions": {
        "events": "Session event log.",
        "process-log": "Process log for the session.",
        "shell-log": "Interactive shell log for the session.",
        "additional": "Caller-provided diagnostic entry."
      }
    },
    "DiscoveredCanvas": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string",
          "description": "Human-readable canvas name"
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "description": "Short, single-sentence description shown to the agent in canvas catalogs."
        },
        "icon": {
          "type": "string",
          "description": "Host-local PNG path for the canvas icon, when supplied"
        },
        "inputSchema": {
          "$ref": "#/definitions/CanvasJsonSchema",
          "description": "JSON Schema for canvas open input"
        },
        "actions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CanvasAction",
            "description": "Canvas action that the agent or host can invoke. To discover the input schema for a particular action, call the list_canvas_capabilities tool."
          },
          "description": "Actions the agent or host may invoke on an open instance"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "extensionName": {
          "type": "string",
          "description": "Owning extension display name, when available"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        }
      },
      "required": [
        "displayName",
        "description",
        "extensionId",
        "canvasId"
      ],
      "additionalProperties": false,
      "description": "Canvas available in the current session.",
      "title": "DiscoveredCanvas",
      "stability": "experimental"
    },
    "DiscoveredExtension": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified ID accepted by both server and session extension enablement methods"
        },
        "name": {
          "type": "string",
          "description": "Human-readable extension name"
        },
        "path": {
          "type": "string",
          "description": "Absolute path to the extension entry module, suitable for revealing it in a file manager"
        },
        "source": {
          "$ref": "#/definitions/DiscoveredExtensionSource",
          "description": "Discovery source"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether this extension's persistent per-ID preference is enabled"
        },
        "plugin": {
          "$ref": "#/definitions/DiscoveredExtensionPlugin",
          "description": "Containing plugin metadata for plugin-contributed extensions"
        }
      },
      "required": [
        "id",
        "name",
        "path",
        "source",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Discovered extension metadata and persistent enablement state.",
      "title": "DiscoveredExtension"
    },
    "DiscoveredExtensionMode": {
      "type": "string",
      "enum": [
        "disabled",
        "load_only",
        "load_and_augment"
      ],
      "description": "Effective extension loading and agent-management mode",
      "title": "DiscoveredExtensionMode",
      "x-enumDescriptions": {
        "disabled": "Extensions are not loaded.",
        "load_only": "Extensions are loaded, but the agent cannot create, reload, or manage them.",
        "load_and_augment": "Extensions are loaded and the agent can create, reload, and manage them."
      }
    },
    "DiscoveredExtensionPlugin": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Installed plugin name"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Installed plugin that contributes a discovered extension.",
      "title": "DiscoveredExtensionPlugin"
    },
    "DiscoveredExtensions": {
      "type": "object",
      "properties": {
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DiscoveredExtension",
            "description": "Discovered extension metadata and persistent enablement state."
          },
          "description": "Discovered user and enabled installed-plugin extensions from persisted Copilot home state"
        },
        "mode": {
          "$ref": "#/definitions/DiscoveredExtensionMode",
          "description": "Effective extension loading mode. Defaults to load_and_augment when unset."
        }
      },
      "required": [
        "extensions",
        "mode"
      ],
      "additionalProperties": false,
      "description": "Extensions discovered from persisted Copilot home state and their effective loading mode. Launch-scoped additional plugins are not included.",
      "title": "DiscoveredExtensions"
    },
    "DiscoveredExtensionsDisableRequest": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Source-qualified user or plugin extension IDs to disable"
        }
      },
      "required": [
        "ids"
      ],
      "additionalProperties": false,
      "description": "Source-qualified extension identifiers to persistently disable for future sessions.",
      "title": "DiscoveredExtensionsDisableRequest",
      "stability": "experimental"
    },
    "DiscoveredExtensionsEnableRequest": {
      "type": "object",
      "properties": {
        "ids": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Source-qualified user or plugin extension IDs to enable"
        }
      },
      "required": [
        "ids"
      ],
      "additionalProperties": false,
      "description": "Source-qualified extension identifiers to persistently enable for future sessions.",
      "title": "DiscoveredExtensionsEnableRequest",
      "stability": "experimental"
    },
    "DiscoveredExtensionSource": {
      "type": "string",
      "enum": [
        "user",
        "plugin"
      ],
      "description": "Persisted extension discovery source",
      "title": "DiscoveredExtensionSource",
      "x-enumDescriptions": {
        "user": "Extension discovered from the user's extensions directory.",
        "plugin": "Extension contributed by an installed plugin."
      }
    },
    "DiscoveredHook": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Deterministic identifier for this server-discovered action row. It remains stable while the project, origin, source, event, action content, and duplicate ordinal are unchanged. This is row identity, not the key persisted in disabledHooks."
        },
        "hookType": {
          "$ref": "#/definitions/HookType",
          "description": "Hook event that invokes this action."
        },
        "origin": {
          "$ref": "#/definitions/HookOrigin",
          "description": "Configuration tier that contributed this hook action."
        },
        "source": {
          "type": "string",
          "description": "Human-readable source label, such as a hook file path, settings source, or plugin name."
        },
        "projectPath": {
          "type": "string",
          "description": "Input project path for which this server-side action was resolved. Set on every row returned for project-scoped discovery, including repeated user and policy actions."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether this action is enabled under the server-side discovery settings. Concrete sessions may differ because they can add session-specific directories, plugins, or trust. False when its disable key is present in the user's disabled-hooks setting or disable-all settings suppress the action."
        },
        "disableKey": {
          "type": "string",
          "description": "Durable content hash used by hook enablement. Identical actions may intentionally share this key. Omitted when changing the user's disabled-hooks setting cannot change the action's current server-discovered state, including managed-policy hooks, session-start prompt actions, actions suppressed by disable-all settings, and projectless plugin actions that require project-directory expansion."
        }
      },
      "required": [
        "id",
        "hookType",
        "origin",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "One server-discovered hook action from user, repository, plugin, or managed-policy configuration.",
      "title": "DiscoveredHook"
    },
    "DiscoveredMcpServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Server name (config key)"
        },
        "type": {
          "$ref": "#/definitions/DiscoveredMcpServerType",
          "description": "Server transport type: stdio, http, sse (deprecated), or memory"
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "Configuration source: user, workspace, plugin, or builtin"
        },
        "sourcePlugin": {
          "type": "string",
          "description": "Plugin name that provided this server, when source is plugin."
        },
        "sourcePluginVersion": {
          "type": "string",
          "description": "Plugin version that provided this server, when source is plugin."
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the server is enabled (not in the disabled list)"
        }
      },
      "required": [
        "name",
        "source",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state.",
      "title": "DiscoveredMcpServer"
    },
    "DiscoveredMcpServerType": {
      "type": "string",
      "enum": [
        "stdio",
        "http",
        "sse",
        "memory"
      ],
      "description": "Server transport type: stdio, http, sse (deprecated), or memory",
      "title": "DiscoveredMcpServerType",
      "x-enumDescriptions": {
        "stdio": "Server communicates over stdio with a local child process.",
        "http": "Server communicates over streamable HTTP.",
        "sse": "Server communicates over Server-Sent Events (deprecated).",
        "memory": "Server is backed by an in-memory runtime implementation."
      }
    },
    "EmbeddedBlobResourceContents": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the blob content"
        },
        "blob": {
          "type": "string",
          "description": "Base64-encoded binary content of the resource",
          "contentEncoding": "base64"
        }
      },
      "required": [
        "uri",
        "blob"
      ],
      "additionalProperties": false,
      "description": "Embedded binary resource contents identified by a URI, with an optional MIME type and a base64-encoded blob.",
      "title": "EmbeddedBlobResourceContents"
    },
    "EmbeddedTextResourceContents": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the text content"
        },
        "text": {
          "type": "string",
          "description": "Text content of the resource"
        }
      },
      "required": [
        "uri",
        "text"
      ],
      "additionalProperties": false,
      "description": "Embedded text resource contents identified by a URI, with an optional MIME type and a text payload.",
      "title": "EmbeddedTextResourceContents"
    },
    "EnqueueCommandParams": {
      "type": "object",
      "properties": {
        "command": {
          "type": "string",
          "description": "Slash-prefixed command string to enqueue, e.g. '/compact' or '/model gpt-4'. Queued FIFO with any in-flight items; if the session is idle, processing kicks off immediately."
        },
        "displayText": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional user-facing text for the queue row. The command string is shown when omitted."
        }
      },
      "required": [
        "command"
      ],
      "additionalProperties": false,
      "description": "Slash-prefixed command string to enqueue for FIFO processing.",
      "title": "EnqueueCommandParams",
      "stability": "experimental"
    },
    "EnqueueCommandResult": {
      "type": "object",
      "properties": {
        "queued": {
          "type": "boolean",
          "description": "True when the command was accepted into the local execution queue. False when the call targets a session that does not support local command queueing (e.g. remote sessions)."
        }
      },
      "required": [
        "queued"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the command was accepted into the local execution queue.",
      "title": "EnqueueCommandResult"
    },
    "EnvAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "env",
          "description": "Personal access token (PAT) or server-to-server token sourced from an environment variable."
        },
        "host": {
          "type": "string",
          "description": "Authentication host (e.g. https://github.com or a GHES host)."
        },
        "login": {
          "type": "string",
          "description": "User login associated with the token. Undefined for server-to-server tokens (those starting with `ghs_`)."
        },
        "token": {
          "type": "string",
          "description": "The token value itself. Treat as a secret."
        },
        "envVar": {
          "type": "string",
          "description": "Name of the environment variable the token was sourced from."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "token",
        "envVar"
      ],
      "additionalProperties": false,
      "description": "Authentication-info input variant for a token sourced from an environment variable, with host, optional login, token, and env var name.",
      "title": "EnvAuthInfo"
    },
    "EventLogReadRequest": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Opaque cursor returned by a previous read. Omit on the first call to start from the beginning of the session's persisted history."
        },
        "max": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 1000,
          "description": "Maximum number of events to return in this batch (1–1000, default 200)."
        },
        "waitMs": {
          "type": "integer",
          "minimum": 0,
          "maximum": 30000,
          "format": "duration",
          "description": "Milliseconds to wait for new events when the cursor is at the tail of history. 0 (default) returns immediately even if no events are available. Capped at 30000ms. Ephemeral events that arrive during the wait are delivered in this batch but are NOT replayable on a subsequent read (use a non-zero waitMs in your next call to capture future ephemerals as they happen). This applies to forward reads only: a backward read always returns immediately and ignores `waitMs`, because backward paging covers persisted history only while new events append at the tail (the opposite end from a backward page), so no blocking or ephemeral delivery can occur."
        },
        "types": {
          "$ref": "#/definitions/EventLogTypes",
          "description": "Either '*' to receive all event types, or a non-empty list of event types to receive"
        },
        "agentScope": {
          "$ref": "#/definitions/EventsAgentScope",
          "description": "Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers."
        },
        "agentIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Optional non-empty list of subagent identifiers. When provided, only events owned by one of these agents are returned; ownership recognizes the event envelope's agentId plus legacy data.agentId and data.parentToolCallId markers. This filter takes precedence over agentScope."
        },
        "direction": {
          "$ref": "#/definitions/EventsReadDirection",
          "description": "Direction to page through the session's persisted event history. 'forward' (default) pages from the cursor toward newer events (or from the start of history when no cursor is given). 'backward' enables tail-first reads: with no cursor it returns the NEWEST `max` events, and the returned cursor pages toward OLDER events on subsequent backward reads. Events within a returned batch are always in chronological (oldest-to-newest) order, even for a backward read. Backward reads cover PERSISTED history only; ephemeral events are never returned by a backward read. `direction` selects the INITIAL read only: the returned cursor is self-describing, so a continuation read pages in the cursor's own direction regardless of the `direction` passed alongside it — a forward cursor always pages forward and a backward cursor always pages backward. Pass the direction that matches the cursor to avoid confusion."
        },
        "includeEphemeral": {
          "type": "boolean",
          "description": "When false, skip ephemeral events entirely and return only durable (persisted) events. History-backfill callers that discard ephemerals anyway should set this so the read is bounded by the durable log length instead of racing the ephemeral ring on a busy session. Defaults to true (ephemerals are interleaved with durable events in creation order). Ignored by backward reads, which always cover persisted history only."
        }
      },
      "additionalProperties": false,
      "description": "Cursor, batch size, and optional long-poll/filter parameters for reading session events.",
      "title": "EventLogReadRequest",
      "stability": "experimental"
    },
    "EventLogReleaseInterestResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "EventLogReleaseInterestResult"
    },
    "EventLogTailResult": {
      "type": "object",
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Opaque cursor pointing at the current tail of the session's persisted-events history. Pass back to `read` to receive only events that arrive AFTER this snapshot. When the session has no events, this returns the same sentinel as an unset cursor (i.e. equivalent to omitting the cursor on a first read)."
        }
      },
      "required": [
        "cursor"
      ],
      "additionalProperties": false,
      "description": "Snapshot of the current tail cursor without returning any events. Use this when a consumer wants to subscribe to live events going forward without first paginating through the entire persisted history (which would happen if `read` were called without a cursor on a long-lived session).",
      "title": "EventLogTailResult"
    },
    "EventLogTypes": {
      "anyOf": [
        {
          "type": "string",
          "const": "*"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1
        }
      ],
      "description": "Either '*' to receive all event types, or a non-empty list of event types to receive",
      "title": "EventLogTypes",
      "x-opaque-json": true
    },
    "EventsAgentScope": {
      "type": "string",
      "enum": [
        "primary",
        "all"
      ],
      "description": "Agent-scope filter: 'primary' returns only main-agent events plus events whose type starts with 'subagent.' (matching the typed-subscription default behavior); 'all' returns events from all agents (matching wildcard-subscription behavior). Default is 'all' to preserve wildcard semantics for catch-up callers.",
      "title": "EventsAgentScope",
      "x-enumDescriptions": {
        "primary": "Return main-agent events and typed subagent lifecycle events.",
        "all": "Return events from all agents."
      }
    },
    "EventsCursorStatus": {
      "type": "string",
      "enum": [
        "ok",
        "expired"
      ],
      "description": "Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history (the beginning for a forward read, the tail for a backward read). The fallback page is a fresh boundary snapshot, not a continuation of the requested cursor, so it may overlap already-rendered events; on 'expired' a consumer should reset/rebase its pagination state (or deduplicate by event id) before continuing from the returned cursor.",
      "title": "EventsCursorStatus",
      "x-enumDescriptions": {
        "ok": "The cursor was applied successfully.",
        "expired": "The cursor referred to history that is no longer available."
      }
    },
    "EventsReadDirection": {
      "type": "string",
      "enum": [
        "forward",
        "backward"
      ],
      "description": "Direction to page through the session's persisted event history. 'forward' pages from the cursor toward newer events; 'backward' returns the newest window first (tail-first) and pages toward older events. Events within a returned batch are always chronological (oldest-to-newest), even for a backward read.",
      "title": "EventsReadDirection",
      "x-enumDescriptions": {
        "forward": "Page from the cursor toward newer events (default).",
        "backward": "Tail-first: return the newest events and page toward older events."
      }
    },
    "EventsReadResult": {
      "type": "object",
      "properties": {
        "events": {
          "type": "array",
          "items": {
            "$ref": "session-events.schema.json#/definitions/SessionEvent"
          },
          "description": "Session events for this batch, merged into a single stream in creation order: durable (persisted) events and ephemeral events interleave exactly as they were emitted. Set `includeEphemeral: false` to receive only durable events. Ephemeral events are never replayable once pruned from the in-memory ring, so a consumer that needs them should keep reading with a non-zero `waitMs`. For a backward (tail-first) read, the returned window contains persisted events only, still in chronological (oldest-to-newest) append order."
        },
        "cursor": {
          "type": "string",
          "description": "Opaque cursor for the next read. Pass back unchanged in the next read.cursor to continue from where this read left off. Always present, even when no events were returned. For a backward read this cursor pages toward OLDER events; keep passing `direction: backward` with it (the cursor is also self-describing, so backward paging continues correctly)."
        },
        "hasMore": {
          "type": "boolean",
          "description": "True when more events are available in the read's direction. For a forward read, true means the batch returned `max` events and more are available immediately. For a backward read, true means older persisted events remain before the returned window."
        },
        "cursorStatus": {
          "$ref": "#/definitions/EventsCursorStatus",
          "description": "Cursor status: 'ok' means the cursor was applied successfully; 'expired' means the cursor referred to an event that no longer exists in history (e.g. truncated or compacted away) and the read fell back to a boundary of the remaining history. For a forward read the fallback starts from the beginning of the remaining history; for a backward read it falls back to the tail (the newest window). Because the fallback page is a fresh boundary snapshot rather than a continuation of the requested cursor, it may overlap events the consumer has already rendered — a backward fallback to the tail in particular can repeat the newest window. On 'expired', consumers should reset or rebase their local pagination state (or deduplicate by event id) before continuing from the returned cursor rather than blindly appending/prepending the fallback page."
        }
      },
      "required": [
        "events",
        "cursor",
        "hasMore",
        "cursorStatus"
      ],
      "additionalProperties": false,
      "description": "Batch of session events returned by a read, with cursor and continuation metadata.",
      "title": "EventsReadResult"
    },
    "ExecuteCommandParams": {
      "type": "object",
      "properties": {
        "commandName": {
          "type": "string",
          "description": "Name of the slash command to invoke (without the leading '/')."
        },
        "args": {
          "type": "string",
          "description": "Argument string to pass to the command (empty string if none)."
        }
      },
      "required": [
        "commandName",
        "args"
      ],
      "additionalProperties": false,
      "description": "Slash command name and argument string to execute synchronously.",
      "title": "ExecuteCommandParams",
      "stability": "experimental"
    },
    "ExecuteCommandResult": {
      "type": "object",
      "properties": {
        "error": {
          "type": "string",
          "description": "Error message produced while executing the command, if any. Omitted when the handler succeeded."
        }
      },
      "additionalProperties": false,
      "description": "Error message produced while executing the command, if any.",
      "title": "ExecuteCommandResult"
    },
    "Extension": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified ID (e.g., 'project:my-ext', 'user:auth-helper', 'plugin:my-plugin:my-ext')"
        },
        "name": {
          "type": "string",
          "description": "Extension name (directory name)"
        },
        "source": {
          "$ref": "#/definitions/ExtensionSource",
          "description": "Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/)"
        },
        "status": {
          "$ref": "#/definitions/ExtensionStatus",
          "description": "Current status: running, disabled, failed, or starting"
        },
        "pid": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 4294967295,
          "description": "Process ID if the extension is running"
        }
      },
      "required": [
        "id",
        "name",
        "source",
        "status"
      ],
      "additionalProperties": false,
      "description": "Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID.",
      "title": "Extension"
    },
    "ExtensionContextPushInput": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "extension_context",
          "description": "Attachment type discriminator"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "description": "Human-readable composer pill label"
        },
        "payload": {
          "description": "Caller-supplied JSON payload (required, may be null but not undefined)",
          "x-opaque-json": true
        }
      },
      "required": [
        "type",
        "title",
        "payload"
      ],
      "additionalProperties": false,
      "description": "Slim input shape for extension_context attachments; identity fields are runtime-derived.",
      "title": "ExtensionContextPushInput"
    },
    "ExtensionLaunchProfile": {
      "type": "object",
      "properties": {
        "executable": {
          "type": "string",
          "minLength": 1,
          "description": "Executable used to launch the extension entrypoint."
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Opaque integrator-defined arguments passed to the executable. The runtime does not append the extension entrypoint."
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Opaque integrator-defined environment variables. Runtime-owned COPILOT_SDK_PATH, SESSION_ID, and COPILOT_EXTENSION_PARENT_PID values take precedence."
        }
      },
      "required": [
        "executable",
        "args",
        "env"
      ],
      "additionalProperties": false,
      "description": "Opaque integrator-owned process launch profile for one extension entrypoint.",
      "title": "ExtensionLaunchProfile",
      "stability": "experimental"
    },
    "ExtensionLaunchProviderResolveRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified extension identifier."
        },
        "name": {
          "type": "string",
          "description": "Human-readable extension name."
        },
        "modulePath": {
          "type": "string",
          "description": "Absolute path to the discovered extension entrypoint."
        },
        "source": {
          "$ref": "#/definitions/ExtensionSource",
          "description": "Discovery source for the extension entrypoint."
        }
      },
      "required": [
        "id",
        "name",
        "modulePath",
        "source"
      ],
      "additionalProperties": false,
      "description": "A discovered extension entrypoint that the registered integrator may classify and resolve to an opaque launch profile.",
      "title": "ExtensionLaunchProviderResolveRequest",
      "stability": "experimental"
    },
    "ExtensionLaunchProviderResolveResult": {
      "type": "object",
      "properties": {
        "launch": {
          "$ref": "#/definitions/ExtensionLaunchProfile",
          "description": "Opaque launch profile, omitted when this provider does not support the entrypoint."
        }
      },
      "additionalProperties": false,
      "description": "The launch profile for a supported entrypoint. Omit launch when the provider does not support the entrypoint.",
      "title": "ExtensionLaunchProviderResolveResult",
      "stability": "experimental"
    },
    "ExtensionList": {
      "type": "object",
      "properties": {
        "extensions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Extension",
            "description": "Discovered extension metadata, including source-qualified ID, name, discovery source, status, and optional process ID."
          },
          "description": "Discovered extensions and their current status"
        }
      },
      "required": [
        "extensions"
      ],
      "additionalProperties": false,
      "description": "Extensions discovered for the session, with their current status.",
      "title": "ExtensionList"
    },
    "ExtensionsDisableRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified extension ID to disable"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Source-qualified extension identifier to disable for the session.",
      "title": "ExtensionsDisableRequest",
      "stability": "experimental"
    },
    "ExtensionsEnableRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Source-qualified extension ID to enable"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Source-qualified extension identifier to enable for the session.",
      "title": "ExtensionsEnableRequest",
      "stability": "experimental"
    },
    "ExtensionSource": {
      "type": "string",
      "enum": [
        "project",
        "user",
        "plugin",
        "session"
      ],
      "description": "Discovery source: project (.github/extensions/), user (~/.copilot/extensions/), plugin (installed plugin), or session (session-state/<id>/extensions/)",
      "title": "ExtensionSource",
      "x-enumDescriptions": {
        "project": "Extension discovered from the current project's .github/extensions directory.",
        "user": "Extension discovered from the user's ~/.copilot/extensions directory.",
        "plugin": "Extension contributed by an installed plugin.",
        "session": "Extension discovered from the current session's state directory (loaded only for this session)."
      }
    },
    "ExtensionStatus": {
      "type": "string",
      "enum": [
        "running",
        "disabled",
        "failed",
        "starting"
      ],
      "description": "Current status: running, disabled, failed, or starting",
      "title": "ExtensionStatus",
      "x-enumDescriptions": {
        "running": "The extension process is running.",
        "disabled": "The extension is installed but disabled.",
        "failed": "The extension failed to start or crashed.",
        "starting": "The extension process is starting."
      }
    },
    "ExternalToolResult": {
      "anyOf": [
        {
          "type": "string",
          "description": "Simple string tool result"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlm",
          "description": "Expanded external tool result payload"
        }
      ],
      "description": "Tool call result (string or expanded result object)",
      "title": "ExternalToolResult",
      "x-opaque-json": true
    },
    "ExternalToolTextResultForLlm": {
      "type": "object",
      "properties": {
        "textResultForLlm": {
          "type": "string",
          "description": "Text result returned to the model"
        },
        "resultType": {
          "type": "string",
          "description": "Execution outcome classification. Optional for back-compat; normalized to 'success' (or 'failure' when error is present) when missing or unrecognized."
        },
        "error": {
          "type": "string",
          "description": "Optional error message for failed executions"
        },
        "sessionLog": {
          "type": "string",
          "description": "Detailed log content for timeline display"
        },
        "toolTelemetry": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Optional tool-specific telemetry"
        },
        "binaryResultsForLlm": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalToolTextResultForLlmBinaryResultsForLlm",
            "description": "Binary result returned by a tool for the model"
          },
          "description": "Base64-encoded binary results returned to the model"
        },
        "contents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalToolTextResultForLlmContent",
            "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource"
          },
          "description": "Structured content blocks from the tool"
        },
        "toolReferences": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool references returned by a tool-search override: names of deferred tools to surface to the model. When set, the tool result is materialized as `tool_reference` content blocks (rather than plain text) so the model knows which deferred tools are now available."
        }
      },
      "required": [
        "textResultForLlm"
      ],
      "description": "Expanded external tool result payload",
      "title": "ExternalToolTextResultForLlm"
    },
    "ExternalToolTextResultForLlmBinaryResultsForLlm": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/ExternalToolTextResultForLlmBinaryResultsForLlmType",
          "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data."
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded binary data",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the binary data"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the binary data"
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Optional metadata from the producing tool."
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Binary result returned by a tool for the model",
      "title": "ExternalToolTextResultForLlmBinaryResultsForLlm"
    },
    "ExternalToolTextResultForLlmBinaryResultsForLlmType": {
      "type": "string",
      "enum": [
        "image",
        "resource"
      ],
      "description": "Binary result type discriminator. Use \"image\" for images and \"resource\" for other binary data.",
      "title": "ExternalToolTextResultForLlmBinaryResultsForLlmType",
      "x-enumDescriptions": {
        "image": "Binary image data.",
        "resource": "Other binary resource data."
      }
    },
    "ExternalToolTextResultForLlmContent": {
      "anyOf": [
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentText",
          "description": "Plain text content block"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentTerminal",
          "description": "Terminal/shell output content block with optional exit code and working directory"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentShellExit",
          "description": "Shell command exit metadata with optional output preview"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentImage",
          "description": "Image content block with base64-encoded data"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentAudio",
          "description": "Audio content block with base64-encoded data"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentResourceLink",
          "description": "Resource link content block referencing an external resource"
        },
        {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentResource",
          "description": "Embedded resource content block with inline text or binary data"
        }
      ],
      "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource",
      "title": "ExternalToolTextResultForLlmContent"
    },
    "ExternalToolTextResultForLlmContentAudio": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "audio",
          "description": "Content block type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded audio data",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the audio (e.g., audio/wav, audio/mpeg)"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Audio content block with base64-encoded data",
      "title": "ExternalToolTextResultForLlmContentAudio"
    },
    "ExternalToolTextResultForLlmContentImage": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "image",
          "description": "Content block type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded image data",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the image (e.g., image/png, image/jpeg)"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Image content block with base64-encoded data",
      "title": "ExternalToolTextResultForLlmContentImage"
    },
    "ExternalToolTextResultForLlmContentResource": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "resource",
          "description": "Content block type discriminator"
        },
        "resource": {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentResourceDetails",
          "description": "The embedded resource contents, either text or base64-encoded binary"
        }
      },
      "required": [
        "type",
        "resource"
      ],
      "additionalProperties": false,
      "description": "Embedded resource content block with inline text or binary data",
      "title": "ExternalToolTextResultForLlmContentResource"
    },
    "ExternalToolTextResultForLlmContentResourceDetails": {
      "anyOf": [
        {
          "$ref": "#/definitions/EmbeddedTextResourceContents",
          "description": "Embedded text resource contents identified by a URI, with an optional MIME type and a text payload."
        },
        {
          "$ref": "#/definitions/EmbeddedBlobResourceContents",
          "description": "Embedded binary resource contents identified by a URI, with an optional MIME type and a base64-encoded blob."
        }
      ],
      "description": "The embedded resource contents, either text or base64-encoded binary",
      "title": "ExternalToolTextResultForLlmContentResourceDetails",
      "x-opaque-json": true
    },
    "ExternalToolTextResultForLlmContentResourceLink": {
      "type": "object",
      "properties": {
        "icons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalToolTextResultForLlmContentResourceLinkIcon",
            "description": "Icon image for a resource"
          },
          "description": "Icons associated with this resource"
        },
        "name": {
          "type": "string",
          "description": "Resource name identifier"
        },
        "title": {
          "type": "string",
          "description": "Human-readable display title for the resource"
        },
        "uri": {
          "type": "string",
          "description": "URI identifying the resource"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the resource"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the resource content"
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "Size of the resource in bytes"
        },
        "type": {
          "type": "string",
          "const": "resource_link",
          "description": "Content block type discriminator"
        }
      },
      "required": [
        "name",
        "uri",
        "type"
      ],
      "additionalProperties": false,
      "description": "Resource link content block referencing an external resource",
      "title": "ExternalToolTextResultForLlmContentResourceLink"
    },
    "ExternalToolTextResultForLlmContentResourceLinkIcon": {
      "type": "object",
      "properties": {
        "src": {
          "type": "string",
          "description": "URL or path to the icon image"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the icon image"
        },
        "sizes": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Available icon sizes (e.g., ['16x16', '32x32'])"
        },
        "theme": {
          "$ref": "#/definitions/ExternalToolTextResultForLlmContentResourceLinkIconTheme",
          "description": "Theme variant this icon is intended for"
        }
      },
      "required": [
        "src"
      ],
      "additionalProperties": false,
      "description": "Icon image for a resource",
      "title": "ExternalToolTextResultForLlmContentResourceLinkIcon"
    },
    "ExternalToolTextResultForLlmContentResourceLinkIconTheme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ],
      "description": "Theme variant this icon is intended for",
      "title": "ExternalToolTextResultForLlmContentResourceLinkIconTheme",
      "x-enumDescriptions": {
        "light": "Icon intended for light themes.",
        "dark": "Icon intended for dark themes."
      }
    },
    "ExternalToolTextResultForLlmContentShellExit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "shell_exit",
          "description": "Content block type discriminator"
        },
        "shellId": {
          "type": "string",
          "description": "Shell id, as assigned by Copilot runtime"
        },
        "exitCode": {
          "type": "integer",
          "description": "Exit code from the completed shell command"
        },
        "cwd": {
          "type": "string",
          "description": "Working directory where the shell command was executed"
        },
        "outputPreview": {
          "type": "string",
          "description": "Output associated with this shell command, if available. May be partial, truncated, or a preview; not guaranteed to be full output."
        },
        "outputTruncated": {
          "type": "boolean",
          "description": "Whether outputPreview is known to be incomplete or truncated"
        },
        "outputFilePath": {
          "type": "string",
          "description": "Path reported in the shell session's filesystem namespace when shell output exceeded the configured large-output threshold."
        }
      },
      "required": [
        "type",
        "shellId",
        "exitCode"
      ],
      "additionalProperties": false,
      "description": "Shell command exit metadata with optional output preview",
      "title": "ExternalToolTextResultForLlmContentShellExit"
    },
    "ExternalToolTextResultForLlmContentTerminal": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "terminal",
          "description": "Content block type discriminator"
        },
        "text": {
          "type": "string",
          "description": "Terminal/shell output text"
        },
        "exitCode": {
          "type": "integer",
          "description": "Process exit code, if the command has completed"
        },
        "cwd": {
          "type": "string",
          "description": "Working directory where the command was executed"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "description": "Terminal/shell output content block with optional exit code and working directory",
      "title": "ExternalToolTextResultForLlmContentTerminal"
    },
    "ExternalToolTextResultForLlmContentText": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "text",
          "description": "Content block type discriminator"
        },
        "text": {
          "type": "string",
          "description": "The text content"
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false,
      "description": "Plain text content block",
      "title": "ExternalToolTextResultForLlmContentText"
    },
    "FactoryAbortRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Parameters for cooperatively aborting a factory body.",
      "title": "FactoryAbortRequest",
      "stability": "experimental"
    },
    "FactoryAckResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Acknowledgement that a factory request was accepted.",
      "title": "FactoryAckResult"
    },
    "FactoryAgentOptions": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "Optional label distinguishing otherwise identical memoized agent calls."
        },
        "schema": {
          "description": "Optional JSON Schema for structured agent output.",
          "x-opaque-json": true
        },
        "model": {
          "type": "string",
          "description": "Optional model identifier for the subagent."
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Optional reasoning effort for the subagent. This field is accepted but not yet honored."
        },
        "contextTier": {
          "$ref": "#/definitions/ContextTier",
          "description": "Optional context tier for the subagent. This field is accepted but not yet honored."
        },
        "agent": {
          "type": "string",
          "description": "Optional custom agent name for the subagent. This field is accepted but not yet honored."
        }
      },
      "additionalProperties": false,
      "description": "Options for one factory-scoped subagent call.",
      "title": "FactoryAgentOptions",
      "stability": "experimental"
    },
    "FactoryAgentRequest": {
      "type": "object",
      "properties": {
        "factoryRunId": {
          "type": "string",
          "description": "Factory run identifier that owns the subagent."
        },
        "executionToken": {
          "type": "string",
          "description": "Opaque token identifying the current factory execution attempt."
        },
        "prompt": {
          "type": "string",
          "description": "Prompt to send to the subagent."
        },
        "opts": {
          "$ref": "#/definitions/FactoryAgentOptions",
          "description": "Subagent execution options."
        }
      },
      "required": [
        "factoryRunId",
        "executionToken",
        "prompt",
        "opts"
      ],
      "additionalProperties": false,
      "description": "Parameters for one factory-scoped subagent call.",
      "title": "FactoryAgentRequest",
      "stability": "experimental"
    },
    "FactoryAgentResult": {
      "type": "object",
      "properties": {
        "result": {
          "description": "Agent result, omitted when the agent produced no result.",
          "x-opaque-json": true
        }
      },
      "additionalProperties": false,
      "description": "Result of one factory-scoped subagent call.",
      "title": "FactoryAgentResult"
    },
    "FactoryAgentSummary": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "description": "Stable direct-agent identifier."
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool-call identifier that launched the agent."
        },
        "runId": {
          "type": "string",
          "description": "Owning factory run identifier."
        },
        "phaseId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Phase identifier active when the agent was launched, or null."
        },
        "label": {
          "type": "string",
          "description": "Friendly, non-unique name intended for display"
        },
        "displayName": {
          "type": "string",
          "description": "Friendly, non-unique name intended for display"
        },
        "agentType": {
          "type": "string",
          "description": "Registered agent type."
        },
        "status": {
          "type": "string",
          "description": "Current durable or live agent status."
        },
        "requestedModel": {
          "type": "string",
          "description": "Model requested when the agent was launched."
        },
        "resolvedModel": {
          "type": "string",
          "description": "Concrete model resolved for the agent."
        },
        "startedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the agent started."
        },
        "completedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the agent completed."
        },
        "activeMs": {
          "type": "integer",
          "description": "Accumulated active agent time in milliseconds."
        },
        "activity": {
          "type": "string",
          "description": "Prompt-safe live activity text."
        }
      },
      "required": [
        "agentId",
        "toolCallId",
        "runId",
        "phaseId",
        "label",
        "agentType",
        "status",
        "activeMs"
      ],
      "additionalProperties": false,
      "description": "Prompt-safe durable identity and live status for a direct factory agent.",
      "title": "FactoryAgentSummary",
      "stability": "experimental"
    },
    "FactoryCancelRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Parameters for cancelling a factory run.",
      "title": "FactoryCancelRequest",
      "stability": "experimental"
    },
    "FactoryCurrentPhase": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Current phase identifier."
        },
        "ordinal": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Zero-based declared phase ordinal, or null for an undeclared phase."
        }
      },
      "required": [
        "id",
        "ordinal"
      ],
      "additionalProperties": false,
      "description": "Current factory phase identity.",
      "title": "FactoryCurrentPhase",
      "stability": "experimental"
    },
    "FactoryDeclaredLimits": {
      "type": "object",
      "properties": {
        "maxConcurrentSubagents": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum concurrently active subagents."
        },
        "maxTotalSubagents": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum total subagents spawned by the run."
        },
        "timeoutSeconds": {
          "type": "number",
          "description": "Maximum accumulated active execution time in seconds."
        },
        "maxAiCredits": {
          "type": "number",
          "description": "Maximum AI credits consumed by subagents and descendants."
        }
      },
      "additionalProperties": false,
      "description": "Declared or approved factory resource ceilings.",
      "title": "FactoryDeclaredLimits",
      "stability": "experimental"
    },
    "FactoryDurableOperation": {
      "type": "string",
      "enum": [
        "createRun",
        "markRunStarted",
        "finishRun",
        "reserveAgent",
        "releaseAgent",
        "chargeCredit",
        "addElapsed",
        "reconcileCreditTotal",
        "journalGet",
        "journalPut",
        "refreshLease"
      ],
      "description": "Execution-critical factory storage operation.",
      "title": "FactoryDurableOperation",
      "x-enumDescriptions": {
        "createRun": "Creating the durable run and declared phases.",
        "markRunStarted": "Persisting the transition to running.",
        "finishRun": "Persisting the terminal run envelope.",
        "reserveAgent": "Persisting subagent admission accounting.",
        "releaseAgent": "Rolling back an uncommitted subagent admission.",
        "chargeCredit": "Persisting an idempotent model-usage charge.",
        "addElapsed": "Persisting active execution time.",
        "reconcileCreditTotal": "Reading the authoritative AI-credit total.",
        "journalGet": "Reading a journal entry without treating storage failure as a cache miss.",
        "journalPut": "Persisting a journal entry before reporting success.",
        "refreshLease": "Renewing the durable owner lease that proves this process still owns the run."
      }
    },
    "FactoryExecuteRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Registered factory name."
        },
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "executionToken": {
          "type": "string",
          "description": "Opaque token identifying this factory execution attempt."
        },
        "args": {
          "description": "Factory input value.",
          "x-opaque-json": true
        }
      },
      "required": [
        "name",
        "runId",
        "executionToken",
        "args"
      ],
      "additionalProperties": false,
      "description": "Parameters sent to the owning extension to execute a factory closure.",
      "title": "FactoryExecuteRequest",
      "stability": "experimental"
    },
    "FactoryExecuteResult": {
      "type": "object",
      "properties": {
        "result": {
          "description": "Factory result value.",
          "x-opaque-json": true
        }
      },
      "additionalProperties": false,
      "description": "Result returned by an extension factory closure.",
      "title": "FactoryExecuteResult"
    },
    "FactoryGetRunProgressRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "phaseId": {
          "type": "string",
          "description": "Optional phase identifier used to scope records and cursors."
        },
        "afterSeq": {
          "type": "integer",
          "description": "Exclusive forward cursor."
        },
        "beforeSeq": {
          "type": "integer",
          "description": "Exclusive backward cursor."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Maximum records to return. Defaults to 200 and is capped at 500."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Parameters for paging factory progress.",
      "title": "FactoryGetRunProgressRequest",
      "stability": "experimental"
    },
    "FactoryGetRunRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Parameters for retrieving a factory run.",
      "title": "FactoryGetRunRequest",
      "stability": "experimental"
    },
    "FactoryJournalGetRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "executionToken": {
          "type": "string",
          "description": "Opaque token identifying the current factory execution attempt."
        },
        "key": {
          "type": "string",
          "description": "Namespaced journal key."
        }
      },
      "required": [
        "runId",
        "executionToken",
        "key"
      ],
      "additionalProperties": false,
      "description": "Parameters for reading a factory journal entry.",
      "title": "FactoryJournalGetRequest",
      "stability": "experimental"
    },
    "FactoryJournalGetResult": {
      "type": "object",
      "properties": {
        "hit": {
          "type": "boolean",
          "description": "Whether the journal contained the requested key."
        },
        "resultJson": {
          "description": "Cached JSON result. The hit field distinguishes a cached JSON null from a miss.",
          "x-opaque-json": true
        }
      },
      "required": [
        "hit"
      ],
      "additionalProperties": false,
      "description": "Result of reading a factory journal entry.",
      "title": "FactoryJournalGetResult"
    },
    "FactoryJournalPutRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "executionToken": {
          "type": "string",
          "description": "Opaque token identifying the current factory execution attempt."
        },
        "key": {
          "type": "string",
          "description": "Namespaced journal key."
        },
        "resultJson": {
          "description": "JSON result to memoize.",
          "x-opaque-json": true
        }
      },
      "required": [
        "runId",
        "executionToken",
        "key",
        "resultJson"
      ],
      "additionalProperties": false,
      "description": "Parameters for storing a factory journal entry.",
      "title": "FactoryJournalPutRequest",
      "stability": "experimental"
    },
    "FactoryListRunsRequest": {
      "type": "object",
      "properties": {
        "afterSeq": {
          "type": "integer",
          "description": "Exclusive forward cursor."
        },
        "beforeSeq": {
          "type": "integer",
          "description": "Exclusive backward cursor."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "maximum": 500,
          "description": "Maximum terminal runs to return. Defaults to 200 and is capped at 500."
        }
      },
      "additionalProperties": false,
      "description": "Parameters for paging factory runs.",
      "title": "FactoryListRunsRequest",
      "stability": "experimental"
    },
    "FactoryListRunsResult": {
      "type": "object",
      "properties": {
        "runs": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FactoryRunSummary",
            "description": "Durable factory run summary with read-time live overlays."
          },
          "description": "Factory run summaries in durable creation order."
        },
        "oldestSeq": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Oldest terminal-run cursor in this page, or null when the terminal window is empty."
        },
        "newestSeq": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Newest terminal-run cursor in this page, or null when the terminal window is empty."
        },
        "hasMoreNewer": {
          "type": "boolean",
          "description": "Whether terminal runs newer than this page exist."
        },
        "omittedOlder": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of terminal runs older than this page."
        }
      },
      "required": [
        "runs"
      ],
      "additionalProperties": false,
      "description": "A page of factory runs in durable creation order.",
      "title": "FactoryListRunsResult",
      "stability": "experimental"
    },
    "FactoryLogLine": {
      "type": "object",
      "properties": {
        "seq": {
          "type": "integer",
          "minimum": 0,
          "description": "Monotonic sequence number within the factory run."
        },
        "kind": {
          "$ref": "#/definitions/FactoryLogLineKind",
          "description": "Progress line kind."
        },
        "text": {
          "type": "string",
          "description": "Progress text."
        }
      },
      "required": [
        "seq",
        "kind",
        "text"
      ],
      "additionalProperties": false,
      "description": "One ordered factory progress line.",
      "title": "FactoryLogLine",
      "stability": "experimental"
    },
    "FactoryLogLineKind": {
      "type": "string",
      "enum": [
        "log",
        "phase"
      ],
      "description": "Kind of factory progress line.",
      "title": "FactoryLogLineKind",
      "x-enumDescriptions": {
        "log": "A narrator log line.",
        "phase": "A named factory phase marker."
      }
    },
    "FactoryLogRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "executionToken": {
          "type": "string",
          "description": "Opaque token identifying the current factory execution attempt."
        },
        "lines": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FactoryLogLine",
            "description": "One ordered factory progress line."
          },
          "description": "Ordered progress lines to append."
        }
      },
      "required": [
        "runId",
        "executionToken",
        "lines"
      ],
      "additionalProperties": false,
      "description": "Parameters for recording factory progress.",
      "title": "FactoryLogRequest",
      "stability": "experimental"
    },
    "FactoryPhaseObservation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Phase identifier."
        },
        "ordinal": {
          "type": [
            "integer",
            "null"
          ],
          "minimum": 0,
          "description": "Zero-based declared phase ordinal, or null for an undeclared phase."
        },
        "title": {
          "type": "string",
          "description": "Human-readable phase title."
        },
        "detail": {
          "type": "string",
          "description": "Optional human-readable phase detail."
        },
        "status": {
          "$ref": "#/definitions/FactoryPhaseStatus",
          "description": "Derived lifecycle state of the phase."
        },
        "lastEnteredRunAttempt": {
          "type": "integer",
          "minimum": 0,
          "description": "Most recent run attempt that entered this phase, or `0` if the phase has never been entered."
        },
        "entryCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of times execution entered this phase."
        },
        "startedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when this phase first started; for a skipped phase, the synthetic skip timestamp (equal to `completedAt`)."
        },
        "completedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when this phase completed; for a skipped phase, the synthetic skip timestamp (equal to `startedAt`)."
        },
        "accumulatedActiveMs": {
          "type": "integer",
          "description": "Completed active time accumulated by this phase in milliseconds."
        },
        "currentActiveMs": {
          "type": "integer",
          "description": "Current live active time for this phase in milliseconds."
        },
        "totalAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total direct agents associated with this phase."
        },
        "liveAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Direct agents in this phase that are currently live."
        }
      },
      "required": [
        "id",
        "ordinal",
        "title",
        "status",
        "lastEnteredRunAttempt",
        "entryCount",
        "accumulatedActiveMs",
        "currentActiveMs",
        "totalAgentCount",
        "liveAgentCount"
      ],
      "additionalProperties": false,
      "description": "Durable lifecycle and timing for one factory phase.",
      "title": "FactoryPhaseObservation",
      "stability": "experimental"
    },
    "FactoryPhaseStatus": {
      "type": "string",
      "enum": [
        "pending",
        "active",
        "completed",
        "skipped"
      ],
      "description": "Derived lifecycle state of a factory phase.",
      "title": "FactoryPhaseStatus",
      "x-enumDescriptions": {
        "pending": "The phase has not been entered yet.",
        "active": "The phase is currently entered and accumulating active time.",
        "completed": "The phase was entered and has since been closed.",
        "skipped": "The phase was never entered because a later phase was entered or the run reached a terminal state."
      },
      "stability": "experimental"
    },
    "FactoryProgressLine": {
      "type": "object",
      "properties": {
        "seq": {
          "type": "integer",
          "minimum": 1,
          "description": "Global monotonic sequence number within the run."
        },
        "attempt": {
          "type": "integer",
          "minimum": 1,
          "description": "Resume attempt that emitted this record."
        },
        "phaseId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Phase active when the record was emitted, or null before any phase."
        },
        "recordedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the record was persisted."
        },
        "kind": {
          "$ref": "#/definitions/FactoryLogLineKind",
          "description": "Progress record kind."
        },
        "text": {
          "type": "string",
          "description": "Prompt-safe progress text."
        }
      },
      "required": [
        "seq",
        "attempt",
        "phaseId",
        "recordedAt",
        "kind",
        "text"
      ],
      "additionalProperties": false,
      "description": "One durable factory progress record.",
      "title": "FactoryProgressLine",
      "stability": "experimental"
    },
    "FactoryProgressPage": {
      "type": "object",
      "properties": {
        "records": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FactoryProgressLine",
            "description": "One durable factory progress record."
          },
          "description": "Progress records in sequence order."
        },
        "oldestSeq": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Oldest sequence number in this page, or null when empty."
        },
        "newestSeq": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Newest sequence number in this page, or null when empty."
        },
        "hasMoreOlder": {
          "type": "boolean",
          "description": "Whether progress records older than this page exist."
        },
        "hasMoreNewer": {
          "type": "boolean",
          "description": "Whether progress records newer than this page exist."
        },
        "revision": {
          "type": "integer",
          "minimum": 0,
          "description": "Run revision reflected by this page."
        }
      },
      "required": [
        "records",
        "oldestSeq",
        "newestSeq",
        "hasMoreOlder",
        "hasMoreNewer",
        "revision"
      ],
      "additionalProperties": false,
      "description": "A bidirectional page of factory progress.",
      "title": "FactoryProgressPage",
      "stability": "experimental"
    },
    "FactoryResumeRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "limits": {
          "$ref": "#/definitions/FactoryRunLimits",
          "description": "Optional per-invocation resource ceiling overrides."
        },
        "notifyOnComplete": {
          "type": "boolean",
          "description": "Whether to notify the originating session when the factory completes."
        },
        "logPhaseNames": {
          "type": "boolean",
          "description": "Whether to emit factory phase names to the session transcript."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Parameters for resuming a factory run from its persisted identity.",
      "title": "FactoryResumeRequest",
      "stability": "experimental"
    },
    "FactoryResumeResult": {
      "type": "object",
      "properties": {
        "factoryName": {
          "type": "string",
          "description": "Persisted factory name resolved for the resumed run."
        },
        "run": {
          "$ref": "#/definitions/FactoryRunResult",
          "description": "Terminal resumed run envelope."
        }
      },
      "required": [
        "factoryName",
        "run"
      ],
      "additionalProperties": false,
      "description": "Resolved persisted factory identity and resumed run envelope.",
      "title": "FactoryResumeResult"
    },
    "FactoryRunConsumed": {
      "type": "object",
      "properties": {
        "activeMs": {
          "type": "integer",
          "description": "Accumulated active execution time in milliseconds."
        },
        "subagents": {
          "type": "integer",
          "minimum": 0,
          "description": "Total subagents spawned by the run."
        },
        "nanoAiu": {
          "type": "integer",
          "description": "AI usage consumed by the run in nano-AIU."
        }
      },
      "required": [
        "activeMs",
        "subagents",
        "nanoAiu"
      ],
      "additionalProperties": false,
      "description": "Durable factory resource consumption.",
      "title": "FactoryRunConsumed",
      "stability": "experimental"
    },
    "FactoryRunDetail": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "factoryName": {
          "type": "string",
          "description": "Registered factory name."
        },
        "description": {
          "type": "string",
          "description": "Human-readable factory description."
        },
        "status": {
          "$ref": "#/definitions/FactoryRunStatus",
          "description": "Current factory run status."
        },
        "revision": {
          "type": "integer",
          "description": "Monotonic durable run revision."
        },
        "createdAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the run was created."
        },
        "startedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when execution first started, or null before start."
        },
        "updatedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the durable run was last updated."
        },
        "completedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when the run completed, or null while nonterminal."
        },
        "currentPhase": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryCurrentPhase",
              "description": "Current factory phase identity."
            },
            {
              "type": "null"
            }
          ],
          "description": "Current phase identity, or null before any phase is entered."
        },
        "declaredPhaseCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of phases declared by the factory."
        },
        "liveAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of direct factory agents currently live."
        },
        "totalSpawnedAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total direct factory agents spawned across all attempts."
        },
        "consumed": {
          "$ref": "#/definitions/FactoryRunConsumed",
          "description": "Durable resource consumption."
        },
        "declaredLimits": {
          "$ref": "#/definitions/FactoryDeclaredLimits",
          "description": "Resource ceilings declared by the factory."
        },
        "approved": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryDeclaredLimits",
              "description": "Declared or approved factory resource ceilings."
            },
            {
              "type": "null"
            }
          ],
          "description": "Approved effective resource ceilings, or null until approved."
        },
        "observedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when this live-overlay snapshot was observed."
        },
        "activeSegmentStartedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when the current active segment started, or null while inactive."
        },
        "terminal": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryRunTerminal",
              "description": "Prompt-safe terminal factory outcome."
            },
            {
              "type": "null"
            }
          ],
          "description": "Terminal run outcome, or null while nonterminal."
        },
        "phases": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FactoryPhaseObservation",
            "description": "Durable lifecycle and timing for one factory phase."
          },
          "description": "Lifecycle and timing observations for each factory phase."
        },
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/FactoryAgentSummary",
            "description": "Prompt-safe durable identity and live status for a direct factory agent."
          },
          "description": "Durable identities and live statuses for direct factory agents."
        },
        "progress": {
          "$ref": "#/definitions/FactoryProgressPage",
          "description": "Bidirectional page of durable factory progress."
        }
      },
      "required": [
        "runId",
        "factoryName",
        "description",
        "status",
        "revision",
        "createdAt",
        "startedAt",
        "updatedAt",
        "completedAt",
        "currentPhase",
        "declaredPhaseCount",
        "liveAgentCount",
        "totalSpawnedAgentCount",
        "consumed",
        "declaredLimits",
        "approved",
        "observedAt",
        "activeSegmentStartedAt",
        "terminal",
        "phases",
        "agents",
        "progress"
      ],
      "additionalProperties": false,
      "description": "Full factory run observability detail.",
      "title": "FactoryRunDetail",
      "stability": "experimental"
    },
    "FactoryRunFailure": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "kind": {
              "$ref": "#/definitions/FactoryRunFailureKind",
              "description": "Resource ceiling that stopped the run."
            },
            "value": {
              "type": "number",
              "exclusiveMinimum": 0,
              "description": "Approved effective ceiling that was reached."
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "type": {
              "type": "string",
              "const": "factory_limit_reached",
              "description": "Factory failure variant discriminator."
            }
          },
          "required": [
            "type",
            "kind",
            "value",
            "runId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "runId": {
              "type": "string",
              "description": "Factory run identifier whose changed limits were declined."
            },
            "reason": {
              "type": "string",
              "description": "Human-readable reason the resume did not proceed."
            },
            "type": {
              "type": "string",
              "const": "factory_resume_declined",
              "description": "Factory failure variant discriminator."
            }
          },
          "required": [
            "type",
            "runId",
            "reason"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "code": {
              "type": "string",
              "description": "Stable failure code."
            },
            "operation": {
              "$ref": "#/definitions/FactoryDurableOperation",
              "description": "Execution-critical durable operation that failed."
            },
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "type": {
              "type": "string",
              "const": "factory_durable_failure",
              "description": "Factory failure variant discriminator."
            }
          },
          "required": [
            "type",
            "code",
            "operation",
            "runId"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "drainedNanoAiu": {
              "type": "integer",
              "description": "Confirmed usage in nano-AIU, representing the floor of what the run spent."
            },
            "type": {
              "type": "string",
              "const": "factory_accounting_incomplete",
              "description": "Factory failure variant discriminator."
            }
          },
          "required": [
            "type",
            "runId",
            "drainedNanoAiu"
          ],
          "additionalProperties": false,
          "description": "The run stopped because its usage accounting could not be completed."
        },
        {
          "type": "object",
          "properties": {
            "runId": {
              "type": "string",
              "description": "Factory run identifier."
            },
            "type": {
              "type": "string",
              "const": "factory_provider_disconnected",
              "description": "Factory failure variant discriminator."
            }
          },
          "required": [
            "type",
            "runId"
          ],
          "additionalProperties": false,
          "description": "The extension that owns the factory disconnected while the run was executing, so the host halted it. The run's journaled subagent results are preserved so a resume can reuse them."
        }
      ],
      "description": "Machine-readable factory run failure.",
      "title": "FactoryRunFailure"
    },
    "FactoryRunFailureKind": {
      "type": "string",
      "enum": [
        "maxTotalSubagents",
        "timeoutSeconds",
        "maxAiCredits"
      ],
      "description": "Cumulative resource ceiling that stopped a factory run.",
      "title": "FactoryRunFailureKind",
      "x-enumDescriptions": {
        "maxTotalSubagents": "The run admitted the approved maximum total number of subagents.",
        "timeoutSeconds": "The run reached the approved accumulated active-execution time in seconds.",
        "maxAiCredits": "The run's settled subagent model usage exceeded the approved AI-credit ceiling, or no headroom remained for another subagent."
      }
    },
    "FactoryRunLimits": {
      "type": "object",
      "properties": {
        "maxConcurrentSubagents": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": 0,
          "description": "Maximum number of factory subagents that may run concurrently."
        },
        "maxTotalSubagents": {
          "type": "integer",
          "minimum": 0,
          "exclusiveMinimum": 0,
          "description": "Maximum total number of factory subagents that may be admitted."
        },
        "timeoutSeconds": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 2147483.647,
          "description": "Maximum accumulated active-execution time in seconds. Active execution includes the entire extension body, subprocess waits, queued-agent waits, and sleeps; time between resumed attempts is not counted."
        },
        "maxAiCredits": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Maximum AI credits consumed by factory subagents and their descendants. The post-paid ceiling is soft: parallel turns can settle beyond it before the run stops."
        }
      },
      "additionalProperties": false,
      "description": "Wire-only per-invocation factory resource ceiling overrides.",
      "title": "FactoryRunLimits",
      "stability": "experimental"
    },
    "FactoryRunRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Registered factory name."
        },
        "args": {
          "description": "Factory input value.",
          "x-opaque-json": true
        },
        "options": {
          "$ref": "#/definitions/RunOptions",
          "description": "Factory invocation options."
        }
      },
      "required": [
        "name",
        "args"
      ],
      "additionalProperties": false,
      "description": "Parameters for invoking a registered factory.",
      "title": "FactoryRunRequest",
      "stability": "experimental"
    },
    "FactoryRunResult": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "attempt": {
          "type": "integer",
          "minimum": 1,
          "maximum": 4294967295,
          "description": "One-based execution attempt represented by this envelope. Absent before the first attempt starts or when returned by an older runtime."
        },
        "status": {
          "$ref": "#/definitions/FactoryRunStatus",
          "description": "Current or terminal factory run status."
        },
        "result": {
          "description": "Completed factory result.",
          "x-opaque-json": true
        },
        "error": {
          "type": "string",
          "description": "Error message for an errored run."
        },
        "failure": {
          "$ref": "#/definitions/FactoryRunFailure",
          "description": "Machine-readable failure details for a halted or errored run."
        },
        "reason": {
          "type": "string",
          "description": "Reason for a halted or cancelled run."
        },
        "snapshot": {
          "description": "Partial journal and progress snapshot for a halted, cancelled, or errored run.",
          "x-opaque-json": true
        }
      },
      "required": [
        "runId",
        "status"
      ],
      "additionalProperties": false,
      "description": "Complete current or terminal factory run envelope.",
      "title": "FactoryRunResult"
    },
    "FactoryRunStatus": {
      "type": "string",
      "enum": [
        "pending",
        "running",
        "completed",
        "halted",
        "cancelled",
        "error"
      ],
      "description": "Current or terminal state of a factory run.",
      "title": "FactoryRunStatus",
      "x-enumDescriptions": {
        "pending": "The run was minted and is awaiting approval.",
        "running": "The run is executing.",
        "completed": "The run completed successfully.",
        "halted": "The run was interrupted while resource budget remained.",
        "cancelled": "The run was cancelled before completion.",
        "error": "The factory body failed or reached a cumulative resource ceiling."
      }
    },
    "FactoryRunSummary": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "factoryName": {
          "type": "string",
          "description": "Registered factory name."
        },
        "description": {
          "type": "string",
          "description": "Human-readable factory description."
        },
        "status": {
          "$ref": "#/definitions/FactoryRunStatus",
          "description": "Current factory run status."
        },
        "revision": {
          "type": "integer",
          "description": "Monotonic durable run revision."
        },
        "createdAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the run was created."
        },
        "startedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when execution first started, or null before start."
        },
        "updatedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when the durable run was last updated."
        },
        "completedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when the run completed, or null while nonterminal."
        },
        "currentPhase": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryCurrentPhase",
              "description": "Current factory phase identity."
            },
            {
              "type": "null"
            }
          ],
          "description": "Current phase identity, or null before any phase is entered."
        },
        "declaredPhaseCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of phases declared by the factory."
        },
        "liveAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of direct factory agents currently live."
        },
        "totalSpawnedAgentCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total direct factory agents spawned across all attempts."
        },
        "consumed": {
          "$ref": "#/definitions/FactoryRunConsumed",
          "description": "Durable resource consumption."
        },
        "declaredLimits": {
          "$ref": "#/definitions/FactoryDeclaredLimits",
          "description": "Resource ceilings declared by the factory."
        },
        "approved": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryDeclaredLimits",
              "description": "Declared or approved factory resource ceilings."
            },
            {
              "type": "null"
            }
          ],
          "description": "Approved effective resource ceilings, or null until approved."
        },
        "observedAt": {
          "type": "integer",
          "description": "Epoch milliseconds when this live-overlay snapshot was observed."
        },
        "activeSegmentStartedAt": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Epoch milliseconds when the current active segment started, or null while inactive."
        },
        "terminal": {
          "anyOf": [
            {
              "$ref": "#/definitions/FactoryRunTerminal",
              "description": "Prompt-safe terminal factory outcome."
            },
            {
              "type": "null"
            }
          ],
          "description": "Terminal run outcome, or null while nonterminal."
        }
      },
      "required": [
        "runId",
        "factoryName",
        "description",
        "status",
        "revision",
        "createdAt",
        "startedAt",
        "updatedAt",
        "completedAt",
        "currentPhase",
        "declaredPhaseCount",
        "liveAgentCount",
        "totalSpawnedAgentCount",
        "consumed",
        "declaredLimits",
        "approved",
        "observedAt",
        "activeSegmentStartedAt",
        "terminal"
      ],
      "additionalProperties": false,
      "description": "Durable factory run summary with read-time live overlays.",
      "title": "FactoryRunSummary",
      "stability": "experimental"
    },
    "FactoryRunTerminal": {
      "type": "object",
      "properties": {
        "reason": {
          "type": "string",
          "description": "Human-readable terminal reason."
        },
        "failure": {
          "$ref": "#/definitions/FactoryRunFailure",
          "description": "Machine-readable terminal failure."
        },
        "error": {
          "type": "string",
          "description": "Human-readable terminal error."
        },
        "resultPreview": {
          "type": "string",
          "description": "Prompt-safe preview of the completed result."
        }
      },
      "additionalProperties": false,
      "description": "Prompt-safe terminal factory outcome.",
      "title": "FactoryRunTerminal",
      "stability": "experimental"
    },
    "FactoryToolResumeRequest": {
      "type": "object",
      "properties": {
        "runId": {
          "type": "string",
          "description": "Factory run identifier."
        },
        "limits": {
          "$ref": "#/definitions/FactoryRunLimits",
          "description": "Optional per-invocation resource ceiling overrides."
        },
        "toolCallId": {
          "type": "string",
          "description": "Opaque identifier of the originating tool call."
        }
      },
      "required": [
        "runId"
      ],
      "additionalProperties": false,
      "description": "Internal parameters for resuming a factory run from a tool.",
      "title": "FactoryToolResumeRequest",
      "visibility": "internal",
      "stability": "experimental"
    },
    "FactoryToolRunOptions": {
      "type": "object",
      "properties": {
        "limits": {
          "$ref": "#/definitions/FactoryRunLimits",
          "description": "Per-invocation resource ceiling overrides."
        },
        "resumeFromRunId": {
          "type": "string",
          "description": "Run identifier whose journal and progress should seed this resumed run."
        }
      },
      "additionalProperties": false,
      "description": "Options for an internal tool-originated factory invocation.",
      "title": "FactoryToolRunOptions",
      "visibility": "internal",
      "stability": "experimental"
    },
    "FactoryToolRunRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Registered factory name."
        },
        "args": {
          "description": "Factory input value.",
          "x-opaque-json": true
        },
        "options": {
          "$ref": "#/definitions/FactoryToolRunOptions",
          "description": "Tool-originated factory invocation options."
        },
        "toolCallId": {
          "type": "string",
          "description": "Opaque identifier of the originating tool call."
        }
      },
      "required": [
        "name",
        "args"
      ],
      "additionalProperties": false,
      "description": "Internal parameters for invoking a registered factory from a tool.",
      "title": "FactoryToolRunRequest",
      "visibility": "internal",
      "stability": "experimental"
    },
    "FilterMapping": {
      "anyOf": [
        {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/ContentFilterMode",
            "description": "Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives."
          }
        },
        {
          "$ref": "#/definitions/ContentFilterMode",
          "description": "Controls how MCP tool result content is filtered: none leaves content unchanged, markdown sanitizes HTML while preserving Markdown-friendly output, and hidden_characters removes characters that can hide directives."
        }
      ],
      "description": "Content filtering mode to apply to all tools, or a map of tool name to content filtering mode.",
      "title": "FilterMapping",
      "x-opaque-json": true
    },
    "FleetStartRequest": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "Optional user prompt to combine with fleet instructions"
        }
      },
      "additionalProperties": false,
      "description": "Optional user prompt to combine with the fleet orchestration instructions.",
      "title": "FleetStartRequest",
      "stability": "experimental"
    },
    "FleetStartResult": {
      "type": "object",
      "properties": {
        "started": {
          "type": "boolean",
          "description": "Whether fleet mode was successfully activated"
        }
      },
      "required": [
        "started"
      ],
      "additionalProperties": false,
      "description": "Indicates whether fleet mode was successfully activated.",
      "title": "FleetStartResult"
    },
    "FolderTrustAddParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Folder path to mark as trusted"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Folder path to add to trusted folders.",
      "title": "FolderTrustAddParams",
      "stability": "experimental"
    },
    "FolderTrustCheckParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Folder path to check"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Folder path to check for trust.",
      "title": "FolderTrustCheckParams",
      "stability": "experimental"
    },
    "FolderTrustCheckResult": {
      "type": "object",
      "properties": {
        "trusted": {
          "type": "boolean",
          "description": "Whether the folder is trusted"
        }
      },
      "required": [
        "trusted"
      ],
      "additionalProperties": false,
      "description": "Folder trust check result.",
      "title": "FolderTrustCheckResult"
    },
    "GhCliAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "gh-cli",
          "description": "Authentication via the `gh` CLI's saved credentials."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "login": {
          "type": "string",
          "description": "User login as reported by `gh auth status`."
        },
        "token": {
          "type": "string",
          "description": "The token returned by `gh auth token`. Treat as a secret."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "login",
        "token"
      ],
      "additionalProperties": false,
      "description": "Authentication-info input variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value.",
      "title": "GhCliAuthInfo"
    },
    "GitHubRepoRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Numeric GitHub repository id"
        },
        "name": {
          "type": "string",
          "description": "Repository name (without owner)"
        },
        "owner": {
          "type": "string",
          "description": "Repository owner login (user or organization)"
        }
      },
      "required": [
        "name",
        "owner"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub repository.",
      "title": "GitHubRepoRef"
    },
    "GitHubTelemetryClientInfo": {
      "type": "object",
      "properties": {
        "cli_version": {
          "type": "string",
          "description": "Copilot CLI version string."
        },
        "os_platform": {
          "type": "string",
          "description": "Operating system platform (e.g. darwin, linux, win32)."
        },
        "os_version": {
          "type": "string",
          "description": "Operating system version string."
        },
        "os_arch": {
          "type": "string",
          "description": "Operating system architecture (e.g. arm64, x64)."
        },
        "node_version": {
          "type": "string",
          "description": "Node.js runtime version string."
        },
        "copilot_plan": {
          "type": "string",
          "description": "Copilot subscription plan, when known."
        },
        "client_type": {
          "type": "string",
          "description": "Type of client."
        },
        "client_name": {
          "type": "string",
          "description": "Name of the client application."
        },
        "is_staff": {
          "type": "boolean",
          "description": "Whether the user is a GitHub/Microsoft staff member."
        },
        "dev_device_id": {
          "type": "string",
          "description": "Stable machine identifier for the device."
        },
        "cpu_model": {
          "type": "string",
          "description": "Distinct CPU model names for the host, comma-separated."
        },
        "cpu_count": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of logical CPU cores on the host."
        }
      },
      "required": [
        "cli_version",
        "os_platform",
        "os_version",
        "os_arch",
        "node_version"
      ],
      "additionalProperties": false,
      "description": "Client environment metadata describing the process that produced a telemetry event.",
      "title": "GitHubTelemetryClientInfo",
      "stability": "experimental"
    },
    "GitHubTelemetryEvent": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "Event type/kind (e.g. get_completion_with_tools_turn, tool_call_executed)."
        },
        "created_at": {
          "type": "string",
          "description": "Timestamp when the event was created (ISO 8601 format)."
        },
        "model_call_id": {
          "type": "string",
          "description": "Reference to the model call that produced this event."
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "String-valued properties as a map from key to value."
        },
        "metrics": {
          "type": "object",
          "additionalProperties": {
            "type": "number"
          },
          "description": "Numeric metrics as a map from key to value."
        },
        "exp_assignment_context": {
          "type": "string",
          "description": "Experiment assignment context."
        },
        "features": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Feature flags enabled for this session, as a map from flag to value."
        },
        "session_id": {
          "type": "string",
          "description": "Session identifier the event belongs to."
        },
        "copilot_tracking_id": {
          "type": "string",
          "description": "Copilot tracking ID for user-level attribution."
        },
        "client": {
          "$ref": "#/definitions/GitHubTelemetryClientInfo",
          "description": "Client environment metadata."
        }
      },
      "required": [
        "kind",
        "properties",
        "metrics"
      ],
      "additionalProperties": false,
      "description": "A single telemetry event in the runtime's native GitHub-shaped telemetry format, forwarded verbatim to opted-in hosts. The `restricted` flag on the enclosing GitHubTelemetryNotification distinguishes standard from restricted events; the payload shape is identical for both.",
      "title": "GitHubTelemetryEvent",
      "stability": "experimental"
    },
    "GitHubTelemetryNotification": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session the telemetry event belongs to, when it is session-scoped. Omitted for sessionless events (for example, `server.sendTelemetry` calls with no session id), which are still forwarded to opted-in connections."
        },
        "restricted": {
          "type": "boolean",
          "description": "Whether this is a restricted telemetry event (cli.restricted_telemetry). Hosts must route restricted events to first-party Microsoft stores only."
        },
        "event": {
          "$ref": "#/definitions/GitHubTelemetryEvent",
          "description": "The telemetry event, in the runtime's native GitHub-shaped telemetry format."
        }
      },
      "required": [
        "restricted",
        "event"
      ],
      "additionalProperties": false,
      "description": "Payload for a `gitHubTelemetry.event` notification: a single GitHub telemetry event the runtime forwards to a host connection that opted into telemetry forwarding during the `server.connect` handshake.",
      "title": "GitHubTelemetryNotification",
      "stability": "experimental"
    },
    "GitHubTokenAcquireReason": {
      "type": "string",
      "enum": [
        "initial",
        "refresh"
      ],
      "description": "Why the runtime is requesting a GitHub credential.",
      "title": "GitHubTokenAcquireReason",
      "x-enumDescriptions": {
        "initial": "The runtime is acquiring the registration's first credential.",
        "refresh": "The runtime is replacing a credential that is approaching expiry."
      }
    },
    "GitHubTokenAcquireRequest": {
      "type": "object",
      "properties": {
        "registrationId": {
          "type": "string",
          "description": "Opaque identifier generated by the SDK for this callback registration."
        },
        "host": {
          "type": "string",
          "description": "Effective GitHub host for which the callback must return a token."
        },
        "sessionId": {
          "type": "string",
          "description": "Session receiving the token. Absent only before a cloud session has been assigned its id."
        },
        "reason": {
          "$ref": "#/definitions/GitHubTokenAcquireReason",
          "description": "Why the runtime is requesting a GitHub credential."
        }
      },
      "required": [
        "registrationId",
        "host",
        "reason"
      ],
      "additionalProperties": false,
      "description": "Asks the SDK client to acquire a GitHub access token from an opaque callback registration.",
      "title": "GitHubTokenAcquireRequest",
      "stability": "experimental"
    },
    "GitHubTokenAcquireResult": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "accessToken": {
              "type": "string",
              "description": "GitHub access token acquired by the SDK host."
            },
            "tokenType": {
              "type": "string",
              "description": "OAuth token type. Defaults to bearer when omitted."
            },
            "expiresIn": {
              "type": "integer",
              "minimum": 3601,
              "description": "Remaining token lifetime in seconds when callback execution completes. It must exceed the one-hour preflight refresh threshold."
            },
            "kind": {
              "type": "string",
              "const": "token",
              "description": "GitHub credential response variant discriminator."
            }
          },
          "required": [
            "kind",
            "accessToken",
            "expiresIn"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "cancelled",
              "description": "GitHub credential response variant discriminator."
            }
          },
          "required": [
            "kind"
          ]
        }
      ],
      "description": "SDK host response to a GitHub credential request.",
      "title": "GitHubTokenAcquireResult",
      "stability": "experimental"
    },
    "HandlePendingToolCallRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the pending tool call"
        },
        "result": {
          "$ref": "#/definitions/ExternalToolResult",
          "description": "Tool call result (string or expanded result object)"
        },
        "error": {
          "type": "string",
          "description": "Error message if the tool call failed"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Pending external tool call request ID, with the tool result or an error describing why it failed.",
      "title": "HandlePendingToolCallRequest",
      "stability": "experimental"
    },
    "HandlePendingToolCallResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the tool call result was handled successfully"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the external tool call result was handled successfully.",
      "title": "HandlePendingToolCallResult"
    },
    "HistoryAbortManualCompactionResult": {
      "type": "object",
      "properties": {
        "aborted": {
          "type": "boolean",
          "description": "Whether an in-progress manual compaction was aborted. False when no manual compaction was running, when its abort controller was already aborted, or when the session is remote."
        }
      },
      "required": [
        "aborted"
      ],
      "additionalProperties": false,
      "description": "Indicates whether an in-progress manual compaction was aborted.",
      "title": "HistoryAbortManualCompactionResult"
    },
    "HistoryCancelBackgroundCompactionResult": {
      "type": "object",
      "properties": {
        "cancelled": {
          "type": "boolean",
          "description": "Whether an in-progress background compaction was cancelled. False when no compaction was running, when the session is remote, or when the underlying processor was unavailable."
        }
      },
      "required": [
        "cancelled"
      ],
      "additionalProperties": false,
      "description": "Indicates whether an in-progress background compaction was cancelled.",
      "title": "HistoryCancelBackgroundCompactionResult"
    },
    "HistoryClearContextRequest": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "First user message of the fresh context window. Required: a cleared window holding only system and developer messages is not a conversation a model can answer, so every clear seeds the window it creates. Delivered by the enclosing turn driver once the agentic loop exits, which is why the call must be made from inside a tool handler."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Parameters for clearing the conversation and seeding the window that replaces it.",
      "title": "HistoryClearContextRequest",
      "stability": "experimental"
    },
    "HistoryClearContextResult": {
      "type": "object",
      "properties": {
        "messagesCleared": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of non-system, non-developer messages that were removed from the conversation. Zero only when the window already held no conversation."
        }
      },
      "required": [
        "messagesCleared"
      ],
      "additionalProperties": false,
      "description": "What a successful clear removed. A clear that could not be applied rejects instead of reporting a count.",
      "title": "HistoryClearContextResult"
    },
    "HistoryCompactContextWindow": {
      "type": "object",
      "properties": {
        "tokenLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum token count for the model's context window"
        },
        "currentTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Current total tokens in the context window (system + conversation + tool definitions)"
        },
        "messagesLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Current number of messages in the conversation"
        },
        "systemTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from system message(s)"
        },
        "conversationTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from non-system messages (user, assistant, tool)"
        },
        "toolDefinitionsTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Token count from tool definitions"
        }
      },
      "required": [
        "tokenLimit",
        "currentTokens",
        "messagesLength"
      ],
      "additionalProperties": false,
      "description": "Post-compaction context window usage breakdown",
      "title": "HistoryCompactContextWindow"
    },
    "HistoryCompactRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "customInstructions": {
              "type": "string",
              "maxLength": 4000,
              "description": "Optional user-provided instructions to focus the compaction summary"
            },
            "trigger": {
              "type": "string",
              "enum": [
                "manual",
                "model_switch"
              ],
              "description": "What initiated this compaction request, recorded as the `trigger` on the persisted `session.compaction_start` / `session.compaction_complete` events. When absent, the compaction is persisted without trigger attribution (initiator unknown).",
              "x-enumDescriptions": {
                "manual": "User-requested compaction, e.g. the /compact command or a direct history.compact call.",
                "model_switch": "Compaction requested while switching to a model with a smaller context window."
              }
            },
            "tokenLimit": {
              "type": "integer",
              "minimum": 1,
              "description": "Context window token limit this compaction is targeting, recorded as the `tokenLimit` on the persisted `session.compaction_start` / `session.compaction_complete` events. Set it when the compaction targets a window other than the compacting model's own, e.g. switching to a model with a smaller context window: the compaction still runs on the current model, so the limit that motivated it would otherwise be lost. When absent, the events record the compacting model's own resolved limit. Attribution metadata only - it does not change how much the compaction removes."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional compaction parameters.",
      "title": "HistoryCompactRequest",
      "stability": "experimental"
    },
    "HistoryCompactResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether compaction completed successfully"
        },
        "tokensRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of tokens freed by compaction"
        },
        "messagesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of messages removed during compaction"
        },
        "summaryContent": {
          "type": "string",
          "description": "Summary text produced by compaction. Omitted when compaction did not produce a summary (e.g. failure path)."
        },
        "contextWindow": {
          "$ref": "#/definitions/HistoryCompactContextWindow",
          "description": "Post-compaction context window usage breakdown"
        }
      },
      "required": [
        "success",
        "tokensRemoved",
        "messagesRemoved"
      ],
      "additionalProperties": false,
      "description": "Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.",
      "title": "HistoryCompactResult"
    },
    "HistoryFileRestoreSkipReason": {
      "type": "string",
      "enum": [
        "user-modified",
        "skipped-capture"
      ],
      "description": "Reason a captured file was not restored.",
      "title": "HistoryFileRestoreSkipReason",
      "x-enumDescriptions": {
        "user-modified": "The file changed after Copilot's last captured write.",
        "skipped-capture": "A faithful preimage was not captured."
      }
    },
    "HistoryListRewindPointsResult": {
      "type": "object",
      "properties": {
        "fileChangeTrackingEnabled": {
          "type": "boolean",
          "description": "Whether this session captured file changes from its first turn."
        },
        "unavailableReason": {
          "$ref": "#/definitions/HistoryRewindUnavailableReason",
          "description": "Why the listed points could not be produced, when applicable; the points list is empty whenever it is set. `unsupported-remote-session` is permanent for the session and comes with `fileChangeTrackingEnabled: false`. `session-busy` is transient and only ever reported by a session that *is* tracking (`fileChangeTrackingEnabled: true`), because the file-change captures cannot be read while work that may still mutate them is in flight; the same request succeeds once the session settles, so a client that wants points should retry rather than treat it as a failure. It is never `file-change-tracking-disabled`: an untracked local session still lists conversation-only points and reports that through `fileChangeTrackingEnabled: false`."
        },
        "points": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/HistoryRewindPoint",
            "description": "A root user turn that the session can rewind to."
          },
          "description": "Root user turns in chronological order. Empty when `unavailableReason` is set."
        }
      },
      "required": [
        "fileChangeTrackingEnabled",
        "points"
      ],
      "additionalProperties": false,
      "description": "Rewind points and file-change-tracking availability for the session.",
      "title": "HistoryListRewindPointsResult"
    },
    "HistoryPreviewRewindRequest": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string",
          "description": "ID of the user.message event that begins the discarded suffix."
        }
      },
      "required": [
        "eventId"
      ],
      "additionalProperties": false,
      "description": "Event boundary to preview for conversation-and-files rewind.",
      "title": "HistoryPreviewRewindRequest",
      "stability": "experimental"
    },
    "HistoryPreviewRewindResult": {
      "type": "object",
      "properties": {
        "available": {
          "type": "boolean",
          "description": "Whether file restore is available for this session. This is authoritative: switch on it and read `reason` only when it is false."
        },
        "reason": {
          "$ref": "#/definitions/HistoryRewindUnavailableReason",
          "description": "Why file restore is unavailable, when applicable. Populated only when `available` is false and never set when `available` is true."
        },
        "fileCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of unique files in the preview."
        },
        "files": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/HistoryRewindFilePreview",
            "description": "A file that a conversation-and-files rewind would restore."
          },
          "description": "Files ordered by path."
        }
      },
      "required": [
        "available",
        "fileCount",
        "files"
      ],
      "additionalProperties": false,
      "description": "Files and aggregate changes for a prospective rewind.",
      "title": "HistoryPreviewRewindResult"
    },
    "HistoryRewindChangeType": {
      "type": "string",
      "enum": [
        "created",
        "deleted",
        "modified"
      ],
      "description": "Aggregate file change represented by a rewind preview.",
      "title": "HistoryRewindChangeType",
      "x-enumDescriptions": {
        "created": "The discarded turns created the file.",
        "deleted": "The discarded turns deleted the file.",
        "modified": "The discarded turns modified the file."
      }
    },
    "HistoryRewindFilePreview": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Absolute path of the captured file."
        },
        "changeType": {
          "$ref": "#/definitions/HistoryRewindChangeType",
          "description": "Aggregate change made across the discarded turns."
        },
        "linesAdded": {
          "type": "integer",
          "minimum": 0,
          "description": "Lines added across the discarded turns."
        },
        "linesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Lines removed across the discarded turns."
        }
      },
      "required": [
        "path",
        "changeType",
        "linesAdded",
        "linesRemoved"
      ],
      "additionalProperties": false,
      "description": "A file that a conversation-and-files rewind would restore.",
      "title": "HistoryRewindFilePreview"
    },
    "HistoryRewindMode": {
      "type": "string",
      "enum": [
        "conversation",
        "conversation-and-files"
      ],
      "description": "Scope of a rewind operation.",
      "title": "HistoryRewindMode",
      "x-enumDescriptions": {
        "conversation": "Discard conversation events while leaving files unchanged.",
        "conversation-and-files": "Discard conversation events and restore captured files changed by those turns."
      }
    },
    "HistoryRewindOutcome": {
      "type": "string",
      "enum": [
        "success",
        "session-busy",
        "file-change-tracking-disabled",
        "unsupported-remote-session",
        "files-rolled-back",
        "rollback-incomplete",
        "truncation-failed",
        "checkpoint-cleanup-failed",
        "snapshot-prune-failed"
      ],
      "description": "Outcome of a rewind request.",
      "title": "HistoryRewindOutcome",
      "x-enumDescriptions": {
        "success": "The requested rewind completed; reachable in either mode.",
        "session-busy": "The session still has work that may mutate files or history; reachable in either mode.",
        "file-change-tracking-disabled": "A conversation-and-files rewind was requested for a session that did not enable capture; conversation-only rewinds never produce this.",
        "unsupported-remote-session": "Remote-backed rewind routing is not supported; reachable in either mode.",
        "files-rolled-back": "File restore failed and all applied file changes were rolled back; only conversation-and-files rewinds produce this.",
        "rollback-incomplete": "File restore failed and its rollback could not fully restore the pre-rewind state; only conversation-and-files rewinds produce this.",
        "truncation-failed": "Conversation truncation failed. In conversation-and-files mode any files that were restored are left in place because conversation history cannot be un-truncated; in conversation-only mode no files are restored. Consult restoredFiles for what, if anything, was applied.",
        "checkpoint-cleanup-failed": "The conversation was rewound (and, in conversation-and-files mode, captured files were restored), but persisted checkpoints could not be cleaned up; reachable in either mode.",
        "snapshot-prune-failed": "Files and conversation were rewound, but obsolete file snapshots could not be removed; only conversation-and-files rewinds produce this."
      }
    },
    "HistoryRewindPoint": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string",
          "description": "ID of the user.message event that begins the discarded suffix."
        },
        "userMessage": {
          "type": "string",
          "description": "User-visible message text for the turn."
        },
        "timestamp": {
          "type": "string",
          "description": "ISO timestamp of the user turn."
        },
        "canRestoreFiles": {
          "type": "boolean",
          "description": "Whether at least one file in this turn or a later turn can be restored."
        },
        "fileCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of unique files in this turn and all later turns that have captured changes."
        },
        "turnChangedFiles": {
          "type": "boolean",
          "description": "Whether this turn itself captured any file changes."
        },
        "linesAdded": {
          "type": "integer",
          "minimum": 0,
          "description": "Lines added by this turn's captured file changes."
        },
        "linesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Lines removed by this turn's captured file changes."
        },
        "isAutopilotContinuation": {
          "type": "boolean",
          "description": "Whether this turn was an automatically injected autopilot continuation."
        }
      },
      "required": [
        "eventId",
        "userMessage",
        "timestamp",
        "canRestoreFiles",
        "fileCount",
        "turnChangedFiles",
        "linesAdded",
        "linesRemoved",
        "isAutopilotContinuation"
      ],
      "additionalProperties": false,
      "description": "A root user turn that the session can rewind to.",
      "title": "HistoryRewindPoint"
    },
    "HistoryRewindRequest": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string",
          "description": "ID of the user.message event that begins the discarded suffix."
        },
        "mode": {
          "$ref": "#/definitions/HistoryRewindMode",
          "description": "Whether to rewind only conversation history or also restore captured files."
        }
      },
      "required": [
        "eventId",
        "mode"
      ],
      "additionalProperties": false,
      "description": "Boundary and mode for rewinding session history.",
      "title": "HistoryRewindRequest",
      "stability": "experimental"
    },
    "HistoryRewindResult": {
      "type": "object",
      "properties": {
        "outcome": {
          "$ref": "#/definitions/HistoryRewindOutcome",
          "description": "Overall rewind outcome. This discriminates the result: it governs which of the remaining fields are populated, so consumers must switch on it before reading `eventsRemoved`, `restoredFiles`, `skippedFiles`, or `error`. See each field for the outcomes that populate it."
        },
        "eventsRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of persisted events removed by conversation truncation. Present only when truncation succeeded (outcomes `success`, `checkpoint-cleanup-failed`, and `snapshot-prune-failed`); omitted for every unavailable outcome (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`) and for `truncation-failed`, `files-rolled-back`, and `rollback-incomplete`."
        },
        "restoredFiles": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Absolute paths restored to their captured preimages. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it."
        },
        "skippedFiles": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/HistorySkippedFileRestore",
            "description": "A captured file that rewind intentionally left unchanged."
          },
          "description": "Captured files intentionally left unchanged. Always empty for conversation-only rewinds and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`); only conversation-and-files outcomes that reached the file-restore stage populate it."
        },
        "error": {
          "type": "string",
          "description": "Failure detail. Set only for the failure and partial-failure outcomes (`files-rolled-back`, `rollback-incomplete`, `truncation-failed`, `checkpoint-cleanup-failed`, `snapshot-prune-failed`); omitted for `success` and for the unavailable outcomes (`session-busy`, `file-change-tracking-disabled`, `unsupported-remote-session`)."
        }
      },
      "required": [
        "outcome",
        "restoredFiles",
        "skippedFiles"
      ],
      "additionalProperties": false,
      "description": "Structured outcome of a rewind request.",
      "title": "HistoryRewindResult"
    },
    "HistoryRewindUnavailableReason": {
      "type": "string",
      "enum": [
        "file-change-tracking-disabled",
        "session-busy",
        "unsupported-remote-session"
      ],
      "description": "Reason a rewind read (rewind points, file-restore preview, or session diff) could not be answered from the session's file-change captures.",
      "title": "HistoryRewindUnavailableReason",
      "x-enumDescriptions": {
        "file-change-tracking-disabled": "The session did not opt into file-change tracking before its first turn.",
        "session-busy": "The session still has work that may mutate files or history. Transient: the same request succeeds once the session settles, so callers should retry rather than treat it as a failure.",
        "unsupported-remote-session": "Remote-backed rewind routing is not supported."
      }
    },
    "HistorySkippedFileRestore": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Absolute path of the skipped file."
        },
        "reason": {
          "$ref": "#/definitions/HistoryFileRestoreSkipReason",
          "description": "Reason the file was not restored."
        }
      },
      "required": [
        "path",
        "reason"
      ],
      "additionalProperties": false,
      "description": "A captured file that rewind intentionally left unchanged.",
      "title": "HistorySkippedFileRestore"
    },
    "HistorySummarizeForHandoffResult": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "Markdown summary of the conversation context produced by an LLM. Empty string when there are no messages or when the session does not support local summarization."
        }
      },
      "required": [
        "summary"
      ],
      "additionalProperties": false,
      "description": "Markdown summary of the conversation context (empty when not available).",
      "title": "HistorySummarizeForHandoffResult"
    },
    "HistoryTruncateRequest": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string",
          "description": "Event ID to truncate to. This event and all events after it are removed from the session."
        }
      },
      "required": [
        "eventId"
      ],
      "additionalProperties": false,
      "description": "Identifier of the event to truncate to; this event and all later events are removed.",
      "title": "HistoryTruncateRequest",
      "stability": "experimental"
    },
    "HistoryTruncateResult": {
      "type": "object",
      "properties": {
        "eventsRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of events that were removed"
        },
        "checkpointCleanupFailed": {
          "type": "boolean",
          "default": false,
          "description": "True when conversation truncation succeeded but post-truncation workspace checkpoint cleanup failed. History is already truncated; callers may still prune snapshots but should report a checkpoint-cleanup rather than a truncation failure."
        },
        "checkpointCleanupError": {
          "type": "string",
          "description": "Failure detail when checkpointCleanupFailed is true."
        }
      },
      "required": [
        "eventsRemoved"
      ],
      "additionalProperties": false,
      "description": "Number of events that were removed by the truncation.",
      "title": "HistoryTruncateResult"
    },
    "HMACAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "hmac",
          "description": "HMAC-based authentication used by GitHub-internal services."
        },
        "host": {
          "type": "string",
          "const": "https://github.com",
          "description": "Authentication host. HMAC auth always targets the public GitHub host."
        },
        "hmac": {
          "type": "string",
          "description": "HMAC secret used to sign requests."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "hmac"
      ],
      "additionalProperties": false,
      "description": "Authentication-info input variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret.",
      "title": "HMACAuthInfo"
    },
    "HookInvokeRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "hookType": {
          "$ref": "#/definitions/HookType"
        },
        "input": {
          "x-opaque-json": true
        }
      },
      "required": [
        "sessionId",
        "hookType",
        "input"
      ],
      "additionalProperties": false,
      "description": "Runtime-owned wire payload for a server-to-client hook callback invocation.",
      "title": "HookInvokeRequest",
      "visibility": "internal"
    },
    "HookInvokeResponse": {
      "type": "object",
      "properties": {
        "output": {
          "x-opaque-json": true
        }
      },
      "additionalProperties": false,
      "description": "Optional output returned by an SDK callback hook.",
      "title": "HookInvokeResponse",
      "visibility": "internal"
    },
    "HookOrigin": {
      "type": "string",
      "enum": [
        "user",
        "repository",
        "plugin",
        "policy"
      ],
      "description": "Configuration tier that contributed a discovered hook action.",
      "title": "HookOrigin",
      "x-enumDescriptions": {
        "user": "Hook loaded from user settings or the user's hook directory.",
        "repository": "Hook loaded from repository settings or the repository hook directory.",
        "plugin": "Hook provided by an enabled installed or explicit plugin. Projectless rows omit projectPath and do not expand a project directory.",
        "policy": "Hook enforced by centrally managed policy."
      }
    },
    "HooksDiscoverRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional project directory paths whose trusted repository and project-expanded plugin hooks should be discovered. When omitted or empty, user, managed-policy, and globally enabled installed or explicit plugin hooks are returned without project expansion."
        },
        "excludeHostHooks": {
          "type": "boolean",
          "description": "When true, omit host-owned user and plugin hook rows and their diagnostics. Managed-policy hooks and trusted repository hooks remain visible, and host disabledHooks still contribute to each remaining row's effective enabled state. This filters sources rather than simulating a host with no settings."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths and host-exclusion behavior for server-scoped hook discovery.",
      "title": "HooksDiscoverRequest"
    },
    "HooksDiscoverResult": {
      "type": "object",
      "properties": {
        "hooks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DiscoveredHook",
            "description": "One server-discovered hook action from user, repository, plugin, or managed-policy configuration."
          },
          "description": "All discovered hook actions. Byte-identical actions remain separate rows even when they share a disable key."
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Non-fatal source-loading warnings. Discovery remains complete for the affected source, although the source had a recoverable issue. Repository-settings warnings are prefixed with their project path when attribution is available."
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Errors for hook sources or actions that could not be loaded, making the result partially incomplete. Other valid actions are still returned. Project-resolution and repository-settings errors are prefixed with their project path."
        }
      },
      "required": [
        "hooks",
        "warnings",
        "errors"
      ],
      "additionalProperties": false,
      "description": "Server-discovered hook actions and partial-load diagnostics from user, repository, plugin, and managed-policy sources. Concrete sessions may include additional session-specific hook sources.",
      "title": "HooksDiscoverResult"
    },
    "HookType": {
      "type": "string",
      "enum": [
        "preToolUse",
        "preMcpToolCall",
        "postToolUse",
        "postToolUseFailure",
        "userPromptSubmitted",
        "userPromptTransformed",
        "sessionStart",
        "sessionEnd",
        "postResult",
        "prePRDescription",
        "errorOccurred",
        "agentStop",
        "subagentStart",
        "subagentStop",
        "preCompact",
        "permissionRequest",
        "notification"
      ],
      "description": "Hook event name. Discovery emits the file-configurable subset; SDK callbacks additionally support callback-only events.",
      "title": "HookType",
      "x-enumDescriptions": {
        "preToolUse": "Runs before a tool is invoked.",
        "preMcpToolCall": "Runs before an MCP tool is invoked.",
        "postToolUse": "Runs after a tool completes successfully.",
        "postToolUseFailure": "Runs after a tool fails.",
        "userPromptSubmitted": "Runs after the user submits a prompt.",
        "userPromptTransformed": "Runs after the runtime transforms the submitted prompt for the model, before it is added to session history.",
        "sessionStart": "Runs when a session starts.",
        "sessionEnd": "Runs when a session ends.",
        "postResult": "Runs after an agent result is produced.",
        "prePRDescription": "Runs before a pull request description is generated.",
        "errorOccurred": "Runs when the agent encounters an error.",
        "agentStop": "Runs when the agent stops.",
        "subagentStart": "Runs when a subagent starts.",
        "subagentStop": "Runs when a subagent stops.",
        "preCompact": "Runs before conversation context is compacted.",
        "permissionRequest": "Runs when the agent requests permission.",
        "notification": "Runs when the agent emits a notification."
      }
    },
    "InstalledPlugin": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name"
        },
        "marketplace": {
          "type": "string",
          "description": "Marketplace the plugin came from (empty string for direct repo installs)"
        },
        "version": {
          "type": "string",
          "description": "Version installed (if available)"
        },
        "installed_at": {
          "type": "string",
          "description": "Installation timestamp"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the plugin is currently enabled"
        },
        "cache_path": {
          "type": "string",
          "description": "Path where the plugin is cached locally"
        },
        "source": {
          "$ref": "#/definitions/InstalledPluginSource",
          "description": "Source for direct repo installs (when marketplace is empty)"
        },
        "source_sha": {
          "type": "string",
          "description": "Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs."
        },
        "installed_from": {
          "type": "string",
          "description": "Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key."
        }
      },
      "required": [
        "name",
        "marketplace",
        "installed_at",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source.",
      "title": "InstalledPlugin"
    },
    "InstalledPluginInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name"
        },
        "marketplace": {
          "type": "string",
          "description": "Marketplace the plugin came from. Empty string (\"\") for direct repo / URL / local installs."
        },
        "directSourceId": {
          "type": "string",
          "description": "Opaque, stable hash identifying a direct (non-marketplace) install source. Present only for direct repo / URL / local installs; absent for marketplace plugins. Same source yields the same id; distinct sources never collide."
        },
        "version": {
          "type": "string",
          "description": "Installed version (when reported by the plugin manifest)"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the plugin is currently enabled for new sessions"
        },
        "installedFrom": {
          "type": "string",
          "description": "Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — a plugin belonging to a directory/local marketplace, which is loaded from its real directory on every pass instead of a copy under the installed-plugins cache. Its presence is what marks a listed plugin as live: such a plugin is always present on disk, so `enabled` is its only meaningful state and it is never \"not installed\"."
        }
      },
      "required": [
        "name",
        "marketplace",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Information about an installed plugin tracked in global state.",
      "title": "InstalledPluginInfo"
    },
    "InstalledPluginSource": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[^/]+\\/[^/]+$"
        },
        {
          "$ref": "#/definitions/InstalledPluginSourceGitHub",
          "description": "Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath."
        },
        {
          "$ref": "#/definitions/InstalledPluginSourceUrl",
          "description": "Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath."
        },
        {
          "$ref": "#/definitions/InstalledPluginSourceLocal",
          "description": "Source descriptor for a direct local plugin install, with a local filesystem path."
        }
      ],
      "description": "Source for direct repo installs (when marketplace is empty)",
      "title": "InstalledPluginSource",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "InstalledPluginSourceGitHub": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "github",
          "description": "Constant value. Always \"github\"."
        },
        "repo": {
          "type": "string",
          "pattern": "^[^/]+\\/[^/]+$",
          "description": "GitHub repository in `owner/repo` form."
        },
        "ref": {
          "type": "string",
          "description": "Optional Git ref to resolve."
        },
        "sha": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{40}$",
          "description": "Optional full 40-character hexadecimal commit SHA."
        },
        "path": {
          "type": "string",
          "description": "Optional repository-relative path to the plugin."
        }
      },
      "required": [
        "source",
        "repo"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath.",
      "title": "InstalledPluginSourceGitHub"
    },
    "InstalledPluginSourceLocal": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "local",
          "description": "Constant value. Always \"local\"."
        },
        "path": {
          "type": "string",
          "description": "Local filesystem path to the plugin."
        }
      },
      "required": [
        "source",
        "path"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct local plugin install, with a local filesystem path.",
      "title": "InstalledPluginSourceLocal"
    },
    "InstalledPluginSourceUrl": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "url",
          "description": "Constant value. Always \"url\"."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the plugin source."
        },
        "ref": {
          "type": "string",
          "description": "Optional Git ref to resolve."
        },
        "sha": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{40}$",
          "description": "Optional full 40-character hexadecimal commit SHA."
        },
        "path": {
          "type": "string",
          "description": "Optional source-relative path to the plugin."
        }
      },
      "required": [
        "source",
        "url"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath.",
      "title": "InstalledPluginSourceUrl"
    },
    "InstructionDiscoveryPath": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Absolute path of the file or directory (may not exist on disk yet)"
        },
        "location": {
          "$ref": "#/definitions/InstructionDiscoveryPathLocation",
          "description": "Which tier this target belongs to"
        },
        "kind": {
          "$ref": "#/definitions/InstructionDiscoveryPathKind",
          "description": "Whether the target is a single file or a directory of instruction files"
        },
        "preferredForCreation": {
          "type": "boolean",
          "description": "Whether this is the canonical target to create new instructions in its tier. At most one entry per tier is preferred."
        },
        "projectPath": {
          "type": "string",
          "description": "The input project path this target was derived from (only for repository targets)"
        }
      },
      "required": [
        "path",
        "location",
        "kind",
        "preferredForCreation"
      ],
      "additionalProperties": false,
      "description": "Canonical file or directory where custom instructions can be discovered or created, with location, kind, preference, and project path.",
      "title": "InstructionDiscoveryPath"
    },
    "InstructionDiscoveryPathKind": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ],
      "description": "Whether the target is a single file or a directory of instruction files",
      "title": "InstructionDiscoveryPathKind",
      "x-enumDescriptions": {
        "file": "The target is a single instruction file.",
        "directory": "The target is a directory that holds instruction files."
      }
    },
    "InstructionDiscoveryPathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstructionDiscoveryPath",
            "description": "Canonical file or directory where custom instructions can be discovered or created, with location, kind, preference, and project path."
          },
          "description": "Canonical instruction create/discovery files and directories, in priority order"
        }
      },
      "required": [
        "paths"
      ],
      "additionalProperties": false,
      "description": "Canonical files and directories where custom instructions can be created so the runtime will recognize them.",
      "title": "InstructionDiscoveryPathList"
    },
    "InstructionDiscoveryPathLocation": {
      "type": "string",
      "enum": [
        "user",
        "repository",
        "working-directory",
        "plugin"
      ],
      "description": "Which tier this target belongs to",
      "title": "InstructionDiscoveryPathLocation",
      "x-enumDescriptions": {
        "user": "Instructions live in user-level configuration.",
        "repository": "Instructions live in repository-level configuration.",
        "working-directory": "Instructions live under the current working directory.",
        "plugin": "Instructions live in plugin-provided configuration."
      }
    },
    "InstructionsDiscoverRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths to scan for repository/working-directory instruction sources. When omitted or empty, only user-level and plugin instruction sources are returned (no project scan)."
        },
        "excludeHostInstructions": {
          "type": "boolean",
          "description": "When true, omit the host's instruction sources (user/home-level files and plugin rules), leaving only repository and working-directory sources. For multitenant deployments."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths to include in instruction discovery.",
      "title": "InstructionsDiscoverRequest"
    },
    "InstructionsGetDiscoveryPathsRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths. When omitted or empty, only the user-level targets are returned."
        },
        "excludeHostInstructions": {
          "type": "boolean",
          "description": "When true, omit the host's user-level instruction targets, leaving only repository targets. For multitenant deployments (mirrors `discover`'s `excludeHostInstructions`)."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths to include when enumerating instruction discovery targets.",
      "title": "InstructionsGetDiscoveryPathsRequest"
    },
    "InstructionsGetSourcesResult": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstructionSource",
            "description": "Loaded instruction source for a session, including path, content, category, location, applicability, and optional description."
          },
          "description": "Instruction sources for the session"
        }
      },
      "required": [
        "sources"
      ],
      "additionalProperties": false,
      "description": "Instruction sources loaded for the session, in merge order.",
      "title": "InstructionsGetSourcesResult"
    },
    "InstructionSource": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier for this source (used for toggling)"
        },
        "label": {
          "type": "string",
          "description": "Human-readable label"
        },
        "sourcePath": {
          "type": "string",
          "description": "File path relative to repo or absolute for home"
        },
        "content": {
          "type": "string",
          "description": "Raw content of the instruction file"
        },
        "type": {
          "$ref": "#/definitions/InstructionSourceType",
          "description": "Category of instruction source — used for merge logic"
        },
        "location": {
          "$ref": "#/definitions/InstructionSourceLocation",
          "description": "Where this source lives — used for UI grouping"
        },
        "applyTo": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Glob pattern(s) from frontmatter — when set, this instruction applies only to matching files"
        },
        "description": {
          "type": "string",
          "description": "Short description (body after frontmatter) for use in instruction tables"
        },
        "defaultDisabled": {
          "type": "boolean",
          "description": "When true, this source starts disabled and must be toggled on by the user"
        },
        "projectPath": {
          "type": "string",
          "description": "The project path this source was discovered from. Only set by sessionless discovery for repository, working-directory, and project-scoped plugin sources, where it disambiguates sources across multiple workspace roots. The session-scoped getSources leaves it unset."
        }
      },
      "required": [
        "id",
        "label",
        "sourcePath",
        "content",
        "type",
        "location"
      ],
      "additionalProperties": false,
      "description": "Loaded instruction source for a session, including path, content, category, location, applicability, and optional description.",
      "title": "InstructionSource"
    },
    "InstructionSourceLocation": {
      "type": "string",
      "enum": [
        "user",
        "repository",
        "working-directory",
        "plugin"
      ],
      "description": "Where this source lives — used for UI grouping",
      "title": "InstructionSourceLocation",
      "x-enumDescriptions": {
        "user": "Instructions live in user-level configuration.",
        "repository": "Instructions live in repository-level configuration.",
        "working-directory": "Instructions live under the current working directory.",
        "plugin": "Instructions live in plugin-provided configuration."
      }
    },
    "InstructionSourceType": {
      "type": "string",
      "enum": [
        "home",
        "repo",
        "model",
        "vscode",
        "nested-agents",
        "child-instructions",
        "plugin"
      ],
      "description": "Category of instruction source — used for merge logic",
      "title": "InstructionSourceType",
      "x-enumDescriptions": {
        "home": "Instructions loaded from the user's home configuration.",
        "repo": "Instructions loaded from repository-scoped files.",
        "model": "Instructions loaded from model-specific files.",
        "vscode": "Instructions loaded from VS Code instruction files.",
        "nested-agents": "Instructions discovered from nested agent files.",
        "child-instructions": "Instructions inherited from child instruction files.",
        "plugin": "Instructions supplied by an installed plugin."
      }
    },
    "InterruptMainTurnRequest": {
      "type": "object",
      "properties": {
        "flushQueued": {
          "type": "boolean",
          "description": "When true, the user's queued prompts are preserved and run as the next turn once the interrupted turn unwinds; when false (the default), the queue is cleared like a plain abort."
        }
      },
      "additionalProperties": false,
      "description": "Parameters for interrupting the main agent turn.",
      "title": "InterruptMainTurnRequest",
      "stability": "experimental"
    },
    "InterruptMainTurnResult": {
      "type": "object",
      "properties": {
        "interrupted": {
          "type": "boolean",
          "description": "Whether an in-flight main agent turn was interrupted. False when the main loop was not processing."
        }
      },
      "required": [
        "interrupted"
      ],
      "additionalProperties": false,
      "description": "Result of interrupting the main agent turn.",
      "title": "InterruptMainTurnResult"
    },
    "LlmInferenceHeaders": {
      "type": "object",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "description": "HTTP headers as a map from lowercased header name to a list of values. Multi-valued headers (e.g. Set-Cookie) preserve all values.",
      "title": "LlmInferenceHeaders"
    },
    "LlmInferenceHttpRequestChunkRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Matches the requestId from the originating httpRequestStart frame."
        },
        "data": {
          "type": "string",
          "description": "Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty."
        },
        "binary": {
          "type": "boolean",
          "description": "When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text."
        },
        "end": {
          "type": "boolean",
          "description": "When true, this is the final body chunk for the request. The SDK may rely on having received an end-marked chunk before treating the request body as complete."
        },
        "cancel": {
          "type": "boolean",
          "description": "When true, the runtime is cancelling the in-flight request (e.g. upstream consumer aborted). `data` is ignored. Implies end-of-request."
        },
        "cancelReason": {
          "type": "string",
          "description": "Optional human-readable reason for the cancellation, propagated for logging."
        },
        "agentInvocationId": {
          "type": "string",
          "description": "Identity of the agent invocation (one agentic loop) this body chunk belongs to, matching the `agentInvocationId` semantics on httpRequestStart. Carried per chunk so a persistent transport can attribute successive turns correctly: when a WebSocket connection is reused across turns, the httpRequestStart identity reflects only the turn that opened the connection, so each later turn stamps its own invocation id here. Absent when the runtime has no invocation context for the request, or on the plain-HTTP transport where every request has its own httpRequestStart."
        }
      },
      "required": [
        "requestId",
        "data"
      ],
      "additionalProperties": false,
      "description": "A request body chunk or cancellation signal.",
      "title": "LlmInferenceHttpRequestChunkRequest"
    },
    "LlmInferenceHttpRequestChunkResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Acknowledgement. The SDK is free to ignore the ack and treat chunk delivery as fire-and-forget.",
      "title": "LlmInferenceHttpRequestChunkResult"
    },
    "LlmInferenceHttpRequestStartRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Opaque runtime-minted id, unique per in-flight request. The SDK uses this to correlate httpRequestChunk frames and to address its httpResponseStart / httpResponseChunk replies back to the runtime."
        },
        "sessionId": {
          "type": "string",
          "description": "Id of the runtime session that triggered this request, when one is in scope. Absent for requests issued outside any session (e.g. startup model-catalog or capability resolution). This is a payload field — not a dispatch key — because the client-global API is registered process-wide rather than per session."
        },
        "method": {
          "type": "string",
          "description": "HTTP method, e.g. GET, POST."
        },
        "url": {
          "type": "string",
          "description": "Absolute request URL."
        },
        "headers": {
          "$ref": "#/definitions/LlmInferenceHeaders",
          "description": "HTTP request headers, preserving multiple values per name."
        },
        "transport": {
          "$ref": "#/definitions/LlmInferenceHttpRequestStartTransport",
          "description": "Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone."
        },
        "agentId": {
          "type": "string",
          "description": "Stable identity of the agent trajectory that issued this request. Present when the request originates from an agent turn; absent for requests outside any agent context. This is the same identity used by lifecycle and bridged session events and remains constant across turns and retries."
        },
        "parentAgentId": {
          "type": "string",
          "description": "Stable identity of the immediate parent trajectory. Present for child trajectories such as subagents and conversation-sampling requests; absent for root-agent and non-agent requests."
        },
        "agentInvocationId": {
          "type": "string",
          "description": "Identity of the agent invocation (one agentic loop) that issued this request. It remains fixed across physical retries within the invocation and is distinct from the stable trajectory `agentId`. A caller-supplied invocation id always takes precedence (this covers auxiliary calls that have no model call id). Otherwise, first-party CAPI requests fall back to the runtime's agent task id — the same value the runtime emits as the `X-Agent-Task-Id` header — while custom-provider requests fall back to the model call id."
        },
        "interactionType": {
          "type": "string",
          "description": "Coarse classification of the interaction that produced this request. Open string for forward-compatibility; known values include `conversation-agent`, `conversation-subagent`, `conversation-sampling`, `conversation-background`, `conversation-compaction`, and `conversation-user`. Absent when the runtime did not classify the request. Comes from the runtime's per-request agent context independently of transport; on the CAPI transport the runtime derives the upstream `X-Interaction-Type` header from this same context."
        }
      },
      "required": [
        "requestId",
        "method",
        "url",
        "headers"
      ],
      "additionalProperties": false,
      "description": "The head of an outbound model-layer HTTP request.",
      "title": "LlmInferenceHttpRequestStartRequest"
    },
    "LlmInferenceHttpRequestStartResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Acknowledgement. Returning successfully simply means the SDK accepted the start frame; it does not imply the request will succeed.",
      "title": "LlmInferenceHttpRequestStartResult"
    },
    "LlmInferenceHttpRequestStartTransport": {
      "type": "string",
      "enum": [
        "http",
        "websocket"
      ],
      "description": "Transport the runtime would otherwise use for this request. `http` (the default when absent) covers plain HTTP and SSE responses; `websocket` indicates a full-duplex message channel where each body chunk maps to one WebSocket message and the `binary` flag distinguishes text from binary frames. The SDK consumer uses this to decide whether to service the request with an HTTP client or a WebSocket client. It is the one piece of request metadata the consumer cannot reliably infer from the URL or headers alone.",
      "title": "LlmInferenceHttpRequestStartTransport",
      "x-enumDescriptions": {
        "http": "Plain HTTP or SSE response. Each body chunk is an opaque byte range; the response is a status line, headers, and a (possibly streamed) body.",
        "websocket": "Full-duplex WebSocket channel. Each body chunk maps to exactly one WebSocket message and the `binary` flag distinguishes text from binary frames; request and response chunks flow concurrently."
      }
    },
    "LlmInferenceHttpResponseChunkError": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable failure description."
        },
        "code": {
          "type": "string",
          "description": "Optional machine-readable error code."
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored.",
      "title": "LlmInferenceHttpResponseChunkError"
    },
    "LlmInferenceHttpResponseChunkRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Matches the requestId from the originating httpRequestStart frame."
        },
        "data": {
          "type": "string",
          "description": "Body byte range. UTF-8 text when `binary` is absent or false; base64-encoded bytes when `binary` is true. May be empty (e.g. when the response body is empty: send a single chunk with empty data and end=true)."
        },
        "binary": {
          "type": "boolean",
          "description": "When true, `data` is base64-encoded bytes. When absent or false, `data` is UTF-8 text."
        },
        "end": {
          "type": "boolean",
          "description": "When true, this is the final body chunk for the response. The runtime treats the response body as complete after receiving an end-marked chunk."
        },
        "error": {
          "$ref": "#/definitions/LlmInferenceHttpResponseChunkError",
          "description": "Set to terminate the response with a transport-level failure. Implies end-of-stream; any further chunks for this requestId are ignored."
        }
      },
      "required": [
        "requestId",
        "data"
      ],
      "additionalProperties": false,
      "description": "A response body chunk or terminal error.",
      "title": "LlmInferenceHttpResponseChunkRequest"
    },
    "LlmInferenceHttpResponseChunkResult": {
      "type": "object",
      "properties": {
        "accepted": {
          "type": "boolean",
          "description": "True when the chunk was matched to a pending request; false when unknown."
        }
      },
      "required": [
        "accepted"
      ],
      "additionalProperties": false,
      "description": "Whether the chunk was accepted.",
      "title": "LlmInferenceHttpResponseChunkResult"
    },
    "LlmInferenceHttpResponseStartRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Matches the requestId from the originating httpRequestStart frame."
        },
        "status": {
          "type": "integer",
          "description": "HTTP status code."
        },
        "statusText": {
          "type": "string",
          "description": "Optional HTTP status reason phrase."
        },
        "headers": {
          "$ref": "#/definitions/LlmInferenceHeaders",
          "description": "HTTP response headers, preserving multiple values per name."
        }
      },
      "required": [
        "requestId",
        "status",
        "headers"
      ],
      "additionalProperties": false,
      "description": "Response head.",
      "title": "LlmInferenceHttpResponseStartRequest"
    },
    "LlmInferenceHttpResponseStartResult": {
      "type": "object",
      "properties": {
        "accepted": {
          "type": "boolean",
          "description": "True when the response start was matched to a pending request; false when unknown."
        }
      },
      "required": [
        "accepted"
      ],
      "additionalProperties": false,
      "description": "Whether the start frame was accepted.",
      "title": "LlmInferenceHttpResponseStartResult"
    },
    "LlmInferenceSetProviderResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the provider was set successfully"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the calling client was registered as the LLM inference provider.",
      "title": "LlmInferenceSetProviderResult"
    },
    "LocalSessionMetadataValue": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Stable session identifier"
        },
        "startTime": {
          "type": "string",
          "description": "Session creation time as an ISO 8601 timestamp"
        },
        "modifiedTime": {
          "type": "string",
          "description": "Last-modified time of the session's persisted state, as ISO 8601"
        },
        "summary": {
          "type": "string",
          "description": "Short summary of the session, when one has been derived"
        },
        "name": {
          "type": "string",
          "description": "Optional human-friendly name set via /rename"
        },
        "clientName": {
          "type": "string",
          "description": "Runtime client name that created/last resumed this session"
        },
        "isRemote": {
          "type": "boolean",
          "const": false,
          "description": "Always false for local sessions."
        },
        "isDetached": {
          "type": "boolean",
          "description": "True for detached maintenance sessions that should be hidden from normal resume lists."
        },
        "context": {
          "$ref": "#/definitions/SessionContext",
          "description": "Pre-resolved working-directory context for session startup."
        },
        "mcTaskId": {
          "type": "string",
          "description": "GitHub task ID, when this local session is bound to one. Only present for local sessions exported to remote control."
        }
      },
      "required": [
        "sessionId",
        "startTime",
        "modifiedTime",
        "isRemote"
      ],
      "additionalProperties": false,
      "description": "Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID.",
      "title": "LocalSessionMetadataValue"
    },
    "LogRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable message"
        },
        "level": {
          "$ref": "#/definitions/SessionLogLevel",
          "description": "Log severity level. Determines how the message is displayed in the timeline. Defaults to \"info\"."
        },
        "type": {
          "type": "string",
          "description": "Domain category for this log entry (e.g., \"mcp\", \"subscription\", \"policy\", \"model\"). Maps to `infoType`/`warningType`/`errorType` on the emitted event. Defaults to \"notification\"."
        },
        "ephemeral": {
          "type": "boolean",
          "description": "When true, the message is transient and not persisted to the session event log on disk"
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Optional URL the user can open in their browser for more details"
        },
        "tip": {
          "type": "string",
          "description": "Optional actionable tip displayed alongside the message. Only honored on `level: \"info\"`."
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Message text, optional severity level, persistence flag, optional follow-up URL, and optional tip.",
      "title": "LogRequest",
      "stability": "experimental"
    },
    "LogResult": {
      "type": "object",
      "properties": {
        "eventId": {
          "type": "string",
          "format": "uuid",
          "description": "The unique identifier of the emitted session event"
        }
      },
      "required": [
        "eventId"
      ],
      "additionalProperties": false,
      "description": "Identifier of the session event that was emitted for the log message.",
      "title": "LogResult"
    },
    "LspInitializeRequest": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Working directory used to load project-level LSP configs. Defaults to the session working directory when omitted."
        },
        "gitRoot": {
          "type": "string",
          "description": "Git root used as the boundary when traversing for project-level LSP configs (supports monorepos)."
        },
        "force": {
          "type": "boolean",
          "description": "Force re-initialization even when LSP configs were already loaded for the working directory."
        }
      },
      "additionalProperties": false,
      "description": "Parameters for (re)loading the merged LSP configuration set.",
      "title": "LspInitializeRequest",
      "stability": "experimental"
    },
    "ManagedSettingsReadResult": {
      "type": "object",
      "properties": {
        "settingsJson": {
          "description": "Validated, canonical managed-settings JSON. Omitted when no managed settings were discovered or when discovered settings failed validation.",
          "x-opaque-json": true
        },
        "errorMessage": {
          "type": "string",
          "description": "Discovery or validation error text when managed settings could not be read safely."
        }
      },
      "additionalProperties": false,
      "description": "Validated device-managed settings discovered before a session exists.",
      "title": "ManagedSettingsReadResult"
    },
    "MarketplaceAddResult": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Final name of the marketplace as resolved from its manifest"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Result of registering a new marketplace.",
      "title": "MarketplaceAddResult"
    },
    "MarketplaceBrowseResult": {
      "type": "object",
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MarketplacePluginInfo",
            "description": "Plugin entry advertised by a marketplace."
          },
          "description": "Plugins advertised by the marketplace"
        }
      },
      "required": [
        "plugins"
      ],
      "additionalProperties": false,
      "description": "Plugins advertised by the marketplace.",
      "title": "MarketplaceBrowseResult"
    },
    "MarketplaceInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Marketplace name (matches the @marketplace suffix in plugin specs)"
        },
        "source": {
          "type": "string",
          "description": "Human-readable description of where the marketplace data is fetched from (e.g. \"GitHub: owner/repo\")."
        },
        "isDefault": {
          "type": "boolean",
          "description": "True when this is a default marketplace shipped with the runtime. Defaults are not removable."
        }
      },
      "required": [
        "name",
        "source"
      ],
      "additionalProperties": false,
      "description": "Registered marketplace summary.",
      "title": "MarketplaceInfo"
    },
    "MarketplaceListResult": {
      "type": "object",
      "properties": {
        "marketplaces": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MarketplaceInfo",
            "description": "Registered marketplace summary."
          },
          "description": "Registered marketplaces"
        }
      },
      "required": [
        "marketplaces"
      ],
      "additionalProperties": false,
      "description": "All registered marketplaces, including built-in defaults.",
      "title": "MarketplaceListResult"
    },
    "MarketplacePluginInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name as listed in the marketplace catalog"
        },
        "description": {
          "type": "string",
          "description": "Short description from the marketplace catalog, when present"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Plugin entry advertised by a marketplace.",
      "title": "MarketplacePluginInfo"
    },
    "MarketplaceRefreshEntry": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Marketplace name that was refreshed"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the refresh succeeded"
        },
        "error": {
          "type": "string",
          "description": "Error message (failure only)"
        }
      },
      "required": [
        "name",
        "success"
      ],
      "additionalProperties": false,
      "description": "Per-marketplace refresh result, including marketplace name, success flag, and optional failure error.",
      "title": "MarketplaceRefreshEntry"
    },
    "MarketplaceRefreshResult": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MarketplaceRefreshEntry",
            "description": "Per-marketplace refresh result, including marketplace name, success flag, and optional failure error."
          },
          "description": "Per-marketplace refresh results in deterministic order."
        }
      },
      "required": [
        "results"
      ],
      "additionalProperties": false,
      "description": "Result of refreshing one or more marketplace catalogs.",
      "title": "MarketplaceRefreshResult"
    },
    "MarketplaceRemoveResult": {
      "type": "object",
      "properties": {
        "removed": {
          "type": "boolean",
          "description": "True when the marketplace was actually removed. False when removal was skipped because the marketplace has dependent plugins and `force` was not set."
        },
        "dependentPlugins": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Names of installed plugins that prevented removal. Populated only when `removed=false`."
        }
      },
      "required": [
        "removed"
      ],
      "additionalProperties": false,
      "description": "Outcome of the remove attempt, including dependent-plugin info when applicable.",
      "title": "MarketplaceRemoveResult"
    },
    "McpAllowedServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Allowed server name"
        },
        "redactedNote": {
          "type": "string",
          "description": "PII-free note explaining why the server was allowed"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "MCP server allowed by policy, with server name and optional PII-free explanatory note.",
      "title": "McpAllowedServer"
    },
    "McpAppsCallToolRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "MCP server hosting the tool"
        },
        "toolName": {
          "type": "string",
          "description": "MCP tool name"
        },
        "arguments": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Tool arguments"
        },
        "originServerName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing."
        }
      },
      "required": [
        "serverName",
        "toolName",
        "originServerName"
      ],
      "additionalProperties": false,
      "description": "MCP server, tool name, and arguments to invoke from an MCP App view.",
      "title": "McpAppsCallToolRequest",
      "stability": "experimental"
    },
    "McpAppsDiagnoseCapability": {
      "type": "object",
      "properties": {
        "sessionHasMcpApps": {
          "type": "boolean",
          "description": "Whether the session has the `mcp-apps` capability"
        },
        "featureFlagEnabled": {
          "type": "boolean",
          "description": "Whether the MCP_APPS feature flag (or COPILOT_MCP_APPS env override) is on"
        },
        "advertised": {
          "type": "boolean",
          "description": "Whether the runtime advertises `extensions.io.modelcontextprotocol/ui` to MCP servers"
        }
      },
      "required": [
        "sessionHasMcpApps",
        "featureFlagEnabled",
        "advertised"
      ],
      "additionalProperties": false,
      "description": "Capability negotiation snapshot",
      "title": "McpAppsDiagnoseCapability"
    },
    "McpAppsDiagnoseRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "MCP server to probe"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "MCP server to diagnose MCP Apps wiring for.",
      "title": "McpAppsDiagnoseRequest",
      "stability": "experimental"
    },
    "McpAppsDiagnoseResult": {
      "type": "object",
      "properties": {
        "capability": {
          "$ref": "#/definitions/McpAppsDiagnoseCapability",
          "description": "Capability negotiation snapshot"
        },
        "server": {
          "$ref": "#/definitions/McpAppsDiagnoseServer",
          "description": "What the server returned for this session"
        }
      },
      "required": [
        "capability",
        "server"
      ],
      "additionalProperties": false,
      "description": "Diagnostic snapshot of MCP Apps wiring for the named server.",
      "title": "McpAppsDiagnoseResult"
    },
    "McpAppsDiagnoseServer": {
      "type": "object",
      "properties": {
        "connected": {
          "type": "boolean",
          "description": "Whether the named server is currently connected"
        },
        "toolCount": {
          "type": "number",
          "description": "Total tools returned by the server's tools/list"
        },
        "toolsWithUiMeta": {
          "type": "number",
          "description": "Tools whose `_meta.ui` is populated (resourceUri and/or visibility set)"
        },
        "sampleToolNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Up to 5 tool names with `_meta.ui` for quick inspection"
        }
      },
      "required": [
        "connected",
        "toolCount",
        "toolsWithUiMeta",
        "sampleToolNames"
      ],
      "additionalProperties": false,
      "description": "What the server returned for this session",
      "title": "McpAppsDiagnoseServer"
    },
    "McpAppsHostContext": {
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/definitions/McpAppsHostContextDetails",
          "description": "Current host context"
        }
      },
      "required": [
        "context"
      ],
      "additionalProperties": false,
      "description": "Current host context advertised to MCP App guests.",
      "title": "McpAppsHostContext"
    },
    "McpAppsHostContextDetails": {
      "type": "object",
      "properties": {
        "theme": {
          "$ref": "#/definitions/McpAppsHostContextDetailsTheme",
          "description": "UI theme preference per SEP-1865"
        },
        "locale": {
          "type": "string",
          "description": "BCP-47 locale, e.g. 'en-US'"
        },
        "timeZone": {
          "type": "string",
          "description": "IANA timezone, e.g. 'America/New_York'"
        },
        "displayMode": {
          "$ref": "#/definitions/McpAppsHostContextDetailsDisplayMode",
          "description": "Current display mode (SEP-1865)"
        },
        "availableDisplayModes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpAppsHostContextDetailsAvailableDisplayMode"
          },
          "description": "Display modes the host supports"
        },
        "platform": {
          "$ref": "#/definitions/McpAppsHostContextDetailsPlatform",
          "description": "Platform type for responsive design"
        },
        "userAgent": {
          "type": "string",
          "description": "Host application identifier"
        }
      },
      "additionalProperties": {},
      "description": "Current host context",
      "title": "McpAppsHostContextDetails"
    },
    "McpAppsHostContextDetailsAvailableDisplayMode": {
      "type": "string",
      "enum": [
        "inline",
        "fullscreen",
        "pip"
      ],
      "description": "Allowed values for the `McpAppsHostContextDetailsAvailableDisplayMode` enumeration.",
      "title": "McpAppsHostContextDetailsAvailableDisplayMode",
      "x-enumDescriptions": {
        "inline": "Rendered inline within the host conversation surface",
        "fullscreen": "Rendered as a fullscreen overlay",
        "pip": "Rendered as a picture-in-picture floating panel"
      }
    },
    "McpAppsHostContextDetailsDisplayMode": {
      "type": "string",
      "enum": [
        "inline",
        "fullscreen",
        "pip"
      ],
      "description": "Current display mode (SEP-1865)",
      "title": "McpAppsHostContextDetailsDisplayMode",
      "x-enumDescriptions": {
        "inline": "Rendered inline within the host conversation surface",
        "fullscreen": "Rendered as a fullscreen overlay",
        "pip": "Rendered as a picture-in-picture floating panel"
      }
    },
    "McpAppsHostContextDetailsPlatform": {
      "type": "string",
      "enum": [
        "web",
        "desktop",
        "mobile"
      ],
      "description": "Platform type for responsive design",
      "title": "McpAppsHostContextDetailsPlatform",
      "x-enumDescriptions": {
        "web": "Host runs in a web browser",
        "desktop": "Host runs as a desktop application",
        "mobile": "Host runs on a mobile device"
      }
    },
    "McpAppsHostContextDetailsTheme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ],
      "description": "UI theme preference per SEP-1865",
      "title": "McpAppsHostContextDetailsTheme",
      "x-enumDescriptions": {
        "light": "Light UI theme",
        "dark": "Dark UI theme"
      }
    },
    "McpAppsListToolsRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "MCP server hosting the app"
        },
        "originServerName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "**Required.** Server whose ui:// view issued the request. Per SEP-1865 ('callable by the app from this server only'), the call is rejected when this differs from `serverName`, and rejected outright when missing."
        }
      },
      "required": [
        "serverName",
        "originServerName"
      ],
      "additionalProperties": false,
      "description": "MCP server to list app-callable tools for.",
      "title": "McpAppsListToolsRequest",
      "stability": "experimental"
    },
    "McpAppsListToolsResult": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "x-opaque-json": true
            }
          },
          "description": "App-callable tools from the server"
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "App-callable tools from the named MCP server.",
      "title": "McpAppsListToolsResult"
    },
    "McpAppsReadResourceRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server hosting the resource"
        },
        "uri": {
          "type": "string",
          "description": "Resource URI (typically ui://...)"
        }
      },
      "required": [
        "serverName",
        "uri"
      ],
      "additionalProperties": false,
      "description": "MCP server and resource URI to fetch.",
      "title": "McpAppsReadResourceRequest",
      "stability": "experimental"
    },
    "McpAppsReadResourceResult": {
      "type": "object",
      "properties": {
        "contents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpAppsResourceContent",
            "description": "MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata."
          },
          "description": "Resource contents returned by the server"
        }
      },
      "required": [
        "contents"
      ],
      "additionalProperties": false,
      "description": "Resource contents returned by the MCP server.",
      "title": "McpAppsReadResourceResult"
    },
    "McpAppsResourceContent": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The resource URI (typically ui://...)"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the content"
        },
        "text": {
          "type": "string",
          "description": "Text content (e.g. HTML)"
        },
        "blob": {
          "type": "string",
          "description": "Base64-encoded binary content"
        },
        "_meta": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Resource-level metadata (CSP, permissions, etc.)"
        }
      },
      "required": [
        "uri"
      ],
      "additionalProperties": false,
      "description": "MCP Apps resource content with URI, optional MIME type, text or base64 blob, and resource metadata.",
      "title": "McpAppsResourceContent"
    },
    "McpAppsSetHostContextDetails": {
      "type": "object",
      "properties": {
        "theme": {
          "$ref": "#/definitions/McpAppsSetHostContextDetailsTheme",
          "description": "UI theme preference per SEP-1865"
        },
        "locale": {
          "type": "string",
          "description": "BCP-47 locale, e.g. 'en-US'"
        },
        "timeZone": {
          "type": "string",
          "description": "IANA timezone, e.g. 'America/New_York'"
        },
        "displayMode": {
          "$ref": "#/definitions/McpAppsSetHostContextDetailsDisplayMode",
          "description": "Current display mode (SEP-1865)"
        },
        "availableDisplayModes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpAppsSetHostContextDetailsAvailableDisplayMode"
          },
          "description": "Display modes the host supports"
        },
        "platform": {
          "$ref": "#/definitions/McpAppsSetHostContextDetailsPlatform",
          "description": "Platform type for responsive design"
        },
        "userAgent": {
          "type": "string",
          "description": "Host application identifier"
        }
      },
      "additionalProperties": {},
      "description": "Host context advertised to MCP App guests",
      "title": "McpAppsSetHostContextDetails"
    },
    "McpAppsSetHostContextDetailsAvailableDisplayMode": {
      "type": "string",
      "enum": [
        "inline",
        "fullscreen",
        "pip"
      ],
      "description": "Allowed values for the `McpAppsSetHostContextDetailsAvailableDisplayMode` enumeration.",
      "title": "McpAppsSetHostContextDetailsAvailableDisplayMode",
      "x-enumDescriptions": {
        "inline": "Rendered inline within the host conversation surface",
        "fullscreen": "Rendered as a fullscreen overlay",
        "pip": "Rendered as a picture-in-picture floating panel"
      }
    },
    "McpAppsSetHostContextDetailsDisplayMode": {
      "type": "string",
      "enum": [
        "inline",
        "fullscreen",
        "pip"
      ],
      "description": "Current display mode (SEP-1865)",
      "title": "McpAppsSetHostContextDetailsDisplayMode",
      "x-enumDescriptions": {
        "inline": "Rendered inline within the host conversation surface",
        "fullscreen": "Rendered as a fullscreen overlay",
        "pip": "Rendered as a picture-in-picture floating panel"
      }
    },
    "McpAppsSetHostContextDetailsPlatform": {
      "type": "string",
      "enum": [
        "web",
        "desktop",
        "mobile"
      ],
      "description": "Platform type for responsive design",
      "title": "McpAppsSetHostContextDetailsPlatform",
      "x-enumDescriptions": {
        "web": "Host runs in a web browser",
        "desktop": "Host runs as a desktop application",
        "mobile": "Host runs on a mobile device"
      }
    },
    "McpAppsSetHostContextDetailsTheme": {
      "type": "string",
      "enum": [
        "light",
        "dark"
      ],
      "description": "UI theme preference per SEP-1865",
      "title": "McpAppsSetHostContextDetailsTheme",
      "x-enumDescriptions": {
        "light": "Light UI theme",
        "dark": "Dark UI theme"
      }
    },
    "McpAppsSetHostContextRequest": {
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/definitions/McpAppsSetHostContextDetails",
          "description": "Host context advertised to MCP App guests"
        }
      },
      "required": [
        "context"
      ],
      "additionalProperties": false,
      "description": "Host context to advertise to MCP App guests.",
      "title": "McpAppsSetHostContextRequest",
      "stability": "experimental"
    },
    "McpCancelSamplingExecutionParams": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The requestId previously passed to executeSampling that should be cancelled"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "The requestId previously passed to executeSampling that should be cancelled.",
      "title": "McpCancelSamplingExecutionParams",
      "stability": "experimental"
    },
    "McpCancelSamplingExecutionResult": {
      "type": "object",
      "properties": {
        "cancelled": {
          "type": "boolean",
          "description": "True if an in-flight execution with the given requestId was found and signalled to cancel. False when no such execution is in flight (already completed, never started, or cancelled by another caller)."
        }
      },
      "required": [
        "cancelled"
      ],
      "additionalProperties": false,
      "description": "Indicates whether an in-flight sampling execution with the given requestId was found and cancelled.",
      "title": "McpCancelSamplingExecutionResult"
    },
    "McpConfigAddRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Unique name for the MCP server"
        },
        "config": {
          "$ref": "#/definitions/McpSerializableServerConfig",
          "description": "MCP server configuration (stdio process or remote HTTP/SSE)"
        }
      },
      "required": [
        "name",
        "config"
      ],
      "additionalProperties": false,
      "description": "MCP server name and configuration to add to user configuration.",
      "title": "McpConfigAddRequest"
    },
    "McpConfigDisableRequest": {
      "type": "object",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
            "description": "MCP server name used as a configuration key."
          },
          "description": "Names of MCP servers to disable. Each server is added to the persisted disabled list so new sessions skip it. Already-disabled names are ignored. Active sessions keep their current connections until they end."
        }
      },
      "required": [
        "names"
      ],
      "additionalProperties": false,
      "description": "MCP server names to disable for new sessions.",
      "title": "McpConfigDisableRequest"
    },
    "McpConfigEnableRequest": {
      "type": "object",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1,
            "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
            "description": "MCP server name used as a configuration key."
          },
          "description": "Names of MCP servers to enable. Each server is removed from the persisted disabled list so new sessions spawn it. Unknown or already-enabled names are ignored."
        }
      },
      "required": [
        "names"
      ],
      "additionalProperties": false,
      "description": "MCP server names to enable for new sessions.",
      "title": "McpConfigEnableRequest"
    },
    "McpConfigList": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/McpSerializableServerConfig",
            "description": "MCP server configuration (stdio process or remote HTTP/SSE)"
          },
          "propertyNames": {
            "minLength": 1,
            "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$"
          },
          "description": "All MCP servers from user config, keyed by name"
        }
      },
      "required": [
        "servers"
      ],
      "additionalProperties": false,
      "description": "User-configured MCP servers, keyed by server name.",
      "title": "McpConfigList"
    },
    "McpConfigRemoveRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server to remove"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "MCP server name to remove from user configuration.",
      "title": "McpConfigRemoveRequest"
    },
    "McpConfigUpdateRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server to update"
        },
        "config": {
          "$ref": "#/definitions/McpSerializableServerConfig",
          "description": "MCP server configuration (stdio process or remote HTTP/SSE)"
        }
      },
      "required": [
        "name",
        "config"
      ],
      "additionalProperties": false,
      "description": "MCP server name and replacement configuration to write to user configuration.",
      "title": "McpConfigUpdateRequest"
    },
    "McpConfigureGitHubRequest": {
      "type": "object",
      "properties": {
        "authInfo": {
          "description": "Opaque runtime auth info for GitHub MCP configuration. Marked internal: an in-process runtime shape (configureGitHubMcp is a no-op over the wire).",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "authInfo"
      ],
      "additionalProperties": false,
      "description": "Credential-free authentication identity used to configure GitHub MCP.",
      "title": "McpConfigureGitHubRequest",
      "visibility": "internal"
    },
    "McpConfigureGitHubResult": {
      "type": "object",
      "properties": {
        "changed": {
          "type": "boolean",
          "description": "Whether GitHub MCP configuration changed."
        }
      },
      "required": [
        "changed"
      ],
      "additionalProperties": false,
      "description": "Result of configuring GitHub MCP.",
      "title": "McpConfigureGitHubResult"
    },
    "McpDisableRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server to disable"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Name of the MCP server to disable for the session.",
      "title": "McpDisableRequest",
      "stability": "experimental"
    },
    "McpDiscoverRequest": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Working directory used as context for discovery (e.g., plugin resolution)"
        }
      },
      "additionalProperties": false,
      "description": "Optional working directory used as context for MCP server discovery.",
      "title": "McpDiscoverRequest"
    },
    "McpDiscoverResult": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/DiscoveredMcpServer",
            "description": "MCP server discovered by `mcp.discover`, with config source, optional plugin source, transport type, and enabled state."
          },
          "description": "MCP servers discovered from all sources"
        }
      },
      "required": [
        "servers"
      ],
      "additionalProperties": false,
      "description": "MCP servers discovered from user, workspace, plugin, and built-in sources.",
      "title": "McpDiscoverResult"
    },
    "McpElicitationFormMode": {
      "type": "string",
      "enum": [
        "form"
      ],
      "description": "Structured MCP elicitation mode.",
      "title": "McpElicitationFormMode"
    },
    "McpEnableRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server to enable"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Name of the MCP server to enable for the session.",
      "title": "McpEnableRequest",
      "stability": "experimental"
    },
    "McpExecuteSamplingParams": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Caller-provided unique identifier for this sampling execution. Use this same ID with cancelSamplingExecution to cancel the in-flight call. Must be unique within the session for the lifetime of the call."
        },
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server that initiated the sampling request"
        },
        "mcpRequestId": {
          "description": "The original MCP JSON-RPC request ID (string or number). Used by the runtime to correlate the inference with the originating MCP request for telemetry; this is distinct from `requestId` (which is the schema-level cancellation handle).",
          "x-opaque-json": true
        },
        "request": {
          "$ref": "#/definitions/McpExecuteSamplingRequest",
          "description": "Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally."
        }
      },
      "required": [
        "requestId",
        "serverName",
        "mcpRequestId",
        "request"
      ],
      "additionalProperties": false,
      "description": "Identifiers and raw MCP CreateMessageRequest params used to run a sampling inference.",
      "title": "McpExecuteSamplingParams",
      "stability": "experimental"
    },
    "McpExecuteSamplingRequest": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "description": "Raw MCP CreateMessageRequest params, as received in the `sampling.requested` event. Treated as opaque at the schema layer; the runtime converts the embedded MCP messages into the OpenAI chat-completion shape internally.",
      "title": "McpExecuteSamplingRequest",
      "x-opaque-json": true
    },
    "McpExecuteSamplingResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "description": "MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape.",
      "title": "McpExecuteSamplingResult",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "McpFailedServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The config key of the server that failed to connect."
        },
        "error": {
          "type": "string",
          "description": "The captured connection failure detail."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "MCP server whose connection attempt failed.",
      "title": "McpFailedServer"
    },
    "McpFilteredServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Filtered server name"
        },
        "reason": {
          "type": "string",
          "description": "Human-readable filter reason"
        },
        "redactedReason": {
          "type": "string",
          "description": "PII-free filter reason"
        },
        "enterpriseName": {
          "type": "string",
          "description": "Deprecated. This field is no longer populated.",
          "deprecated": true
        }
      },
      "required": [
        "name",
        "reason"
      ],
      "additionalProperties": false,
      "description": "MCP server filtered by policy, with name, reason, and optional redacted reason.",
      "title": "McpFilteredServer"
    },
    "McpHeadersHandlePendingHeadersRefreshRequest": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "headers": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              },
              "description": "Headers to overlay onto the MCP request. Dynamic headers override static config headers but do not replace SDK-managed request headers."
            },
            "kind": {
              "type": "string",
              "const": "headers",
              "description": "Headers-refresh response variant discriminator."
            }
          },
          "required": [
            "kind",
            "headers"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "none",
              "description": "Headers-refresh response variant discriminator."
            }
          },
          "required": [
            "kind"
          ]
        }
      ],
      "description": "Host response: supply dynamic headers or decline this refresh.",
      "title": "McpHeadersHandlePendingHeadersRefreshRequest"
    },
    "McpHeadersHandlePendingHeadersRefreshRequestRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Headers refresh request identifier from mcp.headers_refresh_required"
        },
        "result": {
          "$ref": "#/definitions/McpHeadersHandlePendingHeadersRefreshRequest",
          "description": "Host response: supply dynamic headers or decline this refresh."
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "MCP headers refresh request id and the host response.",
      "title": "McpHeadersHandlePendingHeadersRefreshRequestRequest",
      "stability": "experimental"
    },
    "McpHeadersHandlePendingHeadersRefreshRequestResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the response was accepted. False if the request was unknown, timed out, or already resolved."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the pending MCP headers refresh response was accepted.",
      "title": "McpHeadersHandlePendingHeadersRefreshRequestResult"
    },
    "McpHostState": {
      "type": "object",
      "properties": {
        "mcp3pEnabled": {
          "type": "boolean",
          "description": "Whether third-party MCP servers are policy-enabled for this session."
        },
        "disabledServers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Configured servers that are explicitly disabled."
        },
        "filteredServers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Configured servers filtered out by MCP server policy."
        },
        "clients": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Names of currently-connected MCP clients."
        },
        "pendingConnections": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Names of servers with in-flight connection attempts."
        },
        "failedServers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/McpServerFailureInfo",
            "description": "Recorded MCP server connection failure."
          },
          "description": "Map of server name to recorded connection failure."
        },
        "needsAuthServers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/McpServerNeedsAuthInfo",
            "description": "Recorded MCP server pending-auth state."
          },
          "description": "Map of server name to recorded pending-auth state."
        }
      },
      "required": [
        "mcp3pEnabled",
        "disabledServers",
        "filteredServers",
        "clients",
        "pendingConnections",
        "failedServers",
        "needsAuthServers"
      ],
      "additionalProperties": false,
      "description": "Host-level state, omitted when no MCP host is initialized.",
      "title": "McpHostState"
    },
    "McpInstallPlan": {
      "type": "object",
      "properties": {
        "planHandle": {
          "type": "string",
          "minLength": 1,
          "description": "Opaque, runtime-instance scoped, TTL-bound, single-use handle for this plan. Rejected when stale, replayed, or presented to a different runtime instance. Never logged."
        },
        "planHandleExpiresAt": {
          "type": "string",
          "description": "ISO 8601 timestamp after which the plan handle is stale and will be rejected. Abandoning a plan needs no call: an unused handle simply expires, so cancellation before commit is side-effect free."
        },
        "identity": {
          "$ref": "#/definitions/McpPlanResourceIdentity",
          "description": "Normalised identity of the server the plan would install."
        },
        "provenance": {
          "$ref": "#/definitions/McpPlanProvenance",
          "description": "Origin and semantic digest of the exact validated JSON MCP card content bound to this plan."
        },
        "transportChoices": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanTransportChoice",
            "description": "One eligible way to run the server, represented as a tagged package or remote variant so package identity and endpoint states cannot contradict the install method."
          },
          "minItems": 1,
          "maxItems": 50,
          "description": "Every eligible transport, so a host can present an explicit choice. A completed plan always has at least one; when none is eligible, planning returns `CatalogUnavailableTransportError` instead."
        },
        "recommendedTransportChoiceId": {
          "type": "string",
          "description": "Identifier of the choice the runtime would pick by default. Omitted when there is no eligible transport, or when the runtime expresses no preference."
        },
        "target": {
          "$ref": "#/definitions/McpPlanTarget",
          "description": "Configuration scope and key the plan would write to."
        },
        "policy": {
          "$ref": "#/definitions/McpPlanPolicyResult",
          "description": "Outcome of evaluating the server against registry and enterprise policy."
        },
        "configurationChanges": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanConfigurationChange",
            "description": "One change applying the plan would make, described rather than serialised so the configuration payload stays behind the runtime boundary."
          },
          "description": "The configuration changes installing would make, described rather than serialised, so the mutable configuration payload stays behind the runtime boundary."
        },
        "reloadRequired": {
          "type": "boolean",
          "description": "Whether applying this plan would require an MCP reload to take effect. Planning itself never reloads."
        },
        "requiresInteractiveConfiguration": {
          "type": "boolean",
          "description": "Whether the plan cannot be applied without further input, because a required value has no default or a secret must be supplied."
        }
      },
      "required": [
        "planHandle",
        "planHandleExpiresAt",
        "identity",
        "provenance",
        "transportChoices",
        "target",
        "policy",
        "configurationChanges",
        "reloadRequired",
        "requiresInteractiveConfiguration"
      ],
      "additionalProperties": false,
      "description": "A normalised, inert description of what installing an MCP server would involve. Carries no raw card, no install specification, and no secret value.",
      "title": "McpInstallPlan"
    },
    "McpIsServerRunningRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server to check"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name to check running status for.",
      "title": "McpIsServerRunningRequest",
      "stability": "experimental"
    },
    "McpIsServerRunningResult": {
      "type": "object",
      "properties": {
        "running": {
          "type": "boolean",
          "description": "True if the server has an active client and transport."
        }
      },
      "required": [
        "running"
      ],
      "additionalProperties": false,
      "description": "Whether the named MCP server is running.",
      "title": "McpIsServerRunningResult"
    },
    "McpListToolsRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the connected MCP server whose tools to list."
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name whose tool list should be returned.",
      "title": "McpListToolsRequest",
      "stability": "experimental"
    },
    "McpListToolsResult": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpTools",
            "description": "MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata."
          },
          "description": "Tools exposed by the server."
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "Tools exposed by the connected MCP server. Throws when the server is not connected.",
      "title": "McpListToolsResult"
    },
    "McpOauthAuthenticationStateChangedRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server whose OAuth credentials were updated. Omit only when the host cannot identify the server."
        },
        "refreshSessionToken": {
          "type": "boolean",
          "description": "Whether the target session must mint a session-scoped access token instead of reusing a shared access token persisted by another session."
        }
      },
      "additionalProperties": false,
      "description": "Identifies the MCP server whose persisted OAuth credentials were updated.",
      "title": "McpOauthAuthenticationStateChangedRequest",
      "stability": "experimental"
    },
    "McpOauthHandlePendingRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "OAuth request identifier from the mcp.oauth_required event"
        },
        "result": {
          "$ref": "#/definitions/McpOauthPendingRequestResponse",
          "description": "Host response to the pending OAuth request."
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "Pending MCP OAuth request ID and host-provided token or cancellation response.",
      "title": "McpOauthHandlePendingRequest",
      "stability": "experimental"
    },
    "McpOauthHandlePendingResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the response was accepted. False if the request was unknown, timed out, or already resolved."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the pending MCP OAuth response was accepted.",
      "title": "McpOauthHandlePendingResult"
    },
    "McpOauthLoginGrantType": {
      "type": "string",
      "enum": [
        "authorization_code",
        "client_credentials"
      ],
      "description": "OAuth grant type override for this login.",
      "title": "McpOauthLoginGrantType",
      "x-enumDescriptions": {
        "authorization_code": "Interactive browser-based OAuth flow using an authorization code, typically with PKCE.",
        "client_credentials": "Headless OAuth flow where a confidential client authenticates directly with a client secret."
      }
    },
    "McpOauthLoginRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the remote MCP server to authenticate"
        },
        "forceReauth": {
          "type": "boolean",
          "description": "When true, clears any cached OAuth token for the server and runs a full new authorization. Use when the user explicitly wants to switch accounts or believes their session is stuck."
        },
        "clientName": {
          "type": "string",
          "description": "Optional override for the OAuth client display name shown on the consent screen. Applies to newly registered dynamic clients only — existing registrations keep the name they were created with. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass their own surface-specific label so the consent screen matches the product the user sees."
        },
        "callbackSuccessMessage": {
          "type": "string",
          "description": "Optional override for the body text shown on the OAuth loopback callback success page. When omitted, the runtime applies a neutral fallback; callers driving interactive auth should pass surface-specific copy telling the user where to return."
        },
        "clientId": {
          "type": "string",
          "description": "Optional OAuth client ID override for this login. When set, the runtime uses this pre-registered static client instead of dynamic client registration."
        },
        "clientSecret": {
          "type": "string",
          "description": "Optional OAuth client secret override for this login. The runtime treats this as an ephemeral host-owned secret, uses it for this authentication attempt and does not persist it."
        },
        "publicClient": {
          "type": "boolean",
          "description": "Optional override indicating whether the static OAuth client is public. When false, the runtime treats it as confidential and uses the per-login clientSecret if provided, otherwise retrieving the client secret from the MCP OAuth secret store."
        },
        "grantType": {
          "$ref": "#/definitions/McpOauthLoginGrantType",
          "description": "Optional OAuth grant type override for this login. Defaults to the server configuration, or authorization_code when no grant type is specified."
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Remote MCP server name and optional overrides controlling reauthentication, OAuth client display name, callback success-page copy, and static OAuth client selection.",
      "title": "McpOauthLoginRequest",
      "stability": "experimental"
    },
    "McpOauthLoginResult": {
      "type": "object",
      "properties": {
        "authorizationUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL the caller should open in a browser to complete OAuth. Omitted when cached tokens were still valid and no browser interaction was needed — the server is already reconnected in that case. When present, the runtime starts the callback listener before returning and continues the flow in the background; completion is signaled via session.mcp_server_status_changed."
        }
      },
      "additionalProperties": false,
      "description": "OAuth authorization URL the caller should open, or empty when cached tokens already authenticated the server.",
      "title": "McpOauthLoginResult"
    },
    "McpOauthPendingRequestResponse": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "accessToken": {
              "type": "string",
              "description": "Access token acquired by the SDK host"
            },
            "tokenType": {
              "type": "string",
              "description": "OAuth token type. Defaults to bearer when omitted."
            },
            "expiresIn": {
              "type": "integer",
              "minimum": 1,
              "description": "Token lifetime in seconds, if known."
            },
            "kind": {
              "type": "string",
              "const": "token",
              "description": "OAuth response variant discriminator."
            }
          },
          "required": [
            "kind",
            "accessToken"
          ]
        },
        {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "cancelled",
              "description": "OAuth response variant discriminator."
            }
          },
          "required": [
            "kind"
          ]
        }
      ],
      "description": "Host response to the pending OAuth request.",
      "title": "McpOauthPendingRequestResponse",
      "stability": "experimental"
    },
    "McpOauthProbeNeedsAuthReason": {
      "type": "string",
      "enum": [
        "initial",
        "refresh",
        "upscope"
      ],
      "description": "Why a passive MCP OAuth probe determined authentication is needed.",
      "title": "McpOauthProbeNeedsAuthReason",
      "x-enumDescriptions": {
        "initial": "No token was sent and the server requires authentication.",
        "refresh": "A cached token was sent and rejected.",
        "upscope": "The server returned a 403 insufficient_scope challenge, indicating additional scopes or audience are needed."
      }
    },
    "McpOauthProbeRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the configured remote MCP server to probe."
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Remote MCP server name for a passive OAuth status probe.",
      "title": "McpOauthProbeRequest",
      "stability": "experimental"
    },
    "McpOauthProbeResult": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "httpResponse": {
              "$ref": "session-events.schema.json#/definitions/McpOauthHttpResponse",
              "description": "HTTP response returned by the server."
            },
            "status": {
              "type": "string",
              "const": "no-auth-required",
              "description": "Probe outcome variant discriminator."
            }
          },
          "required": [
            "status",
            "httpResponse"
          ]
        },
        {
          "type": "object",
          "properties": {
            "httpResponse": {
              "$ref": "session-events.schema.json#/definitions/McpOauthHttpResponse",
              "description": "HTTP response returned by the server."
            },
            "status": {
              "type": "string",
              "const": "authenticated",
              "description": "Probe outcome variant discriminator."
            }
          },
          "required": [
            "status",
            "httpResponse"
          ]
        },
        {
          "type": "object",
          "properties": {
            "httpResponse": {
              "$ref": "session-events.schema.json#/definitions/McpOauthHttpResponse",
              "description": "HTTP 401 or 403 response returned by the server."
            },
            "reason": {
              "$ref": "#/definitions/McpOauthProbeNeedsAuthReason",
              "description": "Why authentication is needed."
            },
            "wwwAuthenticateParams": {
              "$ref": "session-events.schema.json#/definitions/McpOauthWWWAuthenticateParams",
              "description": "Parsed WWW-Authenticate challenge parameters, when present and parseable."
            },
            "status": {
              "type": "string",
              "const": "needs-auth",
              "description": "Probe outcome variant discriminator."
            }
          },
          "required": [
            "status",
            "httpResponse",
            "reason"
          ]
        },
        {
          "type": "object",
          "properties": {
            "error": {
              "type": "string",
              "description": "Human-readable probe failure detail."
            },
            "httpResponse": {
              "$ref": "session-events.schema.json#/definitions/McpOauthHttpResponse",
              "description": "HTTP response returned by the server, when the probe reached the server and captured the complete response."
            },
            "status": {
              "type": "string",
              "const": "failed",
              "description": "Probe outcome variant discriminator."
            }
          },
          "required": [
            "status",
            "error"
          ]
        }
      ],
      "description": "Passive MCP OAuth probe result. `authenticated` means the server accepted the probe request while an OAuth-origin access token was attached; it does not prove the server required or independently validated that token. The probe does not make a second unauthenticated request. Failed is an expected probe-domain outcome; JSON-RPC errors are reserved for API-call failures.",
      "title": "McpOauthProbeResult"
    },
    "McpOauthRespondRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "OAuth request identifier from the mcp.oauth_required event"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Pending MCP OAuth request id to respond to.",
      "title": "McpOauthRespondRequest",
      "stability": "experimental"
    },
    "McpOauthRespondResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the response was accepted. False if the request was unknown, timed out, or already resolved."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the pending MCP OAuth response was accepted.",
      "title": "McpOauthRespondResult"
    },
    "McpPlanConfigurationChange": {
      "type": "object",
      "properties": {
        "operation": {
          "$ref": "#/definitions/McpPlanConfigurationOperation",
          "description": "Whether the change would create a new entry or modify an existing one."
        },
        "scope": {
          "$ref": "#/definitions/McpPlanScope",
          "description": "Scope the change would be written to."
        },
        "configKey": {
          "type": "string",
          "minLength": 1,
          "description": "Configuration key the change applies to."
        },
        "changedFields": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Names of the configuration fields the change would set, without their values."
        },
        "secretReferences": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanSecretReference",
            "description": "A runtime-assigned secret placeholder. The identifier is carried once, inside the placeholder, so it cannot contradict a separate secret-id field."
          },
          "description": "Secret placeholders the written configuration would reference. The constrained placeholder type cannot carry a literal secret value."
        }
      },
      "required": [
        "operation",
        "scope",
        "configKey",
        "changedFields",
        "secretReferences"
      ],
      "additionalProperties": false,
      "description": "One change applying the plan would make, described rather than serialised so the configuration payload stays behind the runtime boundary.",
      "title": "McpPlanConfigurationChange"
    },
    "McpPlanConfigurationOperation": {
      "type": "string",
      "enum": [
        "add",
        "update"
      ],
      "description": "Whether a planned configuration change would create or modify an entry",
      "title": "McpPlanConfigurationOperation",
      "x-enumDescriptions": {
        "add": "Creates a configuration entry that does not exist yet.",
        "update": "Modifies a configuration entry that already exists."
      }
    },
    "McpPlanEnumValueType": {
      "type": "string",
      "enum": [
        "enum"
      ],
      "description": "Discriminator for an enumerated required value",
      "title": "McpPlanEnumValueType",
      "x-enumDescriptions": {
        "enum": "One of a fixed, non-empty set of permitted values."
      }
    },
    "McpPlanInstallPlanned": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "planned",
          "description": "Discriminator: a plan was computed and nothing was changed"
        },
        "plan": {
          "$ref": "#/definitions/McpInstallPlan",
          "description": "The normalised plan."
        },
        "negotiated": {
          "$ref": "#/definitions/CatalogNegotiatedContract",
          "description": "Protocol version and capabilities the runtime honoured."
        }
      },
      "required": [
        "kind",
        "plan",
        "negotiated"
      ],
      "additionalProperties": false,
      "description": "A computed MCP install plan. Nothing has been applied: the plan describes what installing would change, and the plan handle is what a later apply operation would consume.",
      "title": "McpPlanInstallPlanned"
    },
    "McpPlanInstallRequest": {
      "type": "object",
      "properties": {
        "contract": {
          "$ref": "#/definitions/CatalogClientContract",
          "description": "Protocol version and capabilities the caller requires."
        },
        "source": {
          "$ref": "#/definitions/McpPlanInstallSource",
          "description": "What to plan: either a candidate handle from a previous search, or a card supplied directly."
        },
        "scope": {
          "$ref": "#/definitions/McpPlanScope",
          "description": "Configuration scope the plan targets. Defaults to user scope when omitted."
        }
      },
      "required": [
        "contract",
        "source"
      ],
      "additionalProperties": false,
      "description": "A side-effect-free request for an MCP install plan. Computing a plan never writes configuration, stores a secret, or reloads MCP servers.",
      "title": "McpPlanInstallRequest"
    },
    "McpPlanInstallResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpPlanInstallPlanned",
          "description": "A computed MCP install plan. Nothing has been applied: the plan describes what installing would change, and the plan handle is what a later apply operation would consume."
        },
        {
          "$ref": "#/definitions/CatalogNegotiationRefusedError",
          "description": "The caller's protocol version or required capabilities cannot be honoured. Returned instead of a partial or ambiguous success."
        },
        {
          "$ref": "#/definitions/CatalogHandleRejectedError",
          "description": "A presented handle was not accepted. Handles are runtime-instance scoped, TTL-bound, and single-use, so each way of failing is reported distinctly."
        },
        {
          "$ref": "#/definitions/CatalogInvalidRequestError",
          "description": "The request was rejected before any work was done, because a bounded field fell outside its permitted range or a required field was unusable."
        },
        {
          "$ref": "#/definitions/CatalogAuthenticationRequiredError",
          "description": "An optional catalog authentication exchange did not establish the caller's identity. Anonymous search remains supported; this refusal is reserved for an operation that cannot continue after the attempted exchange. It is distinct from `policy-rejected` and from a network failure, and the reason identifies the recovery action."
        },
        {
          "$ref": "#/definitions/CatalogPolicyRejectedError",
          "description": "Registry or enterprise policy refused the operation."
        },
        {
          "$ref": "#/definitions/CatalogNetworkFailureError",
          "description": "The runtime could not reach the catalog authority or retrieve a card. Covers being offline as well as transport-level failure."
        },
        {
          "$ref": "#/definitions/CatalogUnsafeRetrievalError",
          "description": "Retrieval was refused by the runtime's hardened fetch boundary before any request left the process, or before a redirect was followed."
        },
        {
          "$ref": "#/definitions/CatalogMalformedCardError",
          "description": "A card could not be parsed or did not satisfy its declared media type's schema."
        },
        {
          "$ref": "#/definitions/CatalogContractViolationError",
          "description": "An upstream catalog response broke the wire contract. Most importantly, every result must carry exactly one of a URL or embedded data: a result carrying both, or neither, is refused here rather than being guessed at."
        },
        {
          "$ref": "#/definitions/CatalogUnavailableTransportError",
          "description": "No transport this runtime can use is available for the requested server."
        },
        {
          "$ref": "#/definitions/CatalogNotInstallableError",
          "description": "The candidate is discoverable but cannot be installed. `application/ai-skill` resolves here, because it stays searchable while remaining typed non-installable."
        },
        {
          "$ref": "#/definitions/CatalogUnavailableError",
          "description": "The operation is not available on this runtime. Distinct from a network failure: nothing was attempted."
        }
      ],
      "description": "Outcome of an mcp.planInstall call: either a normalised plan, or one typed refusal. Nothing is written in either case.",
      "title": "McpPlanInstallResult"
    },
    "McpPlanInstallSource": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpPlanInstallSourceCandidate",
          "description": "Plan from a candidate returned by a previous catalog search."
        },
        {
          "$ref": "#/definitions/McpPlanInstallSourceCard",
          "description": "Plan from a card supplied directly by the caller, without a preceding search."
        }
      ],
      "description": "What an install plan is computed from: a candidate handle from a previous search, or a card supplied directly.",
      "title": "McpPlanInstallSource"
    },
    "McpPlanInstallSourceCandidate": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpPlanInstallSourceCandidateKind",
          "const": "candidate",
          "description": "Discriminator: plan from a previously returned candidate"
        },
        "candidateHandle": {
          "type": "string",
          "minLength": 1,
          "maxLength": 256,
          "description": "Single-use candidate handle. Consumed by this call, so a replay of the same handle is rejected."
        },
        "searchId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "description": "The runtime- or authority-minted `searchId` returned with the search that produced this candidate. A search implementation binds it to private candidate-handle context; a planning implementation must verify that context before returning a plan. The unavailable planning implementation in this contract layer validates presence but does not claim the verification has occurred. It identifies a search rather than a person and must never be joined with user identity to re-identify anyone."
        }
      },
      "required": [
        "kind",
        "candidateHandle",
        "searchId"
      ],
      "additionalProperties": false,
      "description": "Plan from a candidate returned by a previous catalog search.",
      "title": "McpPlanInstallSourceCandidate"
    },
    "McpPlanInstallSourceCandidateKind": {
      "type": "string",
      "enum": [
        "candidate"
      ],
      "description": "Discriminator for a candidate-backed install-plan source",
      "title": "McpPlanInstallSourceCandidateKind",
      "x-enumDescriptions": {
        "candidate": "Plan from a candidate returned by catalog search."
      }
    },
    "McpPlanInstallSourceCard": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpPlanInstallSourceCardKind",
          "const": "card",
          "description": "Discriminator: plan from a caller-supplied card"
        },
        "card": {
          "$ref": "#/definitions/McpServerCardReference",
          "description": "The card to plan from: exactly one of a URL or embedded data."
        }
      },
      "required": [
        "kind",
        "card"
      ],
      "additionalProperties": false,
      "description": "Plan from a card supplied directly by the caller, without a preceding search.",
      "title": "McpPlanInstallSourceCard"
    },
    "McpPlanInstallSourceCardKind": {
      "type": "string",
      "enum": [
        "card"
      ],
      "description": "Discriminator for a caller-supplied-card install-plan source",
      "title": "McpPlanInstallSourceCardKind",
      "x-enumDescriptions": {
        "card": "Plan directly from a caller-supplied card."
      }
    },
    "McpPlanPackageInstallMethod": {
      "type": "string",
      "enum": [
        "package"
      ],
      "description": "Discriminator for a package-backed transport choice",
      "title": "McpPlanPackageInstallMethod",
      "x-enumDescriptions": {
        "package": "Install and run a local package."
      }
    },
    "McpPlanPackageTransport": {
      "type": "string",
      "enum": [
        "stdio"
      ],
      "description": "Transport exposed by a locally launched package",
      "title": "McpPlanPackageTransport",
      "x-enumDescriptions": {
        "stdio": "A locally launched process spoken to over standard input and output."
      }
    },
    "McpPlanPolicyDecision": {
      "type": "string",
      "enum": [
        "allowed",
        "blocked",
        "requires-approval"
      ],
      "description": "What policy decided for a planned server",
      "title": "McpPlanPolicyDecision",
      "x-enumDescriptions": {
        "allowed": "Policy permits the server.",
        "blocked": "Policy forbids the server, so the plan cannot be applied.",
        "requires-approval": "Policy permits the server only after an explicit approval."
      }
    },
    "McpPlanPolicyResult": {
      "type": "object",
      "properties": {
        "decision": {
          "$ref": "#/definitions/McpPlanPolicyDecision",
          "description": "What policy decided for this server."
        },
        "source": {
          "$ref": "#/definitions/McpPlanPolicySource",
          "description": "Which authority produced the decision."
        },
        "reason": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation, safe to surface. Never contains a query, URL, handle, or secret."
        }
      },
      "required": [
        "decision",
        "source"
      ],
      "additionalProperties": false,
      "description": "Outcome of evaluating the planned server against registry and enterprise policy. Evaluation is read-only.",
      "title": "McpPlanPolicyResult"
    },
    "McpPlanPolicySource": {
      "type": "string",
      "enum": [
        "none",
        "enterprise-allowlist",
        "registry-policy",
        "local-trust"
      ],
      "description": "Which authority produced a policy decision",
      "title": "McpPlanPolicySource",
      "x-enumDescriptions": {
        "none": "No policy applied, so the server is permitted by default.",
        "enterprise-allowlist": "An enterprise allowlist evaluated the server.",
        "registry-policy": "The registry the card came from evaluated the server.",
        "local-trust": "Local trust settings evaluated the server."
      }
    },
    "McpPlanProvenance": {
      "type": "object",
      "properties": {
        "authority": {
          "type": "string",
          "minLength": 1,
          "description": "Authority associated with the validated card, without path, query, or credentials. Inert untrusted data."
        },
        "validatedAt": {
          "type": "string",
          "description": "ISO 8601 timestamp at which the runtime completed strict parsing and schema validation of the card content."
        },
        "cardDigest": {
          "$ref": "#/definitions/CardDigest",
          "description": "Semantic digest of the exact validated JSON content bound to the plan handle."
        },
        "mediaType": {
          "$ref": "#/definitions/McpServerCardMediaType",
          "description": "JSON MCP media type the validated card was interpreted as."
        }
      },
      "required": [
        "authority",
        "validatedAt",
        "cardDigest",
        "mediaType"
      ],
      "additionalProperties": false,
      "description": "Provenance of the exact validated JSON MCP card content bound privately to a completed plan and its opaque handle.",
      "title": "McpPlanProvenance"
    },
    "McpPlanRemoteInstallMethod": {
      "type": "string",
      "enum": [
        "remote"
      ],
      "description": "Discriminator for a remote-endpoint transport choice",
      "title": "McpPlanRemoteInstallMethod",
      "x-enumDescriptions": {
        "remote": "Connect to a remote endpoint."
      }
    },
    "McpPlanRemoteTransport": {
      "type": "string",
      "enum": [
        "http",
        "streamable-http",
        "sse"
      ],
      "description": "Transport exposed by a remote endpoint",
      "title": "McpPlanRemoteTransport",
      "x-enumDescriptions": {
        "http": "An HTTP endpoint.",
        "streamable-http": "A streamable HTTP endpoint.",
        "sse": "A server-sent events endpoint."
      }
    },
    "McpPlanRequiredValue": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpPlanRequiredValueScalar",
          "description": "One non-secret scalar value a transport choice needs before it can be applied."
        },
        {
          "$ref": "#/definitions/McpPlanRequiredValueEnum",
          "description": "One enumerated non-secret value a transport choice needs before it can be applied. The permitted values are structurally required."
        }
      ],
      "description": "One non-secret value a transport choice needs, represented as a scalar or enumerated variant so enum values cannot be missing or attached to another type.",
      "title": "McpPlanRequiredValue"
    },
    "McpPlanRequiredValueEnum": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpPlanRequiredValueEnumKind",
          "const": "enum",
          "description": "Discriminator: this required value uses a fixed enumeration."
        },
        "key": {
          "type": "string",
          "minLength": 1,
          "description": "Key the value is supplied under. Inert untrusted data."
        },
        "category": {
          "$ref": "#/definitions/McpPlanValueCategory",
          "description": "Where the value is applied when the server is launched."
        },
        "valueType": {
          "$ref": "#/definitions/McpPlanEnumValueType",
          "const": "enum",
          "description": "Discriminator: the value must be one of `enumValues`."
        },
        "required": {
          "type": "boolean",
          "description": "Whether the value must be present for the plan to be applicable."
        },
        "defaultValue": {
          "type": "string",
          "description": "Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data."
        },
        "title": {
          "type": "string",
          "maxLength": 200,
          "description": "Human-readable label from the card. Inert untrusted text."
        },
        "description": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation from the card. Inert untrusted text."
        },
        "enumValues": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "uniqueItems": true,
          "description": "Non-empty permitted value set. Inert untrusted data."
        },
        "isRepeated": {
          "type": "boolean",
          "description": "Whether the value may be supplied more than once."
        }
      },
      "required": [
        "kind",
        "key",
        "category",
        "valueType",
        "required",
        "enumValues",
        "isRepeated"
      ],
      "additionalProperties": false,
      "description": "One enumerated non-secret value a transport choice needs before it can be applied. The permitted values are structurally required.",
      "title": "McpPlanRequiredValueEnum"
    },
    "McpPlanRequiredValueEnumKind": {
      "type": "string",
      "enum": [
        "enum"
      ],
      "description": "Discriminator for an enumerated required value",
      "title": "McpPlanRequiredValueEnumKind",
      "x-enumDescriptions": {
        "enum": "The value uses a fixed non-empty enumeration."
      }
    },
    "McpPlanRequiredValueScalar": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpPlanRequiredValueScalarKind",
          "const": "scalar",
          "description": "Discriminator: this required value uses a scalar type."
        },
        "key": {
          "type": "string",
          "minLength": 1,
          "description": "Key the value is supplied under. Inert untrusted data."
        },
        "category": {
          "$ref": "#/definitions/McpPlanValueCategory",
          "description": "Where the value is applied when the server is launched."
        },
        "valueType": {
          "$ref": "#/definitions/McpPlanScalarValueType",
          "description": "Scalar type the value must conform to."
        },
        "required": {
          "type": "boolean",
          "description": "Whether the value must be present for the plan to be applicable."
        },
        "defaultValue": {
          "type": "string",
          "description": "Default supplied by the card, when the value can be resolved without input. Presence is the authoritative indication that a default exists. Inert untrusted data."
        },
        "title": {
          "type": "string",
          "maxLength": 200,
          "description": "Human-readable label from the card. Inert untrusted text."
        },
        "description": {
          "type": "string",
          "maxLength": 1000,
          "description": "Human-readable explanation from the card. Inert untrusted text."
        },
        "isRepeated": {
          "type": "boolean",
          "description": "Whether the value may be supplied more than once."
        }
      },
      "required": [
        "kind",
        "key",
        "category",
        "valueType",
        "required",
        "isRepeated"
      ],
      "additionalProperties": false,
      "description": "One non-secret scalar value a transport choice needs before it can be applied.",
      "title": "McpPlanRequiredValueScalar"
    },
    "McpPlanRequiredValueScalarKind": {
      "type": "string",
      "enum": [
        "scalar"
      ],
      "description": "Discriminator for a scalar required value",
      "title": "McpPlanRequiredValueScalarKind",
      "x-enumDescriptions": {
        "scalar": "The value uses one scalar type."
      }
    },
    "McpPlanResourceIdentity": {
      "type": "object",
      "properties": {
        "canonicalName": {
          "type": "string",
          "minLength": 1,
          "description": "Canonical, normalised name of the server, for example `io.github.owner/server`."
        },
        "serverName": {
          "type": "string",
          "minLength": 1,
          "description": "Local configuration key the server would be recorded under."
        },
        "version": {
          "type": "string",
          "description": "Version advertised by the card, when it declares one."
        },
        "registryId": {
          "type": "string",
          "description": "Registry identifier of the server, when it came from a registry."
        }
      },
      "required": [
        "canonicalName",
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Normalised identity of the MCP server a plan targets, independent of how the card spelled it.",
      "title": "McpPlanResourceIdentity"
    },
    "McpPlanScalarValueType": {
      "type": "string",
      "enum": [
        "string",
        "number",
        "boolean",
        "path"
      ],
      "description": "Scalar type a required value must conform to",
      "title": "McpPlanScalarValueType",
      "x-enumDescriptions": {
        "string": "Free text.",
        "number": "A number.",
        "boolean": "A boolean.",
        "path": "A filesystem path."
      }
    },
    "McpPlanScope": {
      "type": "string",
      "enum": [
        "user"
      ],
      "description": "Configuration scope an MCP install plan targets",
      "title": "McpPlanScope",
      "x-enumDescriptions": {
        "user": "The user's own MCP configuration."
      }
    },
    "McpPlanSecretPlaceholder": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1,
          "description": "Key the secret is supplied under. Inert untrusted data."
        },
        "placeholder": {
          "$ref": "#/definitions/McpPlanSecretReference",
          "description": "The runtime-assigned `${secret:<id>}` placeholder written into configuration in place of the value."
        },
        "title": {
          "type": "string",
          "maxLength": 200,
          "description": "Human-readable label from the card. Inert untrusted text."
        }
      },
      "required": [
        "key",
        "placeholder"
      ],
      "additionalProperties": false,
      "description": "A secret a transport choice needs, referenced by placeholder. No secret value ever appears in a plan, and the placeholder resolves against the keychain only when a plan is applied.",
      "title": "McpPlanSecretPlaceholder"
    },
    "McpPlanSecretReference": {
      "type": "string",
      "minLength": 11,
      "maxLength": 138,
      "pattern": "^\\$\\{secret:[A-Za-z0-9][A-Za-z0-9._-]{0,127}\\}$",
      "description": "A runtime-assigned secret placeholder. The identifier is carried once, inside the placeholder, so it cannot contradict a separate secret-id field.",
      "title": "McpPlanSecretReference"
    },
    "McpPlanTarget": {
      "type": "object",
      "properties": {
        "scope": {
          "$ref": "#/definitions/McpPlanScope",
          "description": "Configuration scope the plan targets."
        },
        "configKey": {
          "type": "string",
          "minLength": 1,
          "description": "Configuration key the server would be recorded under within that scope."
        }
      },
      "required": [
        "scope",
        "configKey"
      ],
      "additionalProperties": false,
      "description": "Where a plan would be written.",
      "title": "McpPlanTarget"
    },
    "McpPlanTransportChoice": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpPlanTransportChoicePackage",
          "description": "An eligible local-package transport choice. Package identity is required and a remote endpoint cannot be represented."
        },
        {
          "$ref": "#/definitions/McpPlanTransportChoiceRemote",
          "description": "An eligible remote-endpoint transport choice. The endpoint is required and package identity cannot be represented."
        }
      ],
      "description": "One eligible way to run the server, represented as a tagged package or remote variant so package identity and endpoint states cannot contradict the install method.",
      "title": "McpPlanTransportChoice"
    },
    "McpPlanTransportChoicePackage": {
      "type": "object",
      "properties": {
        "choiceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "description": "Stable identifier for this choice within the plan, used to select it when the plan is applied."
        },
        "transport": {
          "$ref": "#/definitions/McpPlanPackageTransport",
          "description": "Local process transport this package choice would use."
        },
        "installMethod": {
          "$ref": "#/definitions/McpPlanPackageInstallMethod",
          "const": "package",
          "description": "Discriminator: this choice runs a local package"
        },
        "packageType": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64,
          "description": "Packaging ecosystem, for example `oci` or `npm`."
        },
        "packageIdentifier": {
          "type": "string",
          "minLength": 1,
          "maxLength": 512,
          "description": "Package identifier. Inert untrusted data."
        },
        "requiredValues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanRequiredValue",
            "description": "One non-secret value a transport choice needs, represented as a scalar or enumerated variant so enum values cannot be missing or attached to another type."
          },
          "description": "Typed values this choice requires, excluding secrets."
        },
        "secretPlaceholders": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanSecretPlaceholder",
            "description": "A secret a transport choice needs, referenced by placeholder. No secret value ever appears in a plan, and the placeholder resolves against the keychain only when a plan is applied."
          },
          "description": "Secrets this choice requires, referenced by placeholder only."
        }
      },
      "required": [
        "choiceId",
        "transport",
        "installMethod",
        "packageType",
        "packageIdentifier",
        "requiredValues",
        "secretPlaceholders"
      ],
      "additionalProperties": false,
      "description": "An eligible local-package transport choice. Package identity is required and a remote endpoint cannot be represented.",
      "title": "McpPlanTransportChoicePackage"
    },
    "McpPlanTransportChoiceRemote": {
      "type": "object",
      "properties": {
        "choiceId": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "description": "Stable identifier for this choice within the plan, used to select it when the plan is applied."
        },
        "transport": {
          "$ref": "#/definitions/McpPlanRemoteTransport",
          "description": "Endpoint transport this remote choice would use."
        },
        "installMethod": {
          "$ref": "#/definitions/McpPlanRemoteInstallMethod",
          "const": "remote",
          "description": "Discriminator: this choice connects to a remote endpoint"
        },
        "endpoint": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048,
          "description": "Endpoint URL. Inert untrusted data."
        },
        "requiredValues": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanRequiredValue",
            "description": "One non-secret value a transport choice needs, represented as a scalar or enumerated variant so enum values cannot be missing or attached to another type."
          },
          "description": "Typed values this choice requires, excluding secrets."
        },
        "secretPlaceholders": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpPlanSecretPlaceholder",
            "description": "A secret a transport choice needs, referenced by placeholder. No secret value ever appears in a plan, and the placeholder resolves against the keychain only when a plan is applied."
          },
          "description": "Secrets this choice requires, referenced by placeholder only."
        }
      },
      "required": [
        "choiceId",
        "transport",
        "installMethod",
        "endpoint",
        "requiredValues",
        "secretPlaceholders"
      ],
      "additionalProperties": false,
      "description": "An eligible remote-endpoint transport choice. The endpoint is required and package identity cannot be represented.",
      "title": "McpPlanTransportChoiceRemote"
    },
    "McpPlanValueCategory": {
      "type": "string",
      "enum": [
        "environment-variable",
        "runtime-argument",
        "package-argument",
        "header",
        "url-variable"
      ],
      "description": "Where a required value is applied when the planned server is launched",
      "title": "McpPlanValueCategory",
      "x-enumDescriptions": {
        "environment-variable": "Set as an environment variable on the launched process.",
        "runtime-argument": "Passed to the runtime that launches the package.",
        "package-argument": "Passed to the packaged server itself.",
        "header": "Sent as a request header to a remote endpoint.",
        "url-variable": "Substituted into the remote endpoint URL."
      }
    },
    "McpRegisterExternalClientRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Logical server name for the external client"
        },
        "client": {
          "description": "In-process MCP Client instance. Marked internal: cannot be serialized across the JSON-RPC boundary.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "transport": {
          "description": "In-process MCP Transport instance. Marked internal: cannot be serialized across the JSON-RPC boundary.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "config": {
          "description": "In-process server config (MCPServerConfig) paired with the in-process client/transport. Marked internal alongside its companions.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "serverName",
        "client",
        "transport",
        "config"
      ],
      "additionalProperties": false,
      "description": "Registration parameters for an external MCP client.",
      "title": "McpRegisterExternalClientRequest",
      "visibility": "internal"
    },
    "McpReloadConfig": {
      "type": "object",
      "properties": {
        "mcpServers": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/McpServerConfig",
            "description": "MCP server configuration (stdio, remote HTTP/SSE, or in-process)"
          }
        },
        "disabledServers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enabledServers": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "cliEnabledServers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Server names the CLI enabled for this session via `--enable-mcp-server`."
        },
        "mcp3pEnabled": {
          "type": "boolean"
        },
        "includeWorkspaceSources": {
          "type": "boolean"
        },
        "configFilter": {
          "x-opaque-in-process": true
        },
        "githubMcpToolOptions": {
          "x-opaque-in-process": true
        },
        "githubMcpUserOverride": {
          "type": "boolean"
        },
        "secretStore": {
          "x-opaque-in-process": true
        },
        "activeGitHubToken": {
          "type": "string"
        },
        "useCachedToolSnapshots": {
          "type": "boolean"
        },
        "forceRestart": {
          "type": "boolean"
        }
      },
      "required": [
        "mcpServers"
      ],
      "additionalProperties": false,
      "description": "In-process MCP reload configuration.",
      "title": "McpReloadConfig",
      "visibility": "internal"
    },
    "McpReloadWithConfigRequest": {
      "type": "object",
      "properties": {
        "config": {
          "anyOf": [
            {},
            {
              "$ref": "#/definitions/McpReloadConfig",
              "description": "In-process MCP reload configuration.",
              "visibility": "internal"
            }
          ],
          "description": "Opaque runtime MCP reload configuration. Marked internal: an in-process runtime shape (reloadMcpServers throws over the wire).",
          "visibility": "internal",
          "x-opaque-in-process": true,
          "x-typescript-type": "McpReloadConfig"
        }
      },
      "required": [
        "config"
      ],
      "additionalProperties": false,
      "description": "Opaque MCP reload configuration.",
      "title": "McpReloadWithConfigRequest",
      "visibility": "internal"
    },
    "McpRemoveGitHubResult": {
      "type": "object",
      "properties": {
        "removed": {
          "type": "boolean",
          "description": "True when the auto-managed `github` MCP server was removed; false when no removal happened (e.g. user has explicitly configured a `github` server, or the server was not registered)."
        }
      },
      "required": [
        "removed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the auto-managed `github` MCP server was removed (false when nothing to remove).",
      "title": "McpRemoveGitHubResult"
    },
    "McpResource": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The resource URI (e.g. ui://... or file:///...)"
        },
        "name": {
          "type": "string",
          "description": "The programmatic name of the resource"
        },
        "title": {
          "type": "string",
          "description": "Optional human-readable display title"
        },
        "description": {
          "type": "string",
          "description": "Optional description of what this resource represents"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the resource, if known"
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "Resource size in bytes, when known"
        },
        "icons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpResourceIcon",
            "description": "A resource icon descriptor plus preserved non-standard icon fields."
          },
          "description": "Icons associated with this resource"
        },
        "annotations": {
          "$ref": "#/definitions/McpResourceAnnotations",
          "description": "Model/client annotations associated with this resource"
        },
        "_meta": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Resource-level metadata"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Server-provided non-standard descriptor fields preserved from the MCP response"
        }
      },
      "required": [
        "uri",
        "name"
      ],
      "additionalProperties": false,
      "description": "An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.",
      "title": "McpResource"
    },
    "McpResourceAnnotations": {
      "type": "object",
      "properties": {
        "audience": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Intended audience roles for this resource"
        },
        "priority": {
          "type": "number",
          "description": "Priority hint for model/client use"
        },
        "lastModified": {
          "type": "string",
          "description": "Last-modified timestamp hint"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Server-provided non-standard annotation fields preserved from the MCP response"
        }
      },
      "additionalProperties": false,
      "description": "Standard MCP resource annotations plus preserved non-standard annotation fields.",
      "title": "McpResourceAnnotations"
    },
    "McpResourceContent": {
      "type": "object",
      "properties": {
        "uri": {
          "type": "string",
          "description": "The resource URI"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the content"
        },
        "text": {
          "type": "string",
          "description": "Text content (e.g. HTML)"
        },
        "blob": {
          "type": "string",
          "description": "Base64-encoded binary content"
        },
        "_meta": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Resource-level metadata (CSP, permissions, etc.)"
        }
      },
      "required": [
        "uri"
      ],
      "additionalProperties": false,
      "description": "MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata.",
      "title": "McpResourceContent"
    },
    "McpResourceIcon": {
      "type": "object",
      "properties": {
        "src": {
          "type": "string",
          "description": "Icon URI"
        },
        "mimeType": {
          "type": "string",
          "description": "Icon MIME type, when known"
        },
        "sizes": {
          "type": "string",
          "description": "Icon sizes hint"
        },
        "theme": {
          "type": "string",
          "description": "Theme hint for this icon"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Server-provided non-standard icon fields preserved from the MCP response"
        }
      },
      "required": [
        "src"
      ],
      "additionalProperties": false,
      "description": "A resource icon descriptor plus preserved non-standard icon fields.",
      "title": "McpResourceIcon"
    },
    "McpResourcesListRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server whose resources to enumerate"
        },
        "cursor": {
          "type": "string",
          "description": "Opaque MCP pagination cursor from a prior `nextCursor` value"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "MCP server whose resources to enumerate.",
      "title": "McpResourcesListRequest",
      "stability": "experimental"
    },
    "McpResourcesListResult": {
      "type": "object",
      "properties": {
        "resources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpResource",
            "description": "An MCP resource descriptor (spec `Resource`): URI, name, and optional title, description, MIME type, size, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`."
          },
          "description": "Resources advertised by the server (proxied MCP `resources/list`)"
        },
        "nextCursor": {
          "type": "string",
          "description": "Opaque cursor for the next page, if the server has more resources"
        }
      },
      "required": [
        "resources"
      ],
      "additionalProperties": false,
      "description": "One page of resources advertised by the named MCP server.",
      "title": "McpResourcesListResult"
    },
    "McpResourcesListTemplatesRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server whose resource templates to enumerate"
        },
        "cursor": {
          "type": "string",
          "description": "Opaque MCP pagination cursor from a prior `nextCursor` value"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "MCP server whose resource templates to enumerate.",
      "title": "McpResourcesListTemplatesRequest",
      "stability": "experimental"
    },
    "McpResourcesListTemplatesResult": {
      "type": "object",
      "properties": {
        "resourceTemplates": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpResourceTemplate",
            "description": "An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`."
          },
          "description": "Resource templates advertised by the server (proxied MCP `resources/templates/list`)"
        },
        "nextCursor": {
          "type": "string",
          "description": "Opaque cursor for the next page, if the server has more resource templates"
        }
      },
      "required": [
        "resourceTemplates"
      ],
      "additionalProperties": false,
      "description": "One page of resource templates advertised by the named MCP server.",
      "title": "McpResourcesListTemplatesResult"
    },
    "McpResourcesReadRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Name of the MCP server hosting the resource"
        },
        "uri": {
          "type": "string",
          "description": "Resource URI"
        }
      },
      "required": [
        "serverName",
        "uri"
      ],
      "additionalProperties": false,
      "description": "MCP server and resource URI to fetch.",
      "title": "McpResourcesReadRequest",
      "stability": "experimental"
    },
    "McpResourcesReadResult": {
      "type": "object",
      "properties": {
        "contents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpResourceContent",
            "description": "MCP resource content with URI, optional MIME type, text or base64 blob, and resource metadata."
          },
          "description": "Resource contents returned by the server"
        }
      },
      "required": [
        "contents"
      ],
      "additionalProperties": false,
      "description": "Resource contents returned by the MCP server.",
      "title": "McpResourcesReadResult"
    },
    "McpResourceTemplate": {
      "type": "object",
      "properties": {
        "uriTemplate": {
          "type": "string",
          "description": "An RFC 6570 URI template for constructing resource URIs"
        },
        "name": {
          "type": "string",
          "description": "The programmatic name of the resource template"
        },
        "title": {
          "type": "string",
          "description": "Optional human-readable display title"
        },
        "description": {
          "type": "string",
          "description": "Optional description of what this template is for"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type for resources matching this template, if uniform"
        },
        "icons": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpResourceIcon",
            "description": "A resource icon descriptor plus preserved non-standard icon fields."
          },
          "description": "Icons associated with resources matching this template"
        },
        "annotations": {
          "$ref": "#/definitions/McpResourceAnnotations",
          "description": "Model/client annotations associated with this template"
        },
        "_meta": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Resource-template-level metadata"
        },
        "additionalProperties": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Server-provided non-standard descriptor fields preserved from the MCP response"
        }
      },
      "required": [
        "uriTemplate",
        "name"
      ],
      "additionalProperties": false,
      "description": "An MCP resource template descriptor (spec `ResourceTemplate`): an RFC 6570 URI template, name, and optional title, description, MIME type, icons, annotations, and metadata. Server-provided fields outside the standard descriptor shape are exposed under `additionalProperties`.",
      "title": "McpResourceTemplate"
    },
    "McpRestartServerRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server to restart"
        },
        "config": {
          "$ref": "#/definitions/McpSerializableServerConfig",
          "description": "Replacement MCP server configuration (stdio process or remote HTTP/SSE). Omit to restart the server with its already-registered configuration (config-free restart-by-name)."
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name and optional replacement configuration for an individual MCP server restart. Omit `config` for a config-free restart-by-name of an already-configured server.",
      "title": "McpRestartServerRequest",
      "stability": "experimental"
    },
    "McpSafeForTelemetry": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "$ref": "#/definitions/McpSafeForTelemetryFields",
          "description": "Per-field MCP telemetry-obfuscation policy."
        }
      ],
      "description": "Telemetry-obfuscation policy for an MCP server's tools.",
      "title": "McpSafeForTelemetry",
      "x-opaque-json": true
    },
    "McpSafeForTelemetryFields": {
      "type": "object",
      "properties": {
        "name": {
          "type": "boolean",
          "description": "Whether the MCP tool name may be included in telemetry without obfuscation."
        },
        "inputsNames": {
          "type": "boolean",
          "description": "Whether MCP tool input names may be included in telemetry without obfuscation."
        }
      },
      "required": [
        "name",
        "inputsNames"
      ],
      "additionalProperties": false,
      "description": "Per-field MCP telemetry-obfuscation policy.",
      "title": "McpSafeForTelemetryFields"
    },
    "McpSamplingExecutionAction": {
      "type": "string",
      "enum": [
        "success",
        "failure",
        "cancelled"
      ],
      "description": "Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution.",
      "title": "McpSamplingExecutionAction",
      "x-enumDescriptions": {
        "success": "The sampling inference completed and produced a result.",
        "failure": "The sampling inference failed or was rejected.",
        "cancelled": "The sampling inference was cancelled before completion."
      }
    },
    "McpSamplingExecutionResult": {
      "type": "object",
      "properties": {
        "action": {
          "$ref": "#/definitions/McpSamplingExecutionAction",
          "description": "Outcome of the sampling inference. 'success' produced a response; 'failure' encountered an error (including agent-side rejection by content filter or criteria); 'cancelled' the caller cancelled this execution via cancelSamplingExecution."
        },
        "result": {
          "$ref": "#/definitions/McpExecuteSamplingResult",
          "description": "MCP CreateMessageResult payload (with optional 'tools' extension), present when action='success'. Treated as opaque at the schema layer; consumers should construct/consume it per the MCP CreateMessageResult shape."
        },
        "error": {
          "type": "string",
          "description": "Error description, present when action='failure'."
        }
      },
      "required": [
        "action"
      ],
      "additionalProperties": false,
      "description": "Outcome of an MCP sampling execution: success result, failure error, or cancellation.",
      "title": "McpSamplingExecutionResult"
    },
    "McpSerializableServerConfig": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpServerConfigStdio",
          "description": "Stdio MCP server configuration launched as a child process."
        },
        {
          "$ref": "#/definitions/McpServerConfigHttp",
          "description": "Remote MCP server configuration accessed over HTTP or SSE."
        }
      ],
      "description": "Serializable MCP server configuration (stdio process or remote HTTP/SSE)",
      "title": "McpSerializableServerConfig",
      "x-opaque-json": true
    },
    "McpServer": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "pattern": "^[^\\x00-\\x1f/\\x7f-\\x9f}]+(?:\\/[^\\x00-\\x1f/\\x7f-\\x9f}]+)*$",
          "description": "Server name (config key)"
        },
        "status": {
          "$ref": "#/definitions/McpServerStatus",
          "description": "Connection status: connected, failed, needs-auth, pending, disabled, stopped, or not_configured"
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "Configuration source: user, workspace, plugin, or builtin"
        },
        "sourcePlugin": {
          "type": "string",
          "description": "Plugin name that provided this server, when source is plugin."
        },
        "sourcePluginVersion": {
          "type": "string",
          "description": "Plugin version that provided this server, when source is plugin."
        },
        "error": {
          "type": "string",
          "description": "Error message if the server failed to connect"
        }
      },
      "required": [
        "name",
        "status"
      ],
      "additionalProperties": false,
      "description": "MCP server status entry, including config source/plugin source and any connection error.",
      "title": "McpServer"
    },
    "McpServerAuthConfig": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "$ref": "#/definitions/McpServerAuthConfigRedirectPort",
          "description": "Authentication settings with optional redirect port configuration."
        }
      ],
      "description": "Set to `true` to use defaults, or provide an object with additional auth or OIDC settings.",
      "title": "McpServerAuthConfig",
      "x-opaque-json": true
    },
    "McpServerAuthConfigRedirectPort": {
      "type": "object",
      "properties": {
        "redirectPort": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535,
          "description": "Fixed port for the OAuth redirect callback server."
        }
      },
      "description": "Authentication settings with optional redirect port configuration.",
      "title": "McpServerAuthConfigRedirectPort"
    },
    "McpServerCardEmbedded": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpServerCardEmbeddedKind",
          "const": "embedded",
          "description": "Discriminator: the card is embedded, and carries no URL"
        },
        "mediaType": {
          "$ref": "#/definitions/McpServerCardMediaType",
          "description": "Media type the card is expected to conform to."
        },
        "data": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1048576,
          "description": "The card document verbatim, treated as inert untrusted bytes. The runtime parses and validates it; the host is not expected to interpret it. Never logged."
        }
      },
      "required": [
        "kind",
        "mediaType",
        "data"
      ],
      "additionalProperties": false,
      "description": "An MCP server card supplied inline as an inert document.",
      "title": "McpServerCardEmbedded"
    },
    "McpServerCardEmbeddedKind": {
      "type": "string",
      "enum": [
        "embedded"
      ],
      "description": "Discriminator for an embedded MCP server card",
      "title": "McpServerCardEmbeddedKind",
      "x-enumDescriptions": {
        "embedded": "Use the embedded card document."
      }
    },
    "McpServerCardMediaType": {
      "type": "string",
      "enum": [
        "application/mcp-server-card+json",
        "application/mcp-server+json"
      ],
      "description": "JSON MCP card media type accepted for install planning",
      "title": "McpServerCardMediaType",
      "x-enumDescriptions": {
        "application/mcp-server-card+json": "The current MCP server card media type.",
        "application/mcp-server+json": "The legacy MCP server card media type, accepted for compatibility."
      }
    },
    "McpServerCardReference": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpServerCardUrl",
          "description": "An MCP server card to be retrieved from a URL through the runtime's hardened fetch boundary."
        },
        {
          "$ref": "#/definitions/McpServerCardEmbedded",
          "description": "An MCP server card supplied inline as an inert document."
        }
      ],
      "description": "A card supplied directly by the caller. Exactly one of a URL or embedded data, encoded structurally so neither both nor neither can be expressed.",
      "title": "McpServerCardReference"
    },
    "McpServerCardUrl": {
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/definitions/McpServerCardUrlKind",
          "const": "url",
          "description": "Discriminator: the card is URL-backed, and carries no embedded data"
        },
        "mediaType": {
          "$ref": "#/definitions/McpServerCardMediaType",
          "description": "Media type the card is expected to conform to."
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2048,
          "description": "Card URL. Retrieved only through the runtime's hardened boundary, with scheme, credential, address-range, redirect, timeout, and response-size controls applied. Never logged."
        }
      },
      "required": [
        "kind",
        "mediaType",
        "url"
      ],
      "additionalProperties": false,
      "description": "An MCP server card to be retrieved from a URL through the runtime's hardened fetch boundary.",
      "title": "McpServerCardUrl"
    },
    "McpServerCardUrlKind": {
      "type": "string",
      "enum": [
        "url"
      ],
      "description": "Discriminator for a URL-backed MCP server card",
      "title": "McpServerCardUrlKind",
      "x-enumDescriptions": {
        "url": "Retrieve the card from its URL."
      }
    },
    "McpServerConfig": {
      "anyOf": [
        {
          "$ref": "#/definitions/McpServerConfigStdio",
          "description": "Stdio MCP server configuration launched as a child process."
        },
        {
          "$ref": "#/definitions/McpServerConfigHttp",
          "description": "Remote MCP server configuration accessed over HTTP or SSE."
        },
        {
          "$ref": "#/definitions/McpServerConfigMemory",
          "description": "In-process MCP server configuration used by embedded SDK clients.",
          "visibility": "internal"
        }
      ],
      "description": "MCP server configuration (stdio, remote HTTP/SSE, or in-process)",
      "title": "McpServerConfig",
      "x-opaque-json": true
    },
    "McpServerConfigDeferTools": {
      "type": "string",
      "enum": [
        "auto",
        "never"
      ],
      "description": "Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never)",
      "title": "McpServerConfigDeferTools",
      "x-enumDescriptions": {
        "auto": "Tools may be deferred under certain conditions",
        "never": "Tools are always included in the initial tool list, even when tool search is enabled."
      }
    },
    "McpServerConfigHttp": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string",
          "description": "Optional human-readable server name."
        },
        "safeForTelemetry": {
          "$ref": "#/definitions/McpSafeForTelemetry",
          "description": "Telemetry-obfuscation policy for this server's tools."
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tools to include. Defaults to all tools if not specified."
        },
        "type": {
          "$ref": "#/definitions/McpServerConfigHttpType",
          "description": "Remote transport type. Defaults to \"http\" when omitted."
        },
        "isDefaultServer": {
          "type": "boolean",
          "description": "Whether this server is a built-in fallback used when the user has not configured their own server."
        },
        "filterMapping": {
          "$ref": "#/definitions/FilterMapping",
          "description": "Content filtering mode to apply to all tools, or a map of tool name to content filtering mode."
        },
        "timeout": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "duration",
          "description": "Timeout in milliseconds for tool discovery and tool calls."
        },
        "oidc": {
          "$ref": "#/definitions/McpServerAuthConfig",
          "description": "Set to `true` to use defaults, or provide an object with additional auth or OIDC settings."
        },
        "auth": {
          "$ref": "#/definitions/McpServerAuthConfig",
          "description": "Set to `true` to use defaults, or provide an object with additional auth or OIDC settings."
        },
        "deferTools": {
          "$ref": "#/definitions/McpServerConfigDeferTools",
          "description": "Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never)"
        },
        "disableToolCache": {
          "type": "boolean",
          "description": "Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected."
        },
        "disableSecretMasking": {
          "type": "boolean",
          "description": "Whether secret masking is disabled for calls to this server."
        },
        "excludeTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool names excluded after the include filter is applied."
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Event types this server receives as Copilot notifications."
        },
        "notifications": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Copilot notification types this server may send to the host."
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "The origin of this server configuration."
        },
        "sourcePlugin": {
          "type": "string",
          "description": "Plugin that provided this server."
        },
        "sourcePluginVersion": {
          "type": "string",
          "description": "Version of the plugin that provided this server."
        },
        "sourcePluginSpec": {
          "type": "boolean",
          "description": "Whether the providing plugin uses the Open Plugin Spec."
        },
        "sourcePath": {
          "type": "string",
          "description": "Source file path recorded while loading the config."
        },
        "configWarnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Configuration warnings recorded while loading the server."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the remote MCP server endpoint."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "HTTP headers to include in requests to the remote MCP server."
        },
        "headersRefreshTtlMs": {
          "type": "integer",
          "description": "Dynamic-header refresh cache lifetime in milliseconds."
        },
        "oauthClientId": {
          "type": "string",
          "description": "OAuth client ID for a pre-registered remote MCP OAuth client."
        },
        "oauthPublicClient": {
          "type": "boolean",
          "description": "Whether the configured OAuth client is public and does not require a client secret."
        },
        "oauthGrantType": {
          "$ref": "#/definitions/McpServerConfigHttpOauthGrantType",
          "description": "OAuth grant type to use when authenticating to the remote MCP server."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "description": "Remote MCP server configuration accessed over HTTP or SSE.",
      "title": "McpServerConfigHttp"
    },
    "McpServerConfigHttpOauthGrantType": {
      "type": "string",
      "enum": [
        "authorization_code",
        "client_credentials"
      ],
      "description": "OAuth grant type to use when authenticating to the remote MCP server.",
      "title": "McpServerConfigHttpOauthGrantType",
      "x-enumDescriptions": {
        "authorization_code": "Interactive browser-based authorization code flow with PKCE.",
        "client_credentials": "Headless client credentials flow using the configured OAuth client."
      }
    },
    "McpServerConfigHttpType": {
      "type": "string",
      "enum": [
        "http",
        "sse"
      ],
      "default": "http",
      "description": "Remote transport type. Defaults to \"http\" when omitted.",
      "title": "McpServerConfigHttpType",
      "x-enumDescriptions": {
        "http": "Streamable HTTP transport.",
        "sse": "Server-Sent Events transport."
      }
    },
    "McpServerConfigMemory": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/McpServerConfigMemoryType"
        },
        "serverInstance": {
          "description": "In-process MCP server instance. This value cannot cross a JSON-RPC boundary.",
          "visibility": "internal",
          "x-opaque-in-process": true,
          "x-typescript-type": "MCPInMemoryServerInstance"
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tools to include. Defaults to all tools if not specified."
        },
        "displayName": {
          "type": "string",
          "description": "Optional human-readable server name."
        },
        "isDefaultServer": {
          "type": "boolean",
          "description": "Whether this server is a built-in fallback."
        },
        "filterMapping": {
          "$ref": "#/definitions/FilterMapping",
          "description": "Content filtering mode to apply to this server's tools."
        },
        "safeForTelemetry": {
          "$ref": "#/definitions/McpSafeForTelemetry",
          "description": "Telemetry-obfuscation policy for this server's tools."
        },
        "timeout": {
          "type": "integer",
          "description": "Timeout in milliseconds for tool discovery and tool calls."
        },
        "oidc": {
          "$ref": "#/definitions/McpServerAuthConfig",
          "description": "Set to `true` to use default OIDC settings."
        },
        "deferTools": {
          "$ref": "#/definitions/McpServerConfigDeferTools",
          "description": "Controls whether tools can be loaded on demand."
        },
        "disableToolCache": {
          "type": "boolean",
          "description": "Whether persisted tool snapshots are disabled."
        },
        "disableSecretMasking": {
          "type": "boolean",
          "description": "Whether secret masking is disabled for calls to this server."
        },
        "excludeTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool names excluded after the include filter is applied."
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Event types this server receives as Copilot notifications."
        },
        "notifications": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Copilot notification types this server may send to the host."
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "The origin of this server configuration."
        },
        "sourcePlugin": {
          "type": "string",
          "description": "Plugin that provided this server."
        },
        "sourcePluginVersion": {
          "type": "string",
          "description": "Version of the plugin that provided this server."
        },
        "sourcePluginSpec": {
          "type": "boolean",
          "description": "Whether the providing plugin uses the Open Plugin Spec."
        },
        "sourcePath": {
          "type": "string",
          "description": "Source file path recorded while loading the config."
        },
        "configWarnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Configuration warnings recorded while loading the server."
        }
      },
      "required": [
        "type",
        "serverInstance"
      ],
      "additionalProperties": false,
      "description": "In-process MCP server configuration used by embedded SDK clients.",
      "title": "McpServerConfigMemory",
      "visibility": "internal"
    },
    "McpServerConfigMemoryType": {
      "type": "string",
      "enum": [
        "memory"
      ],
      "description": "In-process MCP transport type.",
      "title": "McpServerConfigMemoryType",
      "visibility": "internal"
    },
    "McpServerConfigStdio": {
      "type": "object",
      "properties": {
        "displayName": {
          "type": "string",
          "description": "Optional human-readable server name."
        },
        "safeForTelemetry": {
          "$ref": "#/definitions/McpSafeForTelemetry",
          "description": "Telemetry-obfuscation policy for this server's tools."
        },
        "tools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tools to include. Defaults to all tools if not specified."
        },
        "isDefaultServer": {
          "type": "boolean",
          "description": "Whether this server is a built-in fallback used when the user has not configured their own server."
        },
        "filterMapping": {
          "$ref": "#/definitions/FilterMapping",
          "description": "Content filtering mode to apply to all tools, or a map of tool name to content filtering mode."
        },
        "timeout": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "duration",
          "description": "Timeout in milliseconds for tool discovery and tool calls."
        },
        "oidc": {
          "$ref": "#/definitions/McpServerAuthConfig",
          "description": "Set to `true` to use defaults, or provide an object with additional auth or OIDC settings."
        },
        "auth": {
          "$ref": "#/definitions/McpServerAuthConfig",
          "description": "Set to `true` to use defaults, or provide an object with additional auth or OIDC settings."
        },
        "deferTools": {
          "$ref": "#/definitions/McpServerConfigDeferTools",
          "description": "Controls if tools provided by this server can be loaded on demand via tool search (auto) or always included in the initial tool list (never)"
        },
        "disableToolCache": {
          "type": "boolean",
          "description": "Set to true to disable persisted MCP tool snapshots for this server. Live tool discovery is unaffected."
        },
        "disableSecretMasking": {
          "type": "boolean",
          "description": "Whether secret masking is disabled for calls to this server."
        },
        "excludeTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tool names excluded after the include filter is applied."
        },
        "events": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Event types this server receives as Copilot notifications."
        },
        "notifications": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Copilot notification types this server may send to the host."
        },
        "source": {
          "$ref": "#/definitions/McpServerSource",
          "description": "The origin of this server configuration."
        },
        "sourcePlugin": {
          "type": "string",
          "description": "Plugin that provided this server."
        },
        "sourcePluginVersion": {
          "type": "string",
          "description": "Version of the plugin that provided this server."
        },
        "sourcePluginSpec": {
          "type": "boolean",
          "description": "Whether the providing plugin uses the Open Plugin Spec."
        },
        "sourcePath": {
          "type": "string",
          "description": "Source file path recorded while loading the config."
        },
        "configWarnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Configuration warnings recorded while loading the server."
        },
        "command": {
          "type": "string",
          "description": "Executable command used to start the Stdio MCP server process."
        },
        "args": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": [],
          "description": "Command-line arguments passed to the Stdio MCP server process."
        },
        "cwd": {
          "type": "string",
          "description": "Working directory for the Stdio MCP server process."
        },
        "env": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables to pass to the Stdio MCP server process."
        },
        "type": {
          "$ref": "#/definitions/McpServerConfigStdioType",
          "description": "Local transport type. Defaults to stdio when omitted."
        }
      },
      "required": [
        "command"
      ],
      "additionalProperties": false,
      "description": "Stdio MCP server configuration launched as a child process.",
      "title": "McpServerConfigStdio"
    },
    "McpServerConfigStdioType": {
      "type": "string",
      "enum": [
        "local",
        "stdio"
      ],
      "description": "Local MCP transport type.",
      "title": "McpServerConfigStdioType",
      "x-enumDescriptions": {
        "local": "Legacy alias for the local stdio transport.",
        "stdio": "Server communicates over stdio with a local child process."
      }
    },
    "McpServerFailureInfo": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Failure message produced when the MCP server connection failed."
        },
        "timestamp": {
          "type": "integer",
          "minimum": 0,
          "description": "epoch-ms timestamp at which the failure was recorded."
        }
      },
      "required": [
        "message",
        "timestamp"
      ],
      "additionalProperties": false,
      "description": "Recorded MCP server connection failure.",
      "title": "McpServerFailureInfo"
    },
    "McpServerList": {
      "type": "object",
      "properties": {
        "servers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpServer",
            "description": "MCP server status entry, including config source/plugin source and any connection error."
          },
          "description": "Configured MCP servers"
        },
        "host": {
          "$ref": "#/definitions/McpHostState",
          "description": "Host-level state, omitted when no MCP host is initialized."
        }
      },
      "required": [
        "servers"
      ],
      "additionalProperties": false,
      "description": "MCP servers configured for the session, with their connection status and host-level state.",
      "title": "McpServerList"
    },
    "McpServerNeedsAuthInfo": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "integer",
          "minimum": 0,
          "description": "epoch-ms timestamp at which the server signalled it needs authentication."
        }
      },
      "required": [
        "timestamp"
      ],
      "additionalProperties": false,
      "description": "Recorded MCP server pending-auth state.",
      "title": "McpServerNeedsAuthInfo"
    },
    "McpServerSource": {
      "type": "string",
      "enum": [
        "user",
        "workspace",
        "plugin",
        "builtin"
      ],
      "description": "Configuration source: user, workspace, plugin, or builtin",
      "title": "McpServerSource",
      "x-enumDescriptions": {
        "user": "Server configured in the user's global MCP configuration.",
        "workspace": "Server configured by the current workspace.",
        "plugin": "Server contributed by an installed plugin.",
        "builtin": "Server bundled with the runtime."
      }
    },
    "McpServerStatus": {
      "type": "string",
      "enum": [
        "connected",
        "failed",
        "needs-auth",
        "pending",
        "disabled",
        "stopped",
        "not_configured"
      ],
      "description": "Connection status: connected, failed, needs-auth, pending, disabled, stopped, or not_configured",
      "title": "McpServerStatus",
      "x-enumDescriptions": {
        "connected": "The server is connected and available.",
        "failed": "The server failed to connect or initialize.",
        "needs-auth": "The server requires authentication before it can connect.",
        "pending": "The server connection is still being established.",
        "disabled": "The server is configured but disabled.",
        "stopped": "The server was intentionally stopped and can be restarted on demand when policy permits; a server quarantined by restrictive managed policy stays stopped and cannot be restarted until the policy allows it.",
        "not_configured": "The server is not configured for this session."
      }
    },
    "McpSetEnvValueModeDetails": {
      "type": "string",
      "enum": [
        "direct",
        "indirect"
      ],
      "description": "How environment-variable values supplied to MCP servers are resolved. \"direct\" passes literal string values; \"indirect\" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to \"direct\".",
      "title": "McpSetEnvValueModeDetails",
      "x-enumDescriptions": {
        "direct": "Treat MCP server environment values as literal strings.",
        "indirect": "Treat MCP server environment values as host-side references to resolve before launch."
      }
    },
    "McpSetEnvValueModeParams": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/McpSetEnvValueModeDetails",
          "description": "How environment-variable values supplied to MCP servers are resolved. \"direct\" passes literal string values; \"indirect\" treats values as references (e.g. names of environment variables on the host) that the runtime resolves before launch. Defaults to the runtime's startup mode; clients that intentionally launch MCP servers with literal values (e.g. CLI prompt mode and ACP) set this to \"direct\"."
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Mode controlling how MCP server env values are resolved (`direct` or `indirect`).",
      "title": "McpSetEnvValueModeParams",
      "stability": "experimental"
    },
    "McpSetEnvValueModeResult": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/McpSetEnvValueModeDetails",
          "description": "Mode recorded on the session after the update"
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Env-value mode recorded on the session after the update.",
      "title": "McpSetEnvValueModeResult"
    },
    "McpStartServerRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server to start"
        },
        "config": {
          "$ref": "#/definitions/McpSerializableServerConfig",
          "description": "MCP server configuration (stdio process or remote HTTP/SSE). Omit to start the server with its already-registered configuration (config-free start-by-name)."
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name and optional configuration for an individual MCP server start. Omit `config` for a config-free start-by-name of an already-configured server.",
      "title": "McpStartServerRequest",
      "stability": "experimental"
    },
    "McpStartServersResult": {
      "type": "object",
      "properties": {
        "filteredServers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpFilteredServer",
            "description": "MCP server filtered by policy, with name, reason, and optional redacted reason."
          },
          "description": "Servers filtered out before startup"
        },
        "allowedServers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpAllowedServer",
            "description": "MCP server allowed by policy, with server name and optional PII-free explanatory note."
          },
          "description": "Non-default servers allowed by policy"
        },
        "failedServers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpFailedServer",
            "description": "MCP server whose connection attempt failed."
          },
          "description": "Servers whose connection attempt failed."
        }
      },
      "required": [
        "filteredServers"
      ],
      "additionalProperties": false,
      "description": "MCP server startup filtering result.",
      "title": "McpStartServersResult"
    },
    "McpStopServerRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Name of the MCP server to stop"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name for an individual MCP server stop.",
      "title": "McpStopServerRequest",
      "stability": "experimental"
    },
    "McpTaskMetadata": {
      "type": "object",
      "properties": {
        "ttl": {
          "type": "integer",
          "description": "Task time-to-live."
        }
      },
      "description": "Metadata controlling an MCP task's lifetime.",
      "title": "McpTaskMetadata"
    },
    "McpTools": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Tool name."
        },
        "description": {
          "type": "string",
          "description": "Tool description, when provided."
        },
        "ui": {
          "$ref": "#/definitions/McpToolUi",
          "description": "Normalized MCP Apps discovery metadata. An empty object indicates that a valid `_meta.ui` block was present without recognized fields."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "MCP tool metadata with tool name, optional description, and normalized MCP Apps discovery metadata.",
      "title": "McpTools"
    },
    "McpToolUi": {
      "type": "object",
      "properties": {
        "resourceUri": {
          "type": "string",
          "description": "URI of the tool's MCP App resource, typically a `ui://` resource identifier. Use `session.mcp.resources.read` to fetch its HTML and resource metadata."
        },
        "visibility": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/McpToolUiVisibility",
            "description": "Consumer allowed to call an MCP tool."
          },
          "description": "Tool visibility advertised by the server. When absent, MCP Apps defaults apply."
        }
      },
      "additionalProperties": false,
      "description": "Normalized MCP Apps discovery metadata from a tool's `_meta.ui` block.",
      "title": "McpToolUi"
    },
    "McpToolUiVisibility": {
      "type": "string",
      "enum": [
        "model",
        "app"
      ],
      "description": "Consumer allowed to call an MCP tool.",
      "title": "McpToolUiVisibility",
      "x-enumDescriptions": {
        "model": "The model may call the tool.",
        "app": "An MCP App view may call the tool."
      }
    },
    "McpUnregisterExternalClientRequest": {
      "type": "object",
      "properties": {
        "serverName": {
          "type": "string",
          "description": "Server name of the external client to unregister"
        }
      },
      "required": [
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Server name identifying the external client to remove.",
      "title": "McpUnregisterExternalClientRequest",
      "visibility": "internal"
    },
    "MemoryConfiguration": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether memory is enabled for the session."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Memory configuration for this session.",
      "title": "MemoryConfiguration"
    },
    "MetadataContextAttributionResult": {
      "type": "object",
      "properties": {
        "contextAttribution": {
          "$ref": "#/definitions/SessionContextAttribution",
          "description": "Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached)."
        }
      },
      "required": [
        "contextAttribution"
      ],
      "additionalProperties": false,
      "description": "Per-source attribution breakdown for the session's current context window, or null if uninitialized.",
      "title": "MetadataContextAttributionResult"
    },
    "MetadataContextHeaviestMessagesRequest": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum number of messages to return, most-expensive first. Omit for the server default."
        }
      },
      "additionalProperties": false,
      "description": "Parameters for the heaviest-messages query.",
      "title": "MetadataContextHeaviestMessagesRequest",
      "stability": "experimental"
    },
    "MetadataContextHeaviestMessagesResult": {
      "type": "object",
      "properties": {
        "totalTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total token count of the current context window, so callers can compute each message's share without a second call."
        },
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ContextHeaviestMessage",
            "description": "A single large message currently in context."
          },
          "description": "Heaviest messages, most-expensive first."
        }
      },
      "required": [
        "totalTokens",
        "messages"
      ],
      "additionalProperties": false,
      "description": "The heaviest individual messages in the session's context window, most-expensive first.",
      "title": "MetadataContextHeaviestMessagesResult"
    },
    "MetadataContextInfoRequest": {
      "type": "object",
      "properties": {
        "promptTokenLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum prompt tokens allowed by the target model. Pass 0 to use the runtime default."
        },
        "outputTokenLimit": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum output tokens allowed by the target model. Pass 0 if unknown."
        },
        "selectedModel": {
          "type": "string",
          "description": "Model identifier used for tokenization. Omit to use the session default. Used both for token counting and to compute display values."
        }
      },
      "required": [
        "promptTokenLimit",
        "outputTokenLimit"
      ],
      "additionalProperties": false,
      "description": "Model identifier and token limits used to compute the context-info breakdown.",
      "title": "MetadataContextInfoRequest",
      "stability": "experimental"
    },
    "MetadataContextInfoResult": {
      "type": "object",
      "properties": {
        "contextInfo": {
          "$ref": "#/definitions/SessionContextInfo",
          "description": "Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached)."
        }
      },
      "required": [
        "contextInfo"
      ],
      "additionalProperties": false,
      "description": "Token breakdown for the session's current context window, or null if uninitialized.",
      "title": "MetadataContextInfoResult"
    },
    "MetadataIsProcessingResult": {
      "type": "object",
      "properties": {
        "processing": {
          "type": "boolean",
          "description": "Whether the session is currently processing user/agent messages. False for non-local sessions (which don't run a local agentic loop). Reflects an in-flight turn or background continuation."
        }
      },
      "required": [
        "processing"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the local session is currently processing a turn or background continuation.",
      "title": "MetadataIsProcessingResult"
    },
    "MetadataRecomputeContextTokensRequest": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "Model identifier used for tokenization. The runtime token-counts both chat-context and system-context messages against this model."
        }
      },
      "required": [
        "modelId"
      ],
      "additionalProperties": false,
      "description": "Model identifier to use when re-tokenizing the session's existing messages.",
      "title": "MetadataRecomputeContextTokensRequest",
      "stability": "experimental"
    },
    "MetadataRecomputeContextTokensResult": {
      "type": "object",
      "properties": {
        "totalTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Sum of tokens across chat-context and system-context messages currently held by the session."
        },
        "messagesTokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Tokens contributed by user/assistant/tool messages (excludes system/developer prompts)."
        },
        "systemTokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Tokens contributed by system/developer prompt snapshots."
        }
      },
      "required": [
        "totalTokens",
        "messagesTokenCount",
        "systemTokenCount"
      ],
      "additionalProperties": false,
      "description": "Re-tokenize the session's existing messages against `modelId` and return the token totals. Useful for hosts that want an initial estimate of context usage on session resume, before the next agent turn fires `session.context_info_changed` events. Returns zeros for an empty session.",
      "title": "MetadataRecomputeContextTokensResult"
    },
    "MetadataRecordContextChangeRequest": {
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/definitions/SessionWorkingDirectoryContext",
          "description": "Updated working directory and git context. Emitted as the new payload of `session.context_changed`."
        }
      },
      "required": [
        "context"
      ],
      "additionalProperties": false,
      "description": "Updated working-directory/git context to record on the session.",
      "title": "MetadataRecordContextChangeRequest",
      "stability": "experimental"
    },
    "MetadataRecordContextChangeResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Notify the session that its working directory context has changed. Emits a `session.context_changed` event so consumers (telemetry, OTel tracker, ACP, the timeline UI) can react. Use this when the host has detected a cwd/branch/repo change outside the session's normal lifecycle (e.g., after a shell command in interactive mode). For a local session, a report whose `cwd` diverges from the session's current working directory is ignored (the call still succeeds but records nothing and emits no event); move a local session's working directory via `metadata.setWorkingDirectory` instead.",
      "title": "MetadataRecordContextChangeResult"
    },
    "MetadataSetWorkingDirectoryRequest": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Absolute path to set as the session's working directory. The runtime updates the session's recorded cwd so subsequent operations (shell tools, file lookups, telemetry) anchor to it."
        }
      },
      "required": [
        "workingDirectory"
      ],
      "additionalProperties": false,
      "description": "Absolute path to set as the session's new working directory. For local sessions the path must be absolute and exist on disk: it is validated before any session state changes, and a failing validation rejects the call with nothing mutated, persisted, or emitted. Remote sessions record the path as-is.",
      "title": "MetadataSetWorkingDirectoryRequest",
      "stability": "experimental"
    },
    "MetadataSetWorkingDirectoryResult": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Working directory after the update"
        }
      },
      "required": [
        "workingDirectory"
      ],
      "additionalProperties": false,
      "description": "Update the session's working directory. Used by the host when the user explicitly changes cwd (e.g., the `/cd` slash command). The host is responsible for any related side-effects (file index, etc.); it does NOT change the process working directory (a session's cwd is per-session, not process-global). For local sessions the runtime validates the target first (an absolute path that exists on disk) and re-bases the permission primary directory; a rejected validation fails the call before anything is mutated, persisted, or emitted. Location-scoped permission rules are then re-keyed to the new directory (best-effort). Remote sessions only record the path.",
      "title": "MetadataSetWorkingDirectoryResult"
    },
    "MetadataSnapshotCurrentMode": {
      "type": "string",
      "enum": [
        "interactive",
        "plan",
        "autopilot"
      ],
      "description": "The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot')",
      "title": "MetadataSnapshotCurrentMode",
      "x-enumDescriptions": {
        "interactive": "The agent is responding interactively to the user.",
        "plan": "The agent is preparing a plan before making changes.",
        "autopilot": "The agent is working autonomously toward task completion."
      }
    },
    "MetadataSnapshotRemoteMetadata": {
      "type": "object",
      "properties": {
        "resourceId": {
          "type": "string",
          "description": "The original resource identifier (task ID or PR node ID), preserved across event-replay reconstructions. Falls back to `sessionId` when absent."
        },
        "repository": {
          "$ref": "#/definitions/MetadataSnapshotRemoteMetadataRepository",
          "description": "The repository the remote session targets."
        },
        "pullRequestNumber": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "The pull request number the remote session is associated with, if any."
        },
        "taskType": {
          "$ref": "#/definitions/MetadataSnapshotRemoteMetadataTaskType",
          "description": "Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation."
        }
      },
      "required": [
        "repository"
      ],
      "additionalProperties": false,
      "description": "Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session.",
      "title": "MetadataSnapshotRemoteMetadata"
    },
    "MetadataSnapshotRemoteMetadataRepository": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "The GitHub owner (user or organization) of the target repository."
        },
        "name": {
          "type": "string",
          "description": "The GitHub repository name (without owner)."
        },
        "branch": {
          "type": "string",
          "description": "The branch the remote session is operating on."
        }
      },
      "required": [
        "owner",
        "name",
        "branch"
      ],
      "additionalProperties": false,
      "description": "The repository the remote session targets.",
      "title": "MetadataSnapshotRemoteMetadataRepository"
    },
    "MetadataSnapshotRemoteMetadataTaskType": {
      "type": "string",
      "enum": [
        "cca",
        "cli"
      ],
      "description": "Whether the remote task originated from Copilot Coding Agent (cca) or a CLI `--remote` invocation.",
      "title": "MetadataSnapshotRemoteMetadataTaskType",
      "x-enumDescriptions": {
        "cca": "Remote task originated from Copilot Coding Agent.",
        "cli": "Remote task originated from a CLI remote-session invocation."
      }
    },
    "Model": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Model identifier (e.g., \"claude-sonnet-4.5\")"
        },
        "name": {
          "type": "string",
          "description": "Display name"
        },
        "capabilities": {
          "$ref": "#/definitions/ModelCapabilities",
          "description": "Model capabilities and limits"
        },
        "policy": {
          "$ref": "#/definitions/ModelPolicy",
          "description": "Policy state (if applicable)"
        },
        "billing": {
          "$ref": "#/definitions/ModelBilling",
          "description": "Billing information"
        },
        "supportedReasoningEfforts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Supported reasoning effort levels (only present if model supports reasoning effort)"
        },
        "defaultReasoningEffort": {
          "type": "string",
          "description": "Default reasoning effort level (only present if model supports reasoning effort)"
        },
        "supportedContextTiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Context-window tiers this model offers, when the provider advertises them independently of tiered token pricing. Copilot models carry their tiers in `billing.tokenPrices`; a provider that has no pricing to publish (an agent host reached over AHP, for example) declares them here instead, so the model picker can still offer the tier toggle."
        },
        "modelPickerCategory": {
          "$ref": "#/definitions/ModelPickerCategory",
          "description": "Model capability category for grouping in the model picker"
        },
        "modelPickerPriceCategory": {
          "$ref": "#/definitions/ModelPickerPriceCategory",
          "description": "Relative cost tier for token-based billing users"
        },
        "warningText": {
          "$ref": "#/definitions/ModelWarningText",
          "description": "Warning text the service requires hosts to surface for this model. Present only when the service published at least one warning."
        },
        "infoMessages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ModelMessage",
            "description": "A service-published message about a model, carrying a stable machine-readable code alongside human-readable text."
          },
          "description": "Informational notices the service published for this model, such as an upcoming change or a recommended alternative. Present only when the service published at least one notice. Hosts should surface these without implying anything is wrong with the model."
        },
        "warningMessages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ModelMessage",
            "description": "A service-published message about a model, carrying a stable machine-readable code alongside human-readable text."
          },
          "description": "Warnings the service published for this model, such as a deprecated client version. Present only when the service published at least one warning. The model remains usable; hosts should surface these as advisory rather than blocking."
        }
      },
      "required": [
        "id",
        "name",
        "capabilities"
      ],
      "additionalProperties": false,
      "description": "Copilot model metadata, including identifier, display name, capabilities, policy, billing, reasoning efforts, and picker categories.",
      "title": "Model"
    },
    "ModelApplyStartupOverlayRequest": {
      "type": "object",
      "properties": {
        "deviceManagedModel": {
          "type": "string",
          "description": "Model required by device-managed policy, when configured."
        },
        "serverManagedModel": {
          "type": "string",
          "description": "Model required by server-managed policy, when configured."
        },
        "policyHelperModel": {
          "type": "string",
          "description": "Startup default model from the enterprise policy helper, when configured. Weakest of the managed sources: it applies only when neither device nor server policy names a model, and an explicit user selection still wins."
        },
        "repoModel": {
          "type": "string",
          "description": "Model selected by repository settings, when configured."
        },
        "repoReasoningEffort": {
          "type": "string",
          "description": "Reasoning effort selected by repository settings, when configured."
        },
        "repoContextTier": {
          "type": "string",
          "description": "Context tier selected by repository settings, when configured."
        },
        "cliModel": {
          "type": "string",
          "description": "Model explicitly selected by the CLI, when provided."
        },
        "deferredResume": {
          "type": "boolean",
          "description": "Whether the overlay is being applied while resuming a deferred session."
        }
      },
      "additionalProperties": false,
      "description": "Managed, repository, and CLI model overrides to overlay onto the session at startup.",
      "title": "ModelApplyStartupOverlayRequest",
      "stability": "experimental"
    },
    "ModelBilling": {
      "type": "object",
      "properties": {
        "multiplier": {
          "type": "number",
          "description": "Billing cost multiplier relative to the base rate"
        },
        "tokenPrices": {
          "$ref": "#/definitions/ModelBillingTokenPrices",
          "description": "Token-level pricing information for this model"
        },
        "discountPercent": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100,
          "description": "Whole-number percentage discount (0-100) applied to usage billed through this model. Populated for the synthetic `auto` model, where requests routed by auto-mode are billed at a reduced rate; absent for concrete models."
        },
        "promo": {
          "$ref": "#/definitions/ModelBillingPromo",
          "description": "Active server-driven promotion for this model, if any. Present when the model is being promoted with a discount, which may be time-boxed or open-ended."
        }
      },
      "additionalProperties": false,
      "description": "Billing information",
      "title": "ModelBilling"
    },
    "ModelBillingPromo": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable identifier for the promotion campaign."
        },
        "discountPercent": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Percentage discount (0-100) applied while the promotion is active. May be fractional."
        },
        "endsAt": {
          "type": "string",
          "description": "UTC ISO 8601 timestamp marking when the promotion ends. Optional: an open-ended promotion omits this field. When present, the API only surfaces a promo whose expiry parses and is in the future, so consumers should treat a past value as expired."
        },
        "message": {
          "type": "string",
          "description": "Human-readable promotion message. Does not include the expiry timestamp; consumers may format endsAt and append it when present."
        },
        "showBanner": {
          "type": "boolean",
          "description": "Whether the service asked hosts to give this promotion a prominent surface, such as a dedicated banner, in addition to listing it with the model. `true` requests that surface and `false` asks for the model list only. Absent means the service expressed no preference — for example a response that predates the field — so hosts should apply their own default rather than read it as `false`."
        }
      },
      "additionalProperties": false,
      "description": "Active server-driven promotion for a model, including its discount and optional expiry.",
      "title": "ModelBillingPromo"
    },
    "ModelBillingTokenPrices": {
      "type": "object",
      "properties": {
        "inputPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of input tokens"
        },
        "outputPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of output tokens"
        },
        "cachePrice": {
          "type": "number",
          "minimum": 0,
          "description": "Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens",
          "deprecated": true
        },
        "cacheReadPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of cached (read) tokens"
        },
        "cacheWritePrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of cache-write (cache creation) tokens."
        },
        "cacheWrite1hPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens."
        },
        "batchSize": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Number of tokens per standard billing batch"
        },
        "contextMax": {
          "type": "integer",
          "description": "Use maxPromptTokens instead. Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens.",
          "deprecated": true
        },
        "maxPromptTokens": {
          "type": "integer",
          "description": "Prompt token budget for the default tier. The total context window is this value plus the model's max_output_tokens."
        },
        "longContext": {
          "$ref": "#/definitions/ModelBillingTokenPricesLongContext",
          "description": "Long context tier pricing (available for models with extended context windows)"
        }
      },
      "additionalProperties": false,
      "description": "Token-level pricing information for this model",
      "title": "ModelBillingTokenPrices"
    },
    "ModelBillingTokenPricesLongContext": {
      "type": "object",
      "properties": {
        "inputPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of input tokens"
        },
        "outputPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of output tokens"
        },
        "cachePrice": {
          "type": "number",
          "minimum": 0,
          "description": "Use cacheReadPrice instead. AI Credits cost per billing batch of cached tokens",
          "deprecated": true
        },
        "cacheReadPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of cached (read) tokens"
        },
        "cacheWritePrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of cache-write (cache creation) tokens."
        },
        "cacheWrite1hPrice": {
          "type": "number",
          "minimum": 0,
          "description": "AI Credits cost per billing batch of 1-hour cache-write (cache creation) tokens."
        },
        "contextMax": {
          "type": "integer",
          "description": "Use maxPromptTokens instead. Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens.",
          "deprecated": true
        },
        "maxPromptTokens": {
          "type": "integer",
          "description": "Prompt token budget for the long context tier. The total context window is this value plus the model's max_output_tokens."
        }
      },
      "additionalProperties": false,
      "description": "Long context tier pricing (available for models with extended context windows)",
      "title": "ModelBillingTokenPricesLongContext"
    },
    "ModelCapabilities": {
      "type": "object",
      "properties": {
        "supports": {
          "$ref": "#/definitions/ModelCapabilitiesSupports",
          "description": "Feature flags indicating what the model supports"
        },
        "limits": {
          "$ref": "#/definitions/ModelCapabilitiesLimits",
          "description": "Token limits for prompts, outputs, and context window"
        }
      },
      "additionalProperties": false,
      "description": "Model capabilities and limits",
      "title": "ModelCapabilities"
    },
    "ModelCapabilitiesLimits": {
      "type": "object",
      "properties": {
        "max_prompt_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of prompt/input tokens"
        },
        "max_output_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of output/completion tokens"
        },
        "max_context_window_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum total context window size in tokens"
        },
        "vision": {
          "$ref": "#/definitions/ModelCapabilitiesLimitsVision",
          "description": "Vision-specific limits"
        }
      },
      "additionalProperties": false,
      "description": "Token limits for prompts, outputs, and context window",
      "title": "ModelCapabilitiesLimits"
    },
    "ModelCapabilitiesLimitsVision": {
      "type": "object",
      "properties": {
        "supported_media_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "MIME types the model accepts"
        },
        "max_prompt_images": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum number of images per prompt"
        },
        "max_prompt_image_size": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum image size in bytes"
        }
      },
      "required": [
        "supported_media_types",
        "max_prompt_images",
        "max_prompt_image_size"
      ],
      "additionalProperties": false,
      "description": "Vision-specific limits",
      "title": "ModelCapabilitiesLimitsVision"
    },
    "ModelCapabilitiesOverride": {
      "type": "object",
      "properties": {
        "supports": {
          "$ref": "#/definitions/ModelCapabilitiesOverrideSupports",
          "description": "Feature flags indicating what the model supports"
        },
        "limits": {
          "$ref": "#/definitions/ModelCapabilitiesOverrideLimits",
          "description": "Token limits for prompts, outputs, and context window"
        }
      },
      "additionalProperties": false,
      "description": "Optional capability overrides (vision, tool_calls, reasoning, etc.).",
      "title": "ModelCapabilitiesOverride"
    },
    "ModelCapabilitiesOverrideLimits": {
      "type": "object",
      "properties": {
        "max_prompt_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of prompt/input tokens"
        },
        "max_output_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of output/completion tokens"
        },
        "max_context_window_tokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum total context window size in tokens"
        },
        "vision": {
          "$ref": "#/definitions/ModelCapabilitiesOverrideLimitsVision",
          "description": "Vision-specific limits"
        }
      },
      "additionalProperties": false,
      "description": "Token limits for prompts, outputs, and context window",
      "title": "ModelCapabilitiesOverrideLimits"
    },
    "ModelCapabilitiesOverrideLimitsVision": {
      "type": "object",
      "properties": {
        "supported_media_types": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "MIME types the model accepts"
        },
        "max_prompt_images": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum number of images per prompt"
        },
        "max_prompt_image_size": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum image size in bytes"
        }
      },
      "additionalProperties": false,
      "description": "Vision-specific limits",
      "title": "ModelCapabilitiesOverrideLimitsVision"
    },
    "ModelCapabilitiesOverrideSupports": {
      "type": "object",
      "properties": {
        "vision": {
          "type": "boolean",
          "description": "Whether this model supports vision/image input"
        },
        "reasoningEffort": {
          "type": "boolean",
          "description": "Whether this model supports reasoning effort configuration"
        },
        "adaptive_thinking": {
          "$ref": "#/definitions/AdaptiveThinkingSupport",
          "description": "Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8)."
        }
      },
      "additionalProperties": false,
      "description": "Feature flags indicating what the model supports",
      "title": "ModelCapabilitiesOverrideSupports"
    },
    "ModelCapabilitiesSupports": {
      "type": "object",
      "properties": {
        "vision": {
          "type": "boolean",
          "description": "Whether this model supports vision/image input"
        },
        "reasoningEffort": {
          "type": "boolean",
          "description": "Whether this model supports reasoning effort configuration"
        },
        "adaptive_thinking": {
          "$ref": "#/definitions/AdaptiveThinkingSupport",
          "description": "Resolved Anthropic adaptive-thinking capability — unsupported / optional / required. 'required' models reject thinking.type='enabled' with HTTP 400 (e.g. opus-4.7/4.8)."
        }
      },
      "additionalProperties": false,
      "description": "Feature flags indicating what the model supports",
      "title": "ModelCapabilitiesSupports"
    },
    "ModelChangeSource": {
      "type": "string",
      "enum": [
        "model_command",
        "settings_command",
        "config_command",
        "model_picker",
        "managed_settings",
        "repo_settings",
        "startup",
        "agent",
        "plan_mode",
        "automatic",
        "sdk"
      ],
      "description": "Origin of an effective session model change.",
      "title": "ModelChangeSource",
      "x-enumDescriptions": {
        "model_command": "The user selected a model directly with `/model <id>`.",
        "settings_command": "The user selected the model with `/settings`.",
        "config_command": "The user selected the model with the `/config` alias.",
        "model_picker": "The user selected the model in the model picker, including the picker opened by bare `/model`.",
        "managed_settings": "Organization-managed settings selected the model.",
        "repo_settings": "Repository settings selected the model.",
        "startup": "Startup model resolution selected the model.",
        "agent": "Selecting an agent selected its configured model.",
        "plan_mode": "Entering, leaving, or reconfiguring plan mode selected the model.",
        "automatic": "The runtime selected the model automatically, such as rate-limit recovery or refusal fallback.",
        "sdk": "An SDK or RPC caller selected the model."
      }
    },
    "ModelList": {
      "type": "object",
      "properties": {
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Model",
            "description": "Copilot model metadata, including identifier, display name, capabilities, policy, billing, reasoning efforts, and picker categories."
          },
          "description": "List of available models with full metadata"
        }
      },
      "required": [
        "models"
      ],
      "additionalProperties": false,
      "description": "List of Copilot models available to the resolved user, including capabilities and billing metadata.",
      "title": "ModelList"
    },
    "ModelListRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "skipCache": {
              "type": "boolean",
              "description": "If true, bypasses the per-session model list cache and re-fetches from CAPI."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional listing options.",
      "title": "ModelListRequest",
      "stability": "experimental"
    },
    "ModelMessage": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "description": "Stable machine-readable identifier for the message, such as `client_version_deprecated`. Hosts can key custom presentation off this; unrecognized codes should fall back to displaying `message`."
        },
        "message": {
          "type": "string",
          "description": "Human-readable message text intended for display to the user."
        }
      },
      "required": [
        "code",
        "message"
      ],
      "additionalProperties": false,
      "description": "A service-published message about a model, carrying a stable machine-readable code alongside human-readable text.",
      "title": "ModelMessage"
    },
    "ModelPickerCategory": {
      "type": "string",
      "enum": [
        "lightweight",
        "versatile",
        "powerful"
      ],
      "description": "Model capability category for grouping in the model picker",
      "title": "ModelPickerCategory",
      "x-enumDescriptions": {
        "lightweight": "Lightweight model category optimized for faster, lower-cost interactions.",
        "versatile": "Versatile model category suitable for a broad range of tasks.",
        "powerful": "Powerful model category optimized for complex tasks."
      }
    },
    "ModelPickerPersistenceRequest": {
      "type": "object",
      "properties": {
        "settingsContext": {
          "$ref": "#/definitions/ModelPickerSettingsContext",
          "description": "Filesystem and environment context used to resolve settings persistence."
        },
        "reasoningEffortExplicit": {
          "type": "boolean",
          "description": "Whether reasoning effort was explicitly selected and should be persisted."
        },
        "contextTierExplicit": {
          "type": "boolean",
          "description": "Whether context tier was explicitly selected and should be persisted."
        }
      },
      "required": [
        "settingsContext"
      ],
      "additionalProperties": false
    },
    "ModelPickerPriceCategory": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high",
        "very_high"
      ],
      "description": "Relative cost tier for token-based billing users",
      "title": "ModelPickerPriceCategory",
      "x-enumDescriptions": {
        "low": "Lowest relative token cost tier.",
        "medium": "Medium relative token cost tier.",
        "high": "High relative token cost tier.",
        "very_high": "Highest relative token cost tier."
      }
    },
    "ModelPickerSettingsContext": {
      "type": "object",
      "properties": {
        "configDir": {
          "type": "string",
          "description": "Optional Copilot configuration directory containing persisted settings."
        },
        "homeDirectory": {
          "type": "string",
          "description": "User home directory used when resolving persisted settings."
        },
        "environment": {
          "type": "object",
          "properties": {},
          "description": "Environment variables consulted while resolving model-picker settings."
        }
      },
      "required": [
        "homeDirectory",
        "environment"
      ],
      "additionalProperties": false,
      "description": "Filesystem and environment context used to resolve model-picker settings.",
      "title": "ModelPickerSettingsContext"
    },
    "ModelPolicy": {
      "type": "object",
      "properties": {
        "state": {
          "$ref": "#/definitions/ModelPolicyState",
          "description": "Current policy state for this model"
        },
        "terms": {
          "type": "string",
          "description": "Usage terms or conditions for this model"
        }
      },
      "required": [
        "state"
      ],
      "additionalProperties": false,
      "description": "Policy state (if applicable)",
      "title": "ModelPolicy"
    },
    "ModelPolicyState": {
      "type": "string",
      "enum": [
        "enabled",
        "disabled",
        "unconfigured"
      ],
      "description": "Current policy state for this model",
      "title": "ModelPolicyState",
      "x-enumDescriptions": {
        "enabled": "The model is enabled by policy.",
        "disabled": "The model is disabled by policy.",
        "unconfigured": "No explicit policy is configured for the model."
      }
    },
    "ModelSetReasoningEffortRequest": {
      "type": "object",
      "properties": {
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level to apply to the currently selected model. The host is responsible for validating the value against the model's supported levels before calling."
        }
      },
      "required": [
        "reasoningEffort"
      ],
      "additionalProperties": false,
      "description": "Reasoning effort level to apply to the currently selected model.",
      "title": "ModelSetReasoningEffortRequest",
      "stability": "experimental"
    },
    "ModelSetReasoningEffortResult": {
      "type": "object",
      "properties": {
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level recorded on the session after the update"
        }
      },
      "required": [
        "reasoningEffort"
      ],
      "additionalProperties": false,
      "description": "Update the session's reasoning effort without changing the selected model. Use `switchTo` instead when you also need to change the model. The runtime stores the effort on the session and applies it to subsequent turns.",
      "title": "ModelSetReasoningEffortResult"
    },
    "ModelsListRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "selectionId": {
              "type": "string",
              "description": "Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used."
            },
            "gitHubToken": {
              "type": "string",
              "description": "GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional opaque account selection or compatibility GitHub token used to list models.",
      "title": "ModelsListRequest"
    },
    "ModelSwitchConfirmation": {
      "type": "object",
      "properties": {
        "targetModelDisplayName": {
          "type": "string",
          "description": "Display name of the model that requires compaction confirmation."
        },
        "currentTokens": {
          "type": "number",
          "description": "Current conversation token count before switching models."
        },
        "targetLimit": {
          "type": "number",
          "description": "Target model token limit used by the compaction preflight."
        }
      },
      "required": [
        "targetModelDisplayName",
        "currentTokens",
        "targetLimit"
      ],
      "additionalProperties": false
    },
    "ModelSwitchToRequest": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "Model selection id to switch to, as returned by `list`. A bare id (e.g. `claude-sonnet-4.6`) names a Copilot (CAPI) model; a provider-qualified id (`provider/id`, e.g. `acme/claude-sonnet`) targets a registry BYOK model."
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort level to use for the model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. \"none\" disables reasoning. When omitted, no effort override is applied."
        },
        "reasoningSummary": {
          "$ref": "#/definitions/ReasoningSummary",
          "description": "Reasoning summary mode to request for supported model clients"
        },
        "verbosity": {
          "$ref": "#/definitions/Verbosity",
          "description": "Output verbosity level to request for supported models"
        },
        "modelCapabilities": {
          "$ref": "#/definitions/ModelCapabilitiesOverride",
          "description": "Override individual model capabilities resolved by the runtime"
        },
        "contextTier": {
          "$ref": "#/definitions/ContextTier",
          "description": "Explicit context tier for the selected model. `\"default\"` / `\"long_context\"` apply the requested tier; omit this field to use normal model behavior with no explicit tier."
        },
        "source": {
          "$ref": "#/definitions/ModelChangeSource",
          "description": "Origin to record on the effective `session.model_change` event for trusted in-process calls. Transport SDK calls are always recorded as `sdk`, regardless of this value."
        },
        "deferIfModelChangeQueued": {
          "type": "boolean",
          "description": "When true, defer this switch (enqueue it) if another model change is already queued, even when no turn is active — so it drains last (FIFO) and wins over the already-queued change. Intended for genuine user-initiated model selections; internal restore/reapply switches omit it and apply immediately when no turn is active. When no other model change is queued this has no effect (a switch still applies immediately unless a turn is active)."
        },
        "compactionDecision": {
          "type": "string",
          "description": "Explicit response to a model-switch compaction preflight. Omit to request a confirmation projection when compaction is necessary."
        },
        "runCompactionPreflight": {
          "type": "boolean",
          "description": "When true, evaluate context-window compaction policy before applying the switch."
        },
        "repoScope": {
          "type": "string",
          "description": "Optional repository settings scope to persist after the switch commits."
        },
        "modelChangeScope": {
          "type": "string",
          "description": "Settings scope used when persisting the selected model."
        },
        "requireAvailable": {
          "type": "boolean",
          "description": "Require the target to be currently available and enabled before applying the switch."
        },
        "pickerPersistence": {
          "$ref": "#/definitions/ModelPickerPersistenceRequest",
          "description": "Optional settings context and explicit-override flags used to persist a picker selection."
        }
      },
      "required": [
        "modelId"
      ],
      "additionalProperties": false,
      "description": "Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.",
      "title": "ModelSwitchToRequest",
      "stability": "experimental"
    },
    "ModelSwitchToResult": {
      "type": "object",
      "properties": {
        "modelId": {
          "type": "string",
          "description": "Currently active model identifier after the switch"
        },
        "deferred": {
          "type": "boolean",
          "description": "True when the switch was deferred (enqueued as a cancellable `/model` command) because a turn was active or another model change was already queued, rather than applied immediately. When true, the session's live model is unchanged until the queued change drains."
        },
        "status": {
          "type": "string",
          "description": "Lifecycle result for the requested switch"
        },
        "confirmation": {
          "$ref": "#/definitions/ModelSwitchConfirmation",
          "description": "Compaction confirmation projection when status is confirmation_required"
        },
        "persistenceError": {
          "type": "string",
          "description": "Persistence failure encountered after applying the model switch."
        },
        "message": {
          "type": "string",
          "description": "User-facing outcome message for the model switch."
        },
        "warning": {
          "type": "string",
          "description": "User-facing warning produced while applying the model switch."
        },
        "deprecationWarnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Deprecation warnings associated with the selected model or options."
        }
      },
      "required": [],
      "additionalProperties": false,
      "description": "The model identifier active on the session after the switch.",
      "title": "ModelSwitchToResult"
    },
    "ModelWarningText": {
      "type": "object",
      "properties": {
        "dataRetention": {
          "type": "string",
          "description": "Data-retention warning for the model. The text may contain Markdown links and should be rendered as Markdown when supported."
        }
      },
      "additionalProperties": false,
      "description": "Service-published warning text that hosts should display when presenting a model.",
      "title": "ModelWarningText"
    },
    "ModeSetRequest": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/SessionMode",
          "description": "The session mode the agent is operating in"
        },
        "inheritPlanBaseFromSessionId": {
          "type": "string",
          "description": "Session whose plan-mode base state should be inherited."
        },
        "planModelConfigured": {
          "type": "boolean",
          "description": "Whether a dedicated plan model is configured."
        },
        "planModel": {
          "type": "string",
          "description": "Dedicated model to use in plan mode, when configured."
        },
        "planReasoningEffort": {
          "type": "string",
          "description": "Reasoning effort to use with the dedicated plan model."
        },
        "planContextTier": {
          "type": "string",
          "description": "Context tier to use with the dedicated plan model."
        },
        "compactionDecision": {
          "type": "string",
          "description": "Explicit response to a model-switch compaction preflight."
        },
        "restorePlanModel": {
          "type": "boolean",
          "description": "Whether leaving plan mode should restore the session's previous model."
        },
        "persistPlanSelection": {
          "type": "boolean",
          "description": "Whether the selected plan model should be persisted."
        },
        "pickerSettingsContext": {
          "$ref": "#/definitions/ModelPickerSettingsContext",
          "description": "Settings context used when persisting the selected plan model."
        },
        "planExitAction": {
          "type": "string",
          "description": "Action to perform when leaving plan mode."
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Agent interaction mode to apply to the session.",
      "title": "ModeSetRequest",
      "stability": "experimental"
    },
    "ModeSetResult": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "description": "Lifecycle status of the requested mode change."
        },
        "modelChanged": {
          "type": "boolean",
          "description": "Whether applying the mode changed the active model."
        },
        "confirmation": {
          "$ref": "#/definitions/ModelSwitchConfirmation",
          "description": "Compaction confirmation required before the mode change can complete."
        },
        "warning": {
          "type": "string",
          "description": "User-facing warning produced while applying the mode change."
        },
        "message": {
          "type": "string",
          "description": "User-facing outcome message for the model switch triggered by the mode change."
        },
        "deprecationWarnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Deprecation warnings associated with the model selected by the mode change."
        },
        "deferImplementation": {
          "type": "boolean",
          "description": "Whether the host must defer implementing the requested mode change."
        },
        "armInteractiveContinuation": {
          "type": "boolean",
          "description": "Whether the host should arm an interactive continuation after the mode change."
        }
      },
      "required": [
        "status",
        "modelChanged"
      ],
      "additionalProperties": false,
      "description": "Outcome of a session mode change, including any model switch it triggered and follow-up the host must perform.",
      "title": "ModeSetResult",
      "stability": "experimental"
    },
    "MoveMcpLoadingToBackgroundResult": {
      "type": "object",
      "properties": {
        "movedToBackground": {
          "type": "boolean",
          "description": "Whether an in-flight MCP load was moved to the background, releasing turns that were waiting on it. False when no MCP load was in flight or the waiting turns had already been released."
        }
      },
      "required": [
        "movedToBackground"
      ],
      "additionalProperties": false,
      "description": "Result of moving in-flight MCP loading to the background.",
      "title": "MoveMcpLoadingToBackgroundResult"
    },
    "NamedProviderConfig": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique provider name used to qualify model selection IDs."
        },
        "type": {
          "$ref": "#/definitions/ProviderConfigType",
          "description": "Provider protocol family."
        },
        "wireApi": {
          "$ref": "#/definitions/ProviderConfigWireApi",
          "description": "Wire API used to communicate with the provider."
        },
        "transport": {
          "$ref": "#/definitions/ProviderConfigTransport",
          "description": "Transport used to communicate with the provider."
        },
        "baseUrl": {
          "type": "string",
          "description": "Base URL for provider API requests."
        },
        "apiKey": {
          "type": "string",
          "description": "Static API key used to authenticate provider requests."
        },
        "bearerToken": {
          "type": "string",
          "description": "Static bearer token used to authenticate provider requests."
        },
        "azure": {
          "$ref": "#/definitions/ProviderConfigAzure",
          "description": "Azure authentication configuration for the provider."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Additional HTTP headers included with provider requests."
        },
        "hasBearerTokenProvider": {
          "type": "boolean",
          "description": "Whether the host supplies bearer tokens dynamically."
        }
      },
      "required": [
        "name",
        "baseUrl"
      ],
      "additionalProperties": false,
      "description": "External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch."
    },
    "NameGetResult": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The session name (user-set or auto-generated), or null if not yet set"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "The session's friendly name, or null when not yet set.",
      "title": "NameGetResult"
    },
    "NameSetAutoRequest": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "description": "Auto-generated session summary. Empty/whitespace-only values are ignored; values are trimmed before persisting."
        }
      },
      "required": [
        "summary"
      ],
      "additionalProperties": false,
      "description": "Auto-generated session summary to apply as the session's name when no user-set name exists.",
      "title": "NameSetAutoRequest",
      "stability": "experimental"
    },
    "NameSetAutoResult": {
      "type": "object",
      "properties": {
        "applied": {
          "type": "boolean",
          "description": "Whether the auto-generated summary was persisted. False if the session already has a user-set name, the summary normalized to empty, or the session does not have a workspace."
        }
      },
      "required": [
        "applied"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the auto-generated summary was applied as the session's name.",
      "title": "NameSetAutoResult"
    },
    "NameSetRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100,
          "description": "New session name (1–100 characters, trimmed of leading/trailing whitespace)"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "New friendly name to apply to the session.",
      "title": "NameSetRequest",
      "stability": "experimental"
    },
    "OmittedBinaryOmittedReason": {
      "type": "string",
      "enum": [
        "too_large",
        "asset_unavailable"
      ],
      "description": "Why the binary data is absent: it exceeded the inline size limit, or its asset was unavailable",
      "title": "OmittedBinaryOmittedReason",
      "x-enumDescriptions": {
        "too_large": "Bytes exceeded the session's inline size limit.",
        "asset_unavailable": "The referenced binary asset could not be found (e.g. a truncated log)."
      }
    },
    "OpenCanvasInstance": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "description": "Stable caller-supplied canvas instance identifier"
        },
        "extensionId": {
          "type": "string",
          "description": "Owning provider identifier"
        },
        "extensionName": {
          "type": "string",
          "description": "Owning extension display name, when available"
        },
        "canvasId": {
          "type": "string",
          "description": "Provider-local canvas identifier"
        },
        "icon": {
          "type": "string",
          "description": "Host-local PNG path for the canvas icon, when supplied"
        },
        "title": {
          "type": "string",
          "description": "Rendered title"
        },
        "status": {
          "type": "string",
          "description": "Provider-supplied status text"
        },
        "url": {
          "type": "string",
          "description": "URL for web-rendered canvases"
        },
        "input": {
          "description": "Input supplied when the instance was opened",
          "x-opaque-json": true
        }
      },
      "required": [
        "instanceId",
        "extensionId",
        "canvasId"
      ],
      "additionalProperties": false,
      "description": "Open canvas instance snapshot.",
      "title": "OpenCanvasInstance",
      "stability": "experimental"
    },
    "OptionsUpdateAdditionalContentExclusionPolicy": {
      "type": "object",
      "properties": {
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OptionsUpdateAdditionalContentExclusionPolicyRule",
            "description": "Single content-exclusion rule supplied to `session.options.update`, with paths, match conditions, and source."
          },
          "description": "Content-exclusion rules to apply."
        },
        "last_updated_at": {
          "description": "Opaque policy update timestamp supplied by the host.",
          "x-opaque-json": true
        },
        "scope": {
          "$ref": "#/definitions/OptionsUpdateAdditionalContentExclusionPolicyScope",
          "description": "Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration."
        }
      },
      "required": [
        "rules",
        "last_updated_at",
        "scope"
      ],
      "description": "Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope.",
      "title": "OptionsUpdateAdditionalContentExclusionPolicy"
    },
    "OptionsUpdateAdditionalContentExclusionPolicyRule": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Path patterns covered by this rule."
        },
        "ifAnyMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions of which at least one must match."
        },
        "ifNoneMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions none of which may match."
        },
        "source": {
          "$ref": "#/definitions/OptionsUpdateAdditionalContentExclusionPolicyRuleSource",
          "description": "Source descriptor for a `session.options.update` content-exclusion rule, with source name and type."
        }
      },
      "required": [
        "paths",
        "source"
      ],
      "description": "Single content-exclusion rule supplied to `session.options.update`, with paths, match conditions, and source.",
      "title": "OptionsUpdateAdditionalContentExclusionPolicyRule"
    },
    "OptionsUpdateAdditionalContentExclusionPolicyRuleSource": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the policy source."
        },
        "type": {
          "type": "string",
          "description": "Type of the policy source."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a `session.options.update` content-exclusion rule, with source name and type.",
      "title": "OptionsUpdateAdditionalContentExclusionPolicyRuleSource"
    },
    "OptionsUpdateAdditionalContentExclusionPolicyScope": {
      "type": "string",
      "enum": [
        "repo",
        "all"
      ],
      "description": "Allowed values for the `OptionsUpdateAdditionalContentExclusionPolicyScope` enumeration.",
      "title": "OptionsUpdateAdditionalContentExclusionPolicyScope",
      "x-enumDescriptions": {
        "repo": "The content exclusion policy applies to the current repository.",
        "all": "The content exclusion policy applies across all repositories."
      }
    },
    "OptionsUpdateContextTier": {
      "type": "string",
      "enum": [
        "default",
        "long_context"
      ],
      "description": "Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier.",
      "title": "OptionsUpdateContextTier",
      "x-enumDescriptions": {
        "default": "Use the model's default context tier and its standard token limits / pricing.",
        "long_context": "Use the model's long-context tier (when available) so larger inputs are accepted and tier-specific pricing applies."
      }
    },
    "OptionsUpdateEnvValueMode": {
      "type": "string",
      "enum": [
        "direct",
        "indirect"
      ],
      "description": "How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).",
      "title": "OptionsUpdateEnvValueMode",
      "x-enumDescriptions": {
        "direct": "Pass MCP server environment values as literal strings.",
        "indirect": "Resolve MCP server environment values from host-side references."
      }
    },
    "OptionsUpdateReasoningSummary": {
      "type": "string",
      "enum": [
        "none",
        "concise",
        "detailed"
      ],
      "description": "Reasoning summary mode for supported model clients.",
      "title": "OptionsUpdateReasoningSummary",
      "x-enumDescriptions": {
        "none": "Do not request reasoning summaries from the model.",
        "concise": "Request a concise summary of model reasoning.",
        "detailed": "Request a detailed summary of model reasoning."
      }
    },
    "OptionsUpdateToolFilterPrecedence": {
      "type": "string",
      "enum": [
        "available",
        "excluded"
      ],
      "description": "Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set.",
      "title": "OptionsUpdateToolFilterPrecedence",
      "x-enumDescriptions": {
        "available": "If availableTools is set, it is the only constraint that applies (excludedTools is ignored). Preserves CLI / pre-existing client behavior. Default.",
        "excluded": "A tool is enabled if and only if it matches the allowlist (or the allowlist is unset) AND it does not match the denylist. Makes 'all except X' expressible by combining the two lists."
      }
    },
    "PendingPermissionRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Unique identifier for the pending permission request"
        },
        "request": {
          "$ref": "session-events.schema.json#/definitions/PermissionPromptRequest",
          "description": "The user-facing permission prompt details (commands, write, read, mcp, url, memory, custom-tool, path, hook)"
        }
      },
      "required": [
        "requestId",
        "request"
      ],
      "additionalProperties": false,
      "description": "Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details.",
      "title": "PendingPermissionRequest"
    },
    "PendingPermissionRequestList": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PendingPermissionRequest",
            "description": "Pending permission prompt reconstructed from event history, with request ID and user-facing prompt details."
          },
          "description": "Pending permission prompts reconstructed from the session's event history. Equivalent to the set of `permission.requested` events that have not yet been followed by a matching `permission.completed` event. Used by clients (e.g. the CLI) to hydrate UI for prompts that were emitted before the client attached to the session."
        }
      },
      "required": [
        "items"
      ],
      "additionalProperties": false,
      "description": "List of pending permission requests reconstructed from event history.",
      "title": "PendingPermissionRequestList"
    },
    "PermissionDecision": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionDecisionApproveOnce",
          "description": "Permission-decision request variant to approve only the current permission request."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSession",
          "description": "Permission-decision request variant to approve for the rest of the session, with optional tool approval or URL domain."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocation",
          "description": "Permission-decision request variant to approve and persist a permission for a project location, with approval details and location key."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApprovePermanently",
          "description": "Permission-decision request variant to permanently approve a URL domain across sessions."
        },
        {
          "$ref": "#/definitions/PermissionDecisionReject",
          "description": "Permission-decision request variant to reject a pending permission request, with optional feedback."
        },
        {
          "$ref": "#/definitions/PermissionDecisionUserNotAvailable",
          "description": "Permission-decision variant indicating no user was available to confirm the request."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproved",
          "description": "Permission-decision variant indicating the request was approved."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApprovedForSession",
          "description": "Permission-decision variant indicating approval was remembered for the session, with approval details."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApprovedForLocation",
          "description": "Permission-decision variant indicating approval was persisted for a project location, with approval details and location key."
        },
        {
          "$ref": "#/definitions/PermissionDecisionCancelled",
          "description": "Permission-decision variant indicating the request was cancelled before use, with an optional reason."
        },
        {
          "$ref": "#/definitions/PermissionDecisionDeniedByRules",
          "description": "Permission-decision variant indicating explicit denial by permission rules, with the matching rules."
        },
        {
          "$ref": "#/definitions/PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser",
          "description": "Permission-decision variant indicating no approval rule matched and user confirmation was unavailable."
        },
        {
          "$ref": "#/definitions/PermissionDecisionDeniedInteractivelyByUser",
          "description": "Permission-decision variant indicating the user denied an interactive prompt, with optional feedback and force-reject flag."
        },
        {
          "$ref": "#/definitions/PermissionDecisionDeniedByContentExclusionPolicy",
          "description": "Permission-decision variant indicating denial by content-exclusion policy, with path and message."
        },
        {
          "$ref": "#/definitions/PermissionDecisionDeniedByPermissionRequestHook",
          "description": "Permission-decision variant indicating denial by a permission request hook, with optional message and interrupt flag."
        }
      ],
      "description": "The client's response to the pending permission prompt",
      "title": "PermissionDecision"
    },
    "PermissionDecisionApproved": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved",
          "description": "The permission request was approved"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating the request was approved.",
      "title": "PermissionDecisionApproved"
    },
    "PermissionDecisionApprovedForLocation": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved-for-location",
          "description": "Approved and persisted for this project location"
        },
        "approval": {
          "$ref": "#/definitions/UserToolSessionApproval",
          "description": "The approval to persist for this location"
        },
        "locationKey": {
          "type": "string",
          "description": "The location key (git root or cwd) to persist the approval to"
        }
      },
      "required": [
        "kind",
        "approval",
        "locationKey"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating approval was persisted for a project location, with approval details and location key.",
      "title": "PermissionDecisionApprovedForLocation"
    },
    "PermissionDecisionApprovedForSession": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approved-for-session",
          "description": "Approved and remembered for the rest of the session"
        },
        "approval": {
          "$ref": "#/definitions/UserToolSessionApproval",
          "description": "The approval to add as a session-scoped rule"
        }
      },
      "required": [
        "kind",
        "approval"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating approval was remembered for the session, with approval details.",
      "title": "PermissionDecisionApprovedForSession"
    },
    "PermissionDecisionApproveForLocation": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approve-for-location",
          "description": "Approve and persist for this project location"
        },
        "approval": {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApproval",
          "description": "Approval to persist for this location"
        },
        "locationKey": {
          "type": "string",
          "description": "Location key (git root or cwd) to persist the approval to"
        }
      },
      "required": [
        "kind",
        "approval",
        "locationKey"
      ],
      "additionalProperties": false,
      "description": "Permission-decision request variant to approve and persist a permission for a project location, with approval details and location key.",
      "title": "PermissionDecisionApproveForLocation"
    },
    "PermissionDecisionApproveForLocationApproval": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalCommands",
          "description": "Location-scoped approval details for specific command identifiers."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalRead",
          "description": "Location-scoped approval details for read-only filesystem operations."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalWrite",
          "description": "Location-scoped approval details for filesystem write operations."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalMcp",
          "description": "Location-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalMcpSampling",
          "description": "Location-scoped approval details for MCP sampling requests from a server."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalMemory",
          "description": "Location-scoped approval details for writes to long-term memory."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalCustomTool",
          "description": "Location-scoped approval details for a custom tool, keyed by tool name."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalExtensionManagement",
          "description": "Location-scoped approval details for extension-management operations, optionally narrowed by operation."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalFactory",
          "description": "Location-scoped factory approval, optionally narrowed by approval key."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess",
          "description": "Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForLocationApprovalExtensionEnvAccess",
          "description": "Location-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names."
        }
      ],
      "description": "Approval to persist for this location",
      "title": "PermissionDecisionApproveForLocationApproval"
    },
    "PermissionDecisionApproveForLocationApprovalCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Approval scoped to specific command identifiers."
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers covered by this approval."
        }
      },
      "required": [
        "kind",
        "commandIdentifiers"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for specific command identifiers.",
      "title": "PermissionDecisionApproveForLocationApprovalCommands"
    },
    "PermissionDecisionApproveForLocationApprovalCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Approval covering a custom tool."
        },
        "toolName": {
          "type": "string",
          "description": "Custom tool name."
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for a custom tool, keyed by tool name.",
      "title": "PermissionDecisionApproveForLocationApprovalCustomTool"
    },
    "PermissionDecisionApproveForLocationApprovalExtensionEnvAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-env-access",
          "description": "Approval covering an extension's request to read sensitive environment variables."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        },
        "environmentVariables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Names of the sensitive environment variables this approval covers. Values are never persisted."
        }
      },
      "required": [
        "kind",
        "extensionName",
        "environmentVariables"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.",
      "title": "PermissionDecisionApproveForLocationApprovalExtensionEnvAccess"
    },
    "PermissionDecisionApproveForLocationApprovalExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Approval covering extension lifecycle operations such as enable, disable, or reload."
        },
        "operation": {
          "type": "string",
          "description": "Optional operation identifier; when omitted, the approval covers all extension management operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for extension-management operations, optionally narrowed by operation.",
      "title": "PermissionDecisionApproveForLocationApprovalExtensionManagement"
    },
    "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Approval covering an extension's request to access a permission-gated capability."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        }
      },
      "required": [
        "kind",
        "extensionName"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for an extension's permission-gated capability access, keyed by extension name.",
      "title": "PermissionDecisionApproveForLocationApprovalExtensionPermissionAccess"
    },
    "PermissionDecisionApproveForLocationApprovalFactory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "factory",
          "description": "Approval covering factory operations."
        },
        "approvalKey": {
          "type": "string",
          "description": "Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-scoped factory approval, optionally narrowed by approval key.",
      "title": "PermissionDecisionApproveForLocationApprovalFactory"
    },
    "PermissionDecisionApproveForLocationApprovalMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "Approval covering an MCP tool."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "description": "MCP tool name, or null to cover every tool on the server."
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.",
      "title": "PermissionDecisionApproveForLocationApprovalMcp"
    },
    "PermissionDecisionApproveForLocationApprovalMcpSampling": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp-sampling",
          "description": "Approval covering MCP sampling requests for a server."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        }
      },
      "required": [
        "kind",
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for MCP sampling requests from a server.",
      "title": "PermissionDecisionApproveForLocationApprovalMcpSampling"
    },
    "PermissionDecisionApproveForLocationApprovalMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Approval covering writes to long-term memory."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for writes to long-term memory.",
      "title": "PermissionDecisionApproveForLocationApprovalMemory"
    },
    "PermissionDecisionApproveForLocationApprovalRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Approval covering read-only filesystem operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for read-only filesystem operations.",
      "title": "PermissionDecisionApproveForLocationApprovalRead"
    },
    "PermissionDecisionApproveForLocationApprovalWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Approval covering filesystem write operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-scoped approval details for filesystem write operations.",
      "title": "PermissionDecisionApproveForLocationApprovalWrite"
    },
    "PermissionDecisionApproveForSession": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approve-for-session",
          "description": "Approve and remember for the rest of the session"
        },
        "approval": {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApproval",
          "description": "Session-scoped approval to remember (tool prompts only; omitted for path/url prompts)"
        },
        "domain": {
          "type": "string",
          "description": "URL domain to approve for the rest of the session (URL prompts only)"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision request variant to approve for the rest of the session, with optional tool approval or URL domain.",
      "title": "PermissionDecisionApproveForSession"
    },
    "PermissionDecisionApproveForSessionApproval": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalCommands",
          "description": "Session-scoped approval details for specific command identifiers."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalRead",
          "description": "Session-scoped approval details for read-only filesystem operations."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalWrite",
          "description": "Session-scoped approval details for filesystem write operations."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalMcp",
          "description": "Session-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalMcpSampling",
          "description": "Session-scoped approval details for MCP sampling requests from a server."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalMemory",
          "description": "Session-scoped approval details for writes to long-term memory."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalCustomTool",
          "description": "Session-scoped approval details for a custom tool, keyed by tool name."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalExtensionManagement",
          "description": "Session-scoped approval details for extension-management operations, optionally narrowed by operation."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalFactory",
          "description": "Session-scoped factory approval, optionally narrowed by approval key."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess",
          "description": "Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name."
        },
        {
          "$ref": "#/definitions/PermissionDecisionApproveForSessionApprovalExtensionEnvAccess",
          "description": "Session-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names."
        }
      ],
      "description": "Session-scoped approval to remember (tool prompts only; omitted for path/url prompts)",
      "title": "PermissionDecisionApproveForSessionApproval"
    },
    "PermissionDecisionApproveForSessionApprovalCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Approval scoped to specific command identifiers."
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers covered by this approval."
        }
      },
      "required": [
        "kind",
        "commandIdentifiers"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for specific command identifiers.",
      "title": "PermissionDecisionApproveForSessionApprovalCommands"
    },
    "PermissionDecisionApproveForSessionApprovalCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Approval covering a custom tool."
        },
        "toolName": {
          "type": "string",
          "description": "Custom tool name."
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for a custom tool, keyed by tool name.",
      "title": "PermissionDecisionApproveForSessionApprovalCustomTool"
    },
    "PermissionDecisionApproveForSessionApprovalExtensionEnvAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-env-access",
          "description": "Approval covering an extension's request to read sensitive environment variables."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        },
        "environmentVariables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Names of the sensitive environment variables this approval covers. Values are never persisted."
        }
      },
      "required": [
        "kind",
        "extensionName",
        "environmentVariables"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.",
      "title": "PermissionDecisionApproveForSessionApprovalExtensionEnvAccess"
    },
    "PermissionDecisionApproveForSessionApprovalExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Approval covering extension lifecycle operations such as enable, disable, or reload."
        },
        "operation": {
          "type": "string",
          "description": "Optional operation identifier; when omitted, the approval covers all extension management operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for extension-management operations, optionally narrowed by operation.",
      "title": "PermissionDecisionApproveForSessionApprovalExtensionManagement"
    },
    "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Approval covering an extension's request to access a permission-gated capability."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        }
      },
      "required": [
        "kind",
        "extensionName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for an extension's permission-gated capability access, keyed by extension name.",
      "title": "PermissionDecisionApproveForSessionApprovalExtensionPermissionAccess"
    },
    "PermissionDecisionApproveForSessionApprovalFactory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "factory",
          "description": "Approval covering factory operations."
        },
        "approvalKey": {
          "type": "string",
          "description": "Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped factory approval, optionally narrowed by approval key.",
      "title": "PermissionDecisionApproveForSessionApprovalFactory"
    },
    "PermissionDecisionApproveForSessionApprovalMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "Approval covering an MCP tool."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "description": "MCP tool name, or null to cover every tool on the server."
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for an MCP server tool, or all tools on the server when `toolName` is null.",
      "title": "PermissionDecisionApproveForSessionApprovalMcp"
    },
    "PermissionDecisionApproveForSessionApprovalMcpSampling": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp-sampling",
          "description": "Approval covering MCP sampling requests for a server."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        }
      },
      "required": [
        "kind",
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for MCP sampling requests from a server.",
      "title": "PermissionDecisionApproveForSessionApprovalMcpSampling"
    },
    "PermissionDecisionApproveForSessionApprovalMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Approval covering writes to long-term memory."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for writes to long-term memory.",
      "title": "PermissionDecisionApproveForSessionApprovalMemory"
    },
    "PermissionDecisionApproveForSessionApprovalRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Approval covering read-only filesystem operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for read-only filesystem operations.",
      "title": "PermissionDecisionApproveForSessionApprovalRead"
    },
    "PermissionDecisionApproveForSessionApprovalWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Approval covering filesystem write operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped approval details for filesystem write operations.",
      "title": "PermissionDecisionApproveForSessionApprovalWrite"
    },
    "PermissionDecisionApproveOnce": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approve-once",
          "description": "Approve this single request only"
        },
        "approvedInteractively": {
          "type": "boolean",
          "description": "True only when a host surfaced this request to a user who approved it."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision request variant to approve only the current permission request.",
      "title": "PermissionDecisionApproveOnce"
    },
    "PermissionDecisionApprovePermanently": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "approve-permanently",
          "description": "Approve and persist across sessions (URL prompts only)"
        },
        "domain": {
          "type": "string",
          "description": "URL domain to approve permanently"
        }
      },
      "required": [
        "kind",
        "domain"
      ],
      "additionalProperties": false,
      "description": "Permission-decision request variant to permanently approve a URL domain across sessions.",
      "title": "PermissionDecisionApprovePermanently"
    },
    "PermissionDecisionCancelled": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "cancelled",
          "description": "The permission request was cancelled before a response was used"
        },
        "reason": {
          "type": "string",
          "description": "Optional explanation of why the request was cancelled"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating the request was cancelled before use, with an optional reason.",
      "title": "PermissionDecisionCancelled"
    },
    "PermissionDecisionContext": {
      "type": "object",
      "properties": {
        "outcome": {
          "$ref": "#/definitions/PermissionDecisionOutcome",
          "description": "Disposition of the permission request as observed by the responding client."
        },
        "source": {
          "$ref": "#/definitions/PermissionDecisionSource",
          "description": "Controlled reason or actor responsible for the response."
        },
        "surface": {
          "$ref": "#/definitions/PermissionDecisionSurface",
          "description": "Client surface that submitted the response."
        },
        "responseCapability": {
          "$ref": "#/definitions/PermissionResponseCapability",
          "description": "Whether the responding client could ask a user interactively, was running headlessly, or had no response path. Omit when the client cannot determine this authoritatively."
        }
      },
      "required": [
        "outcome",
        "source",
        "surface"
      ],
      "additionalProperties": false,
      "description": "Optional informational context describing how and where the permission decision was made. This does not affect permission behavior.",
      "title": "PermissionDecisionContext"
    },
    "PermissionDecisionDeniedByContentExclusionPolicy": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-content-exclusion-policy",
          "description": "Denied by the organization's content exclusion policy"
        },
        "path": {
          "type": "string",
          "description": "File path that triggered the exclusion"
        },
        "message": {
          "type": "string",
          "description": "Human-readable explanation of why the path was excluded"
        }
      },
      "required": [
        "kind",
        "path",
        "message"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating denial by content-exclusion policy, with path and message.",
      "title": "PermissionDecisionDeniedByContentExclusionPolicy"
    },
    "PermissionDecisionDeniedByPermissionRequestHook": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-permission-request-hook",
          "description": "Denied by a permission request hook registered by an extension or plugin"
        },
        "message": {
          "type": "string",
          "description": "Optional message from the hook explaining the denial"
        },
        "interrupt": {
          "type": "boolean",
          "description": "Whether to interrupt the current agent turn"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating denial by a permission request hook, with optional message and interrupt flag.",
      "title": "PermissionDecisionDeniedByPermissionRequestHook"
    },
    "PermissionDecisionDeniedByRules": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-by-rules",
          "description": "Denied because approval rules explicitly blocked it"
        },
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Rules that denied the request"
        }
      },
      "required": [
        "kind",
        "rules"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating explicit denial by permission rules, with the matching rules.",
      "title": "PermissionDecisionDeniedByRules"
    },
    "PermissionDecisionDeniedInteractivelyByUser": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-interactively-by-user",
          "description": "Denied by the user during an interactive prompt"
        },
        "feedback": {
          "type": "string",
          "description": "Optional feedback from the user explaining the denial"
        },
        "forceReject": {
          "type": "boolean",
          "description": "Whether to force-reject the current agent turn"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating the user denied an interactive prompt, with optional feedback and force-reject flag.",
      "title": "PermissionDecisionDeniedInteractivelyByUser"
    },
    "PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "denied-no-approval-rule-and-could-not-request-from-user",
          "description": "Denied because no approval rule matched and user confirmation was unavailable"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating no approval rule matched and user confirmation was unavailable.",
      "title": "PermissionDecisionDeniedNoApprovalRuleAndCouldNotRequestFromUser"
    },
    "PermissionDecisionOutcome": {
      "type": "string",
      "enum": [
        "auto_approved",
        "autopilot_denied",
        "prompted_user"
      ],
      "description": "Disposition of a permission request as observed by the responding client.",
      "title": "PermissionDecisionOutcome",
      "x-enumDescriptions": {
        "auto_approved": "The request was approved automatically without a new human decision.",
        "autopilot_denied": "The request was denied without an interactive user decision; source records why.",
        "prompted_user": "The response came from an interactive user prompt."
      }
    },
    "PermissionDecisionReject": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "reject",
          "description": "Reject the request"
        },
        "feedback": {
          "type": "string",
          "description": "Optional feedback explaining the rejection"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision request variant to reject a pending permission request, with optional feedback.",
      "title": "PermissionDecisionReject"
    },
    "PermissionDecisionRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID of the pending permission request"
        },
        "result": {
          "$ref": "#/definitions/PermissionDecision",
          "description": "The client's response to the pending permission prompt"
        },
        "decisionContext": {
          "$ref": "#/definitions/PermissionDecisionContext",
          "description": "Optional informational context describing how and where this response was made. Omit it to preserve legacy behavior without attributing an origin."
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "Pending permission request ID and the decision to apply (approve/reject and scope).",
      "title": "PermissionDecisionRequest",
      "stability": "experimental"
    },
    "PermissionDecisionSource": {
      "type": "string",
      "enum": [
        "assisted_approval",
        "human_response",
        "host_policy",
        "unattended_fallback"
      ],
      "description": "Controlled reason or actor responsible for a permission response.",
      "title": "PermissionDecisionSource",
      "x-enumDescriptions": {
        "assisted_approval": "The response followed the assisted-approval judge recommendation.",
        "human_response": "A human supplied the response through an interactive prompt.",
        "host_policy": "The host applied a standing policy or override rather than a judge recommendation or human decision.",
        "unattended_fallback": "The host denied the request because no interactive user response was available."
      }
    },
    "PermissionDecisionSurface": {
      "type": "string",
      "enum": [
        "tui",
        "prompt_mode",
        "copilot_app",
        "acp",
        "sdk"
      ],
      "description": "Client surface that submitted a permission response.",
      "title": "PermissionDecisionSurface",
      "x-enumDescriptions": {
        "tui": "The interactive Copilot CLI terminal UI.",
        "prompt_mode": "The non-interactive Copilot CLI prompt mode.",
        "copilot_app": "The Copilot App client.",
        "acp": "An Agent Client Protocol host.",
        "sdk": "A generic Copilot SDK client."
      }
    },
    "PermissionDecisionUserNotAvailable": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "user-not-available",
          "description": "No user is available to confirm the request"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Permission-decision variant indicating no user was available to confirm the request.",
      "title": "PermissionDecisionUserNotAvailable"
    },
    "PermissionLocationAddToolApprovalParams": {
      "type": "object",
      "properties": {
        "locationKey": {
          "type": "string",
          "description": "Location key (git root or cwd) to persist the approval to"
        },
        "approval": {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetails",
          "description": "Tool approval to persist and apply"
        }
      },
      "required": [
        "locationKey",
        "approval"
      ],
      "additionalProperties": false,
      "description": "Location-scoped tool approval to persist.",
      "title": "PermissionLocationAddToolApprovalParams",
      "stability": "experimental"
    },
    "PermissionLocationApplyParams": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Working directory whose persisted location permissions should be applied"
        }
      },
      "required": [
        "workingDirectory"
      ],
      "additionalProperties": false,
      "description": "Working directory to load persisted location permissions for.",
      "title": "PermissionLocationApplyParams",
      "stability": "experimental"
    },
    "PermissionLocationApplyResult": {
      "type": "object",
      "properties": {
        "locationKey": {
          "type": "string",
          "description": "Location key used in the location-permissions store"
        },
        "locationType": {
          "$ref": "#/definitions/PermissionLocationType",
          "description": "Whether the location is a git repo or directory"
        },
        "changed": {
          "type": "boolean",
          "description": "Whether a different location was applied since the previous apply call"
        },
        "appliedRuleCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of location-scoped rules added to the live permission service"
        },
        "appliedDirectoryCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of persisted allowed directories added to the live path manager"
        },
        "appliedRules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Location-scoped rules applied to the live permission service"
        }
      },
      "required": [
        "locationKey",
        "locationType",
        "changed",
        "appliedRuleCount",
        "appliedDirectoryCount",
        "appliedRules"
      ],
      "additionalProperties": false,
      "description": "Summary of persisted location permissions applied to the session.",
      "title": "PermissionLocationApplyResult"
    },
    "PermissionLocationResolveParams": {
      "type": "object",
      "properties": {
        "workingDirectory": {
          "type": "string",
          "description": "Working directory whose permission location should be resolved"
        }
      },
      "required": [
        "workingDirectory"
      ],
      "additionalProperties": false,
      "description": "Working directory to resolve into a location-permissions key.",
      "title": "PermissionLocationResolveParams",
      "stability": "experimental"
    },
    "PermissionLocationResolveResult": {
      "type": "object",
      "properties": {
        "locationKey": {
          "type": "string",
          "description": "Location key used in the location-permissions store"
        },
        "locationType": {
          "$ref": "#/definitions/PermissionLocationType",
          "description": "Whether the location is a git repo or directory"
        }
      },
      "required": [
        "locationKey",
        "locationType"
      ],
      "additionalProperties": false,
      "description": "Resolved location-permissions key and type.",
      "title": "PermissionLocationResolveResult"
    },
    "PermissionLocationType": {
      "type": "string",
      "enum": [
        "repo",
        "dir"
      ],
      "description": "Whether the location is a git repo or directory",
      "title": "PermissionLocationType",
      "x-enumDescriptions": {
        "repo": "The permission location is persisted at the git repository root.",
        "dir": "The permission location is persisted at the working directory."
      }
    },
    "PermissionMode": {
      "type": "string",
      "enum": [
        "manual",
        "assisted",
        "allow-all"
      ],
      "description": "Current or requested permission mode.",
      "title": "PermissionMode",
      "x-enumDescriptions": {
        "manual": "Permission requests follow the normal approval flow.",
        "assisted": "Permission requests include an LLM safety recommendation; clients may automatically approve requests judged acceptable.",
        "allow-all": "Tool, path, and URL permission requests are automatically approved."
      },
      "stability": "experimental"
    },
    "PermissionModeSource": {
      "type": "string",
      "enum": [
        "cli_flag",
        "slash_command",
        "autopilot_confirmation",
        "user_setting",
        "rpc"
      ],
      "description": "Optional source for permission-mode telemetry. Defaults to `rpc` when omitted for SDK callers.",
      "title": "PermissionModeSource",
      "x-enumDescriptions": {
        "cli_flag": "The mode was set from a CLI command-line flag.",
        "slash_command": "The mode was set by a slash command.",
        "autopilot_confirmation": "The mode was set by confirming autopilot behavior.",
        "user_setting": "The mode was set at startup by the `defaultPermissionMode` user setting.",
        "rpc": "The mode was set through an RPC caller."
      },
      "stability": "experimental"
    },
    "PermissionPathsAddParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Directory to add to the allow-list. The runtime resolves and validates the path before adding, then loads conventional `.github/skills/` and `.github/agents/` definitions under it when their subsystem gates are enabled. Adding the directory is therefore also a trust decision for configuration stored there."
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Directory path to add to the session's allowed directories.",
      "title": "PermissionPathsAddParams",
      "stability": "experimental"
    },
    "PermissionPathsAllowedCheckParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to check against the session's allowed directories"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path to evaluate against the session's allowed directories.",
      "title": "PermissionPathsAllowedCheckParams",
      "stability": "experimental"
    },
    "PermissionPathsAllowedCheckResult": {
      "type": "object",
      "properties": {
        "allowed": {
          "type": "boolean",
          "description": "Whether the path is within the session's allowed directories"
        }
      },
      "required": [
        "allowed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the supplied path is within the session's allowed directories.",
      "title": "PermissionPathsAllowedCheckResult"
    },
    "PermissionPathsConfig": {
      "type": "object",
      "properties": {
        "unrestricted": {
          "type": "boolean",
          "description": "If true, the runtime allows access to all paths without prompting. Equivalent to constructing an UnrestrictedPathManager."
        },
        "additionalDirectories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Additional directories to allow tool access to (in addition to the session's working directory). Conventional `.github/skills/` and `.github/agents/` definitions under them also join the session catalogs when their subsystem gates are enabled, so supplying a directory is a trust decision for configuration stored there. When `unrestricted` is true, these are still pre-populated on the UnrestrictedPathManager so they remain visible via getDirectories() (e.g. for @-mention completion)."
        },
        "includeTempDirectory": {
          "type": "boolean",
          "description": "Whether to include the system temp directory in the allowed list (defaults to true). Ignored when `unrestricted` is true."
        },
        "workspacePath": {
          "type": "string",
          "description": "Workspace root path (special-cased to be allowed even before the directory exists). Ignored when `unrestricted` is true."
        }
      },
      "additionalProperties": false,
      "description": "If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged.",
      "title": "PermissionPathsConfig"
    },
    "PermissionPathsList": {
      "type": "object",
      "properties": {
        "directories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "All directories currently allowed for tool access on this session."
        },
        "primary": {
          "type": "string",
          "description": "The primary working directory for this session."
        }
      },
      "required": [
        "directories",
        "primary"
      ],
      "additionalProperties": false,
      "description": "Snapshot of the session's allow-listed directories and primary working directory.",
      "title": "PermissionPathsList"
    },
    "PermissionPathsUpdatePrimaryParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Directory to set as the new primary working directory for the session's permission policy."
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Directory path to set as the session's new primary working directory.",
      "title": "PermissionPathsUpdatePrimaryParams",
      "stability": "experimental"
    },
    "PermissionPathsWorkspaceCheckParams": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to check against the session workspace directory"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path to evaluate against the session's workspace (primary) directory.",
      "title": "PermissionPathsWorkspaceCheckParams",
      "stability": "experimental"
    },
    "PermissionPathsWorkspaceCheckResult": {
      "type": "object",
      "properties": {
        "allowed": {
          "type": "boolean",
          "description": "Whether the path is within the session workspace directory"
        }
      },
      "required": [
        "allowed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the supplied path is within the session's workspace directory.",
      "title": "PermissionPathsWorkspaceCheckResult"
    },
    "PermissionPromptShownNotification": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Human-readable description of the prompt the user is being asked to approve. Used by the runtime to fire the registered `permission_prompt` notification hook (e.g. terminal bell, desktop notification)."
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Notification payload describing the permission prompt that the client just rendered.",
      "title": "PermissionPromptShownNotification",
      "stability": "experimental"
    },
    "PermissionRequestResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the permission request was handled successfully"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the permission decision was applied; false when the request was already resolved.",
      "title": "PermissionRequestResult"
    },
    "PermissionResponseCapability": {
      "type": "string",
      "enum": [
        "interactive",
        "headless",
        "none"
      ],
      "description": "Response capability available to the client when it settled a permission request.",
      "title": "PermissionResponseCapability",
      "x-enumDescriptions": {
        "interactive": "The client could ask a user for this decision.",
        "headless": "The client could return an automated response but could not ask a user.",
        "none": "The client had no response path available."
      }
    },
    "PermissionRule": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "description": "The rule kind, such as Shell or GitHubMCP"
        },
        "argument": {
          "type": [
            "string",
            "null"
          ],
          "description": "Argument value matched against the request, or null when the rule kind has no argument (e.g. 'read', 'write', 'memory')."
        }
      },
      "required": [
        "kind",
        "argument"
      ],
      "additionalProperties": false,
      "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value.",
      "title": "PermissionRule"
    },
    "PermissionRulesSet": {
      "type": "object",
      "properties": {
        "approved": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Rules that auto-approve matching requests"
        },
        "denied": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Rules that auto-deny matching requests"
        }
      },
      "required": [
        "approved",
        "denied"
      ],
      "additionalProperties": false,
      "description": "If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged.",
      "title": "PermissionRulesSet"
    },
    "PermissionsConfigureAdditionalContentExclusionPolicy": {
      "type": "object",
      "properties": {
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionsConfigureAdditionalContentExclusionPolicyRule",
            "description": "Single content-exclusion rule supplied to `session.permissions.configure`, with paths, match conditions, and source."
          },
          "description": "Content-exclusion rules to apply."
        },
        "last_updated_at": {
          "description": "Opaque policy update timestamp supplied by the host.",
          "x-opaque-json": true
        },
        "scope": {
          "$ref": "#/definitions/PermissionsConfigureAdditionalContentExclusionPolicyScope",
          "description": "Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration."
        }
      },
      "required": [
        "rules",
        "last_updated_at",
        "scope"
      ],
      "description": "Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope.",
      "title": "PermissionsConfigureAdditionalContentExclusionPolicy"
    },
    "PermissionsConfigureAdditionalContentExclusionPolicyRule": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Path patterns covered by this rule."
        },
        "ifAnyMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions of which at least one must match."
        },
        "ifNoneMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions none of which may match."
        },
        "source": {
          "$ref": "#/definitions/PermissionsConfigureAdditionalContentExclusionPolicyRuleSource",
          "description": "Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type."
        }
      },
      "required": [
        "paths",
        "source"
      ],
      "description": "Single content-exclusion rule supplied to `session.permissions.configure`, with paths, match conditions, and source.",
      "title": "PermissionsConfigureAdditionalContentExclusionPolicyRule"
    },
    "PermissionsConfigureAdditionalContentExclusionPolicyRuleSource": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the policy source."
        },
        "type": {
          "type": "string",
          "description": "Type of the policy source."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a `session.permissions.configure` content-exclusion rule, with source name and type.",
      "title": "PermissionsConfigureAdditionalContentExclusionPolicyRuleSource"
    },
    "PermissionsConfigureAdditionalContentExclusionPolicyScope": {
      "type": "string",
      "enum": [
        "repo",
        "all"
      ],
      "description": "Allowed values for the `PermissionsConfigureAdditionalContentExclusionPolicyScope` enumeration.",
      "title": "PermissionsConfigureAdditionalContentExclusionPolicyScope",
      "x-enumDescriptions": {
        "repo": "The content exclusion policy applies to the current repository.",
        "all": "The content exclusion policy applies across all repositories."
      }
    },
    "PermissionsConfigureParams": {
      "type": "object",
      "properties": {
        "approveAllToolPermissionRequests": {
          "type": "boolean",
          "description": "If specified, sets whether tool permission requests are auto-approved without prompting. Omit to leave the current value unchanged."
        },
        "approveAllReadPermissionRequests": {
          "type": "boolean",
          "description": "If specified, sets whether path/URL read permission requests are auto-approved. Omit to leave the current value unchanged."
        },
        "rules": {
          "$ref": "#/definitions/PermissionRulesSet",
          "description": "If specified, replaces the session's approved/denied permission rules. Omit to leave the current rules unchanged."
        },
        "paths": {
          "$ref": "#/definitions/PermissionPathsConfig",
          "description": "If specified, replaces the session's path-permission policy. The runtime constructs the appropriate PathManager based on these inputs (rooted at the session's working directory). Omit to leave the current path policy unchanged."
        },
        "urls": {
          "$ref": "#/definitions/PermissionUrlsConfig",
          "description": "If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged."
        },
        "additionalContentExclusionPolicies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionsConfigureAdditionalContentExclusionPolicy",
            "description": "Content-exclusion policy supplied to `session.permissions.configure`, with rules, last-updated data, and scope."
          },
          "description": "If specified, replaces the host-supplied GitHub Content Exclusion policies on the session (combined with natively-discovered policies when evaluating tool/file access). Omit to leave the current policies unchanged."
        }
      },
      "additionalProperties": false,
      "description": "Patch of permission policy fields to apply (omit a field to leave it unchanged).",
      "title": "PermissionsConfigureParams",
      "stability": "experimental"
    },
    "PermissionsConfigureResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsConfigureResult"
    },
    "PermissionsFolderTrustAddTrustedResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsFolderTrustAddTrustedResult"
    },
    "PermissionsGetModeRequest": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "No parameters.",
      "title": "PermissionsGetModeRequest",
      "stability": "experimental"
    },
    "PermissionsGetModeResult": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/PermissionMode",
          "description": "Current permission mode"
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Current permission mode.",
      "title": "PermissionsGetModeResult",
      "stability": "experimental"
    },
    "PermissionsLocationsAddToolApprovalDetails": {
      "anyOf": [
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsCommands",
          "description": "Location-persisted tool approval details for specific command identifiers."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsRead",
          "description": "Location-persisted tool approval details for read-only filesystem operations."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsWrite",
          "description": "Location-persisted tool approval details for filesystem write operations."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsMcp",
          "description": "Location-persisted tool approval details for an MCP server tool, or all tools when `toolName` is null."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsMcpSampling",
          "description": "Location-persisted tool approval details for MCP sampling requests from a server."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsMemory",
          "description": "Location-persisted tool approval details for writes to long-term memory."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsCustomTool",
          "description": "Location-persisted tool approval details for a custom tool, keyed by tool name."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsExtensionManagement",
          "description": "Location-persisted tool approval details for extension-management operations, optionally narrowed by operation."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsFactory",
          "description": "Location-persisted factory approval, optionally narrowed by approval key."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess",
          "description": "Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name."
        },
        {
          "$ref": "#/definitions/PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess",
          "description": "Location-persisted tool approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names."
        }
      ],
      "description": "Tool approval to persist and apply",
      "title": "PermissionsLocationsAddToolApprovalDetails"
    },
    "PermissionsLocationsAddToolApprovalDetailsCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Approval scoped to specific command identifiers."
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers covered by this approval."
        }
      },
      "required": [
        "kind",
        "commandIdentifiers"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for specific command identifiers.",
      "title": "PermissionsLocationsAddToolApprovalDetailsCommands"
    },
    "PermissionsLocationsAddToolApprovalDetailsCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Approval covering a custom tool."
        },
        "toolName": {
          "type": "string",
          "description": "Custom tool name."
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for a custom tool, keyed by tool name.",
      "title": "PermissionsLocationsAddToolApprovalDetailsCustomTool"
    },
    "PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-env-access",
          "description": "Approval covering an extension's request to read sensitive environment variables."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        },
        "environmentVariables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Names of the sensitive environment variables this approval covers. Values are never persisted."
        }
      },
      "required": [
        "kind",
        "extensionName",
        "environmentVariables"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.",
      "title": "PermissionsLocationsAddToolApprovalDetailsExtensionEnvAccess"
    },
    "PermissionsLocationsAddToolApprovalDetailsExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Approval covering extension lifecycle operations such as enable, disable, or reload."
        },
        "operation": {
          "type": "string",
          "description": "Optional operation identifier; when omitted, the approval covers all extension management operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for extension-management operations, optionally narrowed by operation.",
      "title": "PermissionsLocationsAddToolApprovalDetailsExtensionManagement"
    },
    "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Approval covering an extension's request to access a permission-gated capability."
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name."
        }
      },
      "required": [
        "kind",
        "extensionName"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for an extension's permission-gated capability access, keyed by extension name.",
      "title": "PermissionsLocationsAddToolApprovalDetailsExtensionPermissionAccess"
    },
    "PermissionsLocationsAddToolApprovalDetailsFactory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "factory",
          "description": "Approval covering factory operations."
        },
        "approvalKey": {
          "type": "string",
          "description": "Optional factory operation name or canonical approval key; when omitted, the approval covers all factory operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-persisted factory approval, optionally narrowed by approval key.",
      "title": "PermissionsLocationsAddToolApprovalDetailsFactory"
    },
    "PermissionsLocationsAddToolApprovalDetailsMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "Approval covering an MCP tool."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "description": "MCP tool name, or null to cover every tool on the server."
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for an MCP server tool, or all tools when `toolName` is null.",
      "title": "PermissionsLocationsAddToolApprovalDetailsMcp"
    },
    "PermissionsLocationsAddToolApprovalDetailsMcpSampling": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp-sampling",
          "description": "Approval covering MCP sampling requests for a server."
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name."
        }
      },
      "required": [
        "kind",
        "serverName"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for MCP sampling requests from a server.",
      "title": "PermissionsLocationsAddToolApprovalDetailsMcpSampling"
    },
    "PermissionsLocationsAddToolApprovalDetailsMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Approval covering writes to long-term memory."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for writes to long-term memory.",
      "title": "PermissionsLocationsAddToolApprovalDetailsMemory"
    },
    "PermissionsLocationsAddToolApprovalDetailsRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Approval covering read-only filesystem operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for read-only filesystem operations.",
      "title": "PermissionsLocationsAddToolApprovalDetailsRead"
    },
    "PermissionsLocationsAddToolApprovalDetailsWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Approval covering filesystem write operations."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Location-persisted tool approval details for filesystem write operations.",
      "title": "PermissionsLocationsAddToolApprovalDetailsWrite"
    },
    "PermissionsLocationsAddToolApprovalResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsLocationsAddToolApprovalResult"
    },
    "PermissionsModifyRulesParams": {
      "type": "object",
      "properties": {
        "scope": {
          "$ref": "#/definitions/PermissionsModifyRulesScope",
          "description": "Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file."
        },
        "add": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Rules to add to the scope. Applied before `remove`/`removeAll`."
        },
        "remove": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PermissionRule",
            "description": "A permission approval or denial rule matched against a tool request, identified by a rule kind with an optional argument value."
          },
          "description": "Specific rules to remove from the scope. Ignored when `removeAll` is true."
        },
        "removeAll": {
          "type": "boolean",
          "description": "When true, removes every rule currently in the scope (after any `add` is applied). Useful for clearing the location scope wholesale."
        }
      },
      "required": [
        "scope"
      ],
      "additionalProperties": false,
      "description": "Scope and add/remove instructions for modifying session- or location-scoped permission rules.",
      "title": "PermissionsModifyRulesParams",
      "stability": "experimental"
    },
    "PermissionsModifyRulesResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsModifyRulesResult"
    },
    "PermissionsModifyRulesScope": {
      "type": "string",
      "enum": [
        "session",
        "location"
      ],
      "description": "Whether the change applies to ephemeral session-scoped rules (cleared at session end) or to location-scoped rules persisted via the location-permissions config file.",
      "title": "PermissionsModifyRulesScope",
      "x-enumDescriptions": {
        "session": "Apply the rule change only to this session.",
        "location": "Persist the rule change for this project location."
      }
    },
    "PermissionsNotifyPromptShownResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsNotifyPromptShownResult"
    },
    "PermissionsPathsAddResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsPathsAddResult"
    },
    "PermissionsPathsListRequest": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "No parameters; returns the session's allow-listed directories.",
      "title": "PermissionsPathsListRequest",
      "stability": "experimental"
    },
    "PermissionsPathsUpdatePrimaryResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsPathsUpdatePrimaryResult"
    },
    "PermissionsPendingRequestsRequest": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "No parameters; returns currently-pending permission requests for the session.",
      "title": "PermissionsPendingRequestsRequest",
      "stability": "experimental"
    },
    "PermissionsResetSessionApprovalsRequest": {
      "type": "object",
      "properties": {
        "includeLocation": {
          "type": "boolean",
          "description": "Whether location-scoped approvals are cleared too. Defaults to `true`."
        }
      },
      "additionalProperties": false,
      "description": "Clears session-scoped tool permission approvals, and optionally the location-scoped ones.",
      "title": "PermissionsResetSessionApprovalsRequest",
      "stability": "experimental"
    },
    "PermissionsResetSessionApprovalsResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsResetSessionApprovalsResult"
    },
    "PermissionsSetApproveAllRequest": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether to auto-approve all tool permission requests"
        },
        "source": {
          "$ref": "#/definitions/PermissionsSetApproveAllSource",
          "description": "Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Allow-all toggle for tool permission requests, with an optional telemetry source.",
      "title": "PermissionsSetApproveAllRequest",
      "stability": "experimental"
    },
    "PermissionsSetApproveAllResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsSetApproveAllResult"
    },
    "PermissionsSetApproveAllSource": {
      "type": "string",
      "enum": [
        "cli_flag",
        "slash_command",
        "autopilot_confirmation",
        "user_setting",
        "rpc"
      ],
      "description": "Optional source for allow-all telemetry. Defaults to `rpc` when omitted for SDK callers.",
      "title": "PermissionsSetApproveAllSource",
      "x-enumDescriptions": {
        "cli_flag": "Allow-all was enabled from a CLI command-line flag.",
        "slash_command": "Allow-all was enabled by a slash command.",
        "autopilot_confirmation": "Allow-all was enabled by confirming autopilot behavior.",
        "user_setting": "Allow-all was enabled at startup by the `defaultPermissionMode` user setting.",
        "rpc": "Allow-all was enabled through an RPC caller."
      }
    },
    "PermissionsSetModeRequest": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/PermissionMode",
          "description": "Permission mode to apply"
        },
        "assistedApprovalModel": {
          "type": "string",
          "description": "Optional judge model id for assisted mode. When omitted, the session resolves the provider default: `gpt-5.5` for CAPI sessions and the active session model for BYOK sessions."
        },
        "source": {
          "$ref": "#/definitions/PermissionModeSource",
          "description": "Optional source for permission-mode telemetry. Defaults to `rpc` when omitted for SDK callers."
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Permission mode to apply for the session.",
      "title": "PermissionsSetModeRequest",
      "stability": "experimental"
    },
    "PermissionsSetModeResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        },
        "mode": {
          "$ref": "#/definitions/PermissionMode",
          "description": "Authoritative permission mode after the mutation"
        }
      },
      "required": [
        "success",
        "mode"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the requested permission mode was applied and reports the authoritative post-mutation mode.",
      "title": "PermissionsSetModeResult",
      "stability": "experimental"
    },
    "PermissionsSetRequiredRequest": {
      "type": "object",
      "properties": {
        "required": {
          "type": "boolean",
          "description": "Whether the client wants `permission.requested` events bridged from the session-owned permission service. CLI clients that render prompt UI set this to `true` for as long as their listener is mounted; headless callers leave it unset (the default is `false`)."
        }
      },
      "required": [
        "required"
      ],
      "additionalProperties": false,
      "description": "Toggles whether permission prompts should be bridged into session events for this client.",
      "title": "PermissionsSetRequiredRequest",
      "stability": "experimental"
    },
    "PermissionsSetRequiredResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsSetRequiredResult"
    },
    "PermissionsUrlsSetUnrestrictedModeResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the operation succeeded.",
      "title": "PermissionsUrlsSetUnrestrictedModeResult"
    },
    "PermissionUrlsConfig": {
      "type": "object",
      "properties": {
        "unrestricted": {
          "type": "boolean",
          "description": "If true, the runtime allows access to all URLs without prompting. Initial allow-list is ignored when this is true."
        },
        "initialAllowed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Initial list of allowed URL/domain patterns. Patterns may include path components. Ignored when `unrestricted` is true."
        }
      },
      "additionalProperties": false,
      "description": "If specified, replaces the session's URL-permission policy. The runtime constructs a fresh DefaultUrlManager based on these inputs. Omit to leave the current URL policy unchanged.",
      "title": "PermissionUrlsConfig"
    },
    "PermissionUrlsSetUnrestrictedModeParams": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether to allow access to all URLs without prompting. Toggles the runtime's URL-permission policy in place."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Whether the URL-permission policy should run in unrestricted mode.",
      "title": "PermissionUrlsSetUnrestrictedModeParams",
      "stability": "experimental"
    },
    "PingRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Optional message to echo back"
        }
      },
      "additionalProperties": false,
      "description": "Optional message to echo back to the caller.",
      "title": "PingRequest"
    },
    "PingResult": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Echoed message (or default greeting)"
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the server handled the ping"
        },
        "protocolVersion": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Server protocol version number"
        }
      },
      "required": [
        "message",
        "timestamp",
        "protocolVersion"
      ],
      "additionalProperties": false,
      "description": "Server liveness response, including the echoed message, current server timestamp, and protocol version.",
      "title": "PingResult"
    },
    "PlanReadResult": {
      "type": "object",
      "properties": {
        "exists": {
          "type": "boolean",
          "description": "Whether the plan file exists in the workspace"
        },
        "content": {
          "type": [
            "string",
            "null"
          ],
          "description": "The content of the plan file, or null if it does not exist"
        },
        "path": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute file path of the plan file, or null if workspace is not enabled"
        }
      },
      "required": [
        "exists",
        "content",
        "path"
      ],
      "additionalProperties": false,
      "description": "Existence, contents, and resolved path of the session plan file.",
      "title": "PlanReadResult"
    },
    "PlanReadSqlTodosResult": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PlanSqlTodosRow",
            "description": "A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column."
          },
          "description": "Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables."
        }
      },
      "required": [
        "rows"
      ],
      "additionalProperties": false,
      "description": "Todo rows read from the session SQL database. Empty when no session database is available.",
      "title": "PlanReadSqlTodosResult"
    },
    "PlanReadSqlTodosWithDependenciesResult": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PlanSqlTodosRow",
            "description": "A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column."
          },
          "description": "Rows from the session SQL todos table, ordered by creation time with insertion order used to break ties when available and id used for WITHOUT ROWID tables. Empty when no database, no todos table, or the SELECT failed."
        },
        "dependencies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PlanSqlTodoDependency",
            "description": "A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another."
          },
          "description": "Edges from the session SQL todo_deps table. Empty when no database, no todo_deps table, or the SELECT failed. Read independently from `rows`, so a broken todo_deps table does not affect the rows result and vice versa."
        }
      },
      "required": [
        "rows",
        "dependencies"
      ],
      "additionalProperties": false,
      "description": "Todo rows + dependency edges read from the session SQL database.",
      "title": "PlanReadSqlTodosWithDependenciesResult"
    },
    "PlanSqlTodoDependency": {
      "type": "object",
      "properties": {
        "todoId": {
          "type": "string",
          "description": "ID of the todo that has the dependency."
        },
        "dependsOn": {
          "type": "string",
          "description": "ID of the todo it depends on."
        }
      },
      "required": [
        "todoId",
        "dependsOn"
      ],
      "additionalProperties": false,
      "description": "A single dependency edge read from the session SQL `todo_deps` table, indicating that one todo must complete before another.",
      "title": "PlanSqlTodoDependency"
    },
    "PlanSqlTodosRow": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Todo identifier."
        },
        "title": {
          "type": "string",
          "description": "Todo title."
        },
        "description": {
          "type": "string",
          "description": "Todo description."
        },
        "status": {
          "type": "string",
          "description": "Todo status."
        },
        "createdAt": {
          "type": "string",
          "description": "Todo creation time, as stored by the session SQL schema's `datetime('now')` default: `YYYY-MM-DD HH:MM:SS` in UTC. Lets clients attribute todos to the work item that created them (e.g. scoping a goal's progress to the todos it produced) rather than to the whole session."
        }
      },
      "additionalProperties": false,
      "description": "A single todo row read from the session SQL `todos` table. All fields are optional because the SQL schema is best-effort and the agent may not have populated every column.",
      "title": "PlanSqlTodosRow"
    },
    "PlanUpdateRequest": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "The new content for the plan file"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Replacement contents to write to the session plan file.",
      "title": "PlanUpdateRequest",
      "stability": "experimental"
    },
    "Plugin": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name"
        },
        "marketplace": {
          "type": "string",
          "description": "Marketplace the plugin came from"
        },
        "version": {
          "type": "string",
          "description": "Installed version"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the plugin is currently enabled"
        }
      },
      "required": [
        "name",
        "marketplace",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Session plugin metadata, with name, marketplace, optional version, and enabled state.",
      "title": "Plugin"
    },
    "PluginInstallResult": {
      "type": "object",
      "properties": {
        "plugin": {
          "$ref": "#/definitions/InstalledPluginInfo",
          "description": "The newly installed plugin's metadata"
        },
        "skillsInstalled": {
          "type": "integer",
          "description": "Number of skills discovered and installed from the plugin"
        },
        "postInstallMessage": {
          "type": "string",
          "description": "Optional post-install message provided by the plugin (e.g. setup instructions)"
        },
        "deprecationWarning": {
          "type": "string",
          "description": "Set when the install path is deprecated (e.g. direct repo / URL / local installs). Callers should surface this to end users."
        }
      },
      "required": [
        "plugin",
        "skillsInstalled"
      ],
      "additionalProperties": false,
      "description": "Result of installing a plugin.",
      "title": "PluginInstallResult"
    },
    "PluginList": {
      "type": "object",
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Plugin",
            "description": "Session plugin metadata, with name, marketplace, optional version, and enabled state."
          },
          "description": "Installed plugins"
        }
      },
      "required": [
        "plugins"
      ],
      "additionalProperties": false,
      "description": "Plugins installed for the session, with their enabled state and version metadata.",
      "title": "PluginList"
    },
    "PluginListResult": {
      "type": "object",
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstalledPluginInfo",
            "description": "Information about an installed plugin tracked in global state."
          },
          "description": "Installed plugins"
        }
      },
      "required": [
        "plugins"
      ],
      "additionalProperties": false,
      "description": "Plugins installed in user/global state.",
      "title": "PluginListResult"
    },
    "PluginsBuiltinSetRequest": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "maxItems": 64,
          "description": "Complete replacement set of trusted built-in plugin directories. Every entry must be an absolute local filesystem path no longer than 4096 characters."
        }
      },
      "required": [
        "paths"
      ],
      "additionalProperties": false,
      "description": "Trusted built-in plugin directories to use for this runtime process.",
      "title": "PluginsBuiltinSetRequest"
    },
    "PluginsDisableRequest": {
      "type": "object",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Plugin names or \"plugin@marketplace\" specs to disable. Unknown names are ignored. Non-marketplace direct installs cannot be disabled via this API; uninstall them instead. Plugin-owned MCP servers are stopped in active sessions immediately; other plugin contributions remain available until each session reloads plugins."
        }
      },
      "required": [
        "names"
      ],
      "additionalProperties": false,
      "description": "Plugin names (or specs) to disable.",
      "title": "PluginsDisableRequest"
    },
    "PluginsEnableRequest": {
      "type": "object",
      "properties": {
        "names": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Plugin names or \"plugin@marketplace\" specs to enable. Unknown names are ignored. Non-marketplace direct installs are always enabled and cannot be toggled via this API."
        }
      },
      "required": [
        "names"
      ],
      "additionalProperties": false,
      "description": "Plugin names (or specs) to enable.",
      "title": "PluginsEnableRequest"
    },
    "PluginsInstallRequest": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "description": "Plugin install spec. Accepts the same forms as the CLI: \"plugin@marketplace\" (marketplace install), \"owner/repo\" or \"owner/repo:subpath\" (GitHub direct), an http/https/ssh URL, or a local path. Direct (non-marketplace) installs are deprecated and will produce a deprecationWarning in the result."
        },
        "workingDirectory": {
          "type": "string",
          "description": "Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory."
        }
      },
      "required": [
        "source"
      ],
      "additionalProperties": false,
      "description": "Plugin source and optional working directory for relative-path resolution.",
      "title": "PluginsInstallRequest"
    },
    "PluginsMarketplacesAddRequest": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "description": "Marketplace source. Accepts the same forms as the CLI: \"owner/repo\" or \"owner/repo#ref\" (GitHub), an http/https/ssh URL (optionally with #ref), a git scp-style URL (user@host:path), or a local path. The marketplace's own name (from its manifest) is used as the registration key."
        },
        "workingDirectory": {
          "type": "string",
          "description": "Working directory used to resolve relative local paths in `source`. Defaults to the server's current working directory."
        }
      },
      "required": [
        "source"
      ],
      "additionalProperties": false,
      "description": "Marketplace source and optional working directory for relative-path resolution.",
      "title": "PluginsMarketplacesAddRequest"
    },
    "PluginsMarketplacesBrowseRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Marketplace name to browse"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name of the marketplace whose plugin catalog to fetch.",
      "title": "PluginsMarketplacesBrowseRequest"
    },
    "PluginsMarketplacesRefreshRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "Marketplace name to refresh. When omitted, every registered marketplace is refreshed."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional marketplace name; omit to refresh all.",
      "title": "PluginsMarketplacesRefreshRequest"
    },
    "PluginsMarketplacesRemoveRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Marketplace name to remove"
        },
        "force": {
          "type": "boolean",
          "description": "When true, also uninstall every plugin sourced from this marketplace. When false (default), removal is a no-op if any plugin from this marketplace is installed and the dependent plugin names are returned in the result."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name of the marketplace to remove and an optional force flag.",
      "title": "PluginsMarketplacesRemoveRequest"
    },
    "PluginsReloadRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "reloadMcp": {
              "type": "boolean",
              "description": "Reload MCP server connections after refreshing plugins. Defaults to true."
            },
            "reloadCustomAgents": {
              "type": "boolean",
              "description": "Re-run custom-agent discovery after refreshing plugins. Defaults to true."
            },
            "reloadHooks": {
              "type": "boolean",
              "description": "Re-load user, plugin, and (subject to `deferRepoHooks`) repo hooks. Defaults to true. Has no effect when the host has not registered a hook reloader (e.g. remote sessions)."
            },
            "reloadExtensions": {
              "type": "boolean",
              "description": "Re-discover and relaunch subprocess extensions (including plugin-shipped extensions) after refreshing plugins. Defaults to true. Has no effect when the session has no active extension controller (e.g. extensions were not requested for the session)."
            },
            "deferRepoHooks": {
              "type": "boolean",
              "description": "When true, skip repo-level hooks during the hook reload. Use before folder trust is confirmed; load them post-trust via `sessions.loadDeferredRepoHooks`."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional flags controlling which side effects the reload performs.",
      "title": "PluginsReloadRequest",
      "stability": "experimental"
    },
    "PluginsUninstallRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name or \"plugin@marketplace\" spec to uninstall. When ambiguous, prefer the fully-qualified spec."
        },
        "directSourceId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Stable source identity for a direct (non-marketplace) install. Disambiguates uninstall when multiple installed plugins share the same name."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name (or spec) of the plugin to uninstall.",
      "title": "PluginsUninstallRequest"
    },
    "PluginsUpdateRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name or \"plugin@marketplace\" spec to update."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name (or spec) of the plugin to update.",
      "title": "PluginsUpdateRequest"
    },
    "PluginUpdateAllEntry": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name that was updated"
        },
        "marketplace": {
          "type": "string",
          "description": "Marketplace the plugin came from. Empty string (\"\") for direct installs."
        },
        "success": {
          "type": "boolean",
          "description": "Whether the update succeeded for this plugin"
        },
        "previousVersion": {
          "type": "string",
          "description": "Previously installed version, when available"
        },
        "newVersion": {
          "type": "string",
          "description": "Version after the update, when available"
        },
        "skillsInstalled": {
          "type": "integer",
          "description": "Number of skills installed after the update (success only)"
        },
        "error": {
          "type": "string",
          "description": "Error message (failure only)"
        }
      },
      "required": [
        "name",
        "marketplace",
        "success"
      ],
      "additionalProperties": false,
      "description": "Per-plugin result from updating all plugins, with versions, skills installed, success flag, and optional error.",
      "title": "PluginUpdateAllEntry"
    },
    "PluginUpdateAllResult": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PluginUpdateAllEntry",
            "description": "Per-plugin result from updating all plugins, with versions, skills installed, success flag, and optional error."
          },
          "description": "Per-plugin update results in deterministic order."
        }
      },
      "required": [
        "results"
      ],
      "additionalProperties": false,
      "description": "Result of updating all installed plugins.",
      "title": "PluginUpdateAllResult"
    },
    "PluginUpdateResult": {
      "type": "object",
      "properties": {
        "previousVersion": {
          "type": "string",
          "description": "Version that was previously installed, when available"
        },
        "newVersion": {
          "type": "string",
          "description": "Version after the update, when reported by the plugin manifest"
        },
        "skillsInstalled": {
          "type": "integer",
          "description": "Number of skills discovered and installed after the update"
        }
      },
      "required": [
        "skillsInstalled"
      ],
      "additionalProperties": false,
      "description": "Result of updating a single plugin.",
      "title": "PluginUpdateResult"
    },
    "ProtocolExternalToolDefer": {
      "type": "string",
      "enum": [
        "auto",
        "never"
      ],
      "description": "Controls whether the runtime may defer loading an external tool definition.",
      "title": "ProtocolExternalToolDefer",
      "x-enumDescriptions": {
        "auto": "The runtime may defer the tool according to its tool-loading policy.",
        "never": "The runtime must include the tool without deferring it."
      },
      "stability": "experimental"
    },
    "ProtocolExternalToolDefinition": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique model-visible tool name."
        },
        "description": {
          "type": "string",
          "description": "Model-visible explanation of what the tool does."
        },
        "title": {
          "type": "string",
          "description": "Optional human-readable display title."
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "JSON Schema describing the tool's input arguments."
        },
        "overridesBuiltInTool": {
          "type": "boolean",
          "description": "Whether this definition replaces a built-in tool with the same name."
        },
        "skipPermission": {
          "type": "boolean",
          "description": "Whether execution bypasses the normal tool permission prompt."
        },
        "defer": {
          "$ref": "#/definitions/ProtocolExternalToolDefer",
          "description": "Tool-loading deferral policy."
        },
        "isTerminal": {
          "type": "boolean",
          "description": "Whether the tool executes commands in a terminal."
        },
        "metadata": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Optional caller-defined metadata associated with the tool."
        }
      },
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "Serializable definition of a caller-implemented tool whose execution is handled over the SDK connection.",
      "title": "ProtocolExternalToolDefinition",
      "stability": "experimental"
    },
    "ProviderAddRequest": {
      "type": "object",
      "properties": {
        "providers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/NamedProviderConfig",
            "description": "External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch."
          },
          "description": "Named BYOK provider connections to register, additive to any providers already in the registry. Each name must be unique across the registry and must not contain '/'."
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProviderModelConfig",
            "description": "A BYOK model definition referencing a named provider."
          },
          "description": "BYOK model definitions to register. Each must reference a provider that is already registered or included in this same call. Selection ids (`provider/id`) must be unique across the registry."
        }
      },
      "additionalProperties": false,
      "description": "BYOK providers and/or models to add to the session's registry at runtime. Both fields are optional; provide providers, models, or both.",
      "title": "ProviderAddRequest",
      "stability": "experimental"
    },
    "ProviderAddResult": {
      "type": "object",
      "properties": {
        "models": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          },
          "description": "Synthesized selectable model entries for the newly added BYOK models, each under its provider-qualified selection id (`provider/id`). Empty when only providers were added."
        }
      },
      "required": [
        "models"
      ],
      "additionalProperties": false,
      "description": "The selectable model entries synthesized for the models added by this call.",
      "title": "ProviderAddResult",
      "stability": "experimental"
    },
    "ProviderConfig": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/ProviderConfigType",
          "description": "Provider type. Defaults to \"openai\" for generic OpenAI-compatible APIs."
        },
        "wireApi": {
          "$ref": "#/definitions/ProviderConfigWireApi",
          "description": "Wire API format (openai/azure only). Defaults to \"completions\"."
        },
        "transport": {
          "$ref": "#/definitions/ProviderConfigTransport",
          "description": "Provider transport. Defaults to \"http\"."
        },
        "baseUrl": {
          "type": "string",
          "description": "API endpoint URL."
        },
        "apiKey": {
          "type": "string",
          "description": "API key. Optional for local providers like Ollama."
        },
        "bearerToken": {
          "type": "string",
          "description": "Bearer token for authentication. Sets the Authorization header directly. Takes precedence over apiKey when both are set."
        },
        "azure": {
          "$ref": "#/definitions/ProviderConfigAzure",
          "description": "Azure-specific provider options."
        },
        "modelId": {
          "type": "string",
          "description": "Well-known model ID used for capability lookup. When set, agent behavior config and token limits are inferred from this model."
        },
        "modelCapabilities": {
          "$ref": "#/definitions/ModelCapabilitiesOverride",
          "description": "Overrides for model capabilities when they cannot be inferred from modelId."
        },
        "providerName": {
          "type": "string",
          "description": "Provider name used for model and telemetry attribution."
        },
        "wireModel": {
          "type": "string",
          "description": "The model identifier sent to the provider API for inference (the \"wire\" model), as opposed to modelId which is the well-known base."
        },
        "maxPromptTokens": {
          "type": "number",
          "description": "Maximum prompt/input tokens for the model."
        },
        "maxContextWindowTokens": {
          "type": "number",
          "description": "Maximum context window tokens for the model."
        },
        "maxOutputTokens": {
          "type": "number",
          "description": "Maximum output tokens for the model."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Custom HTTP headers to include in all outbound requests to the provider."
        },
        "hasBearerTokenProvider": {
          "type": "boolean",
          "description": "When true, the SDK client supplies bearer tokens on demand: the runtime calls the client-session `providerToken.getToken` callback before each request and applies the returned token as an `Authorization: Bearer <token>` header. This is the bearer/OAuth scheme used by Azure AD / managed-identity tokens and provider OAuth access tokens (including Anthropic's), not a provider-specific API-key header such as Anthropic's `x-api-key`. The token-acquiring function itself stays on the SDK side and is never serialized; only this flag crosses the wire. When set alongside `apiKey`/`bearerToken`, the callback takes precedence: the runtime applies the token returned by `providerToken.getToken` as the `Authorization: Bearer` header for each request and does not send the static credential."
        }
      },
      "required": [
        "baseUrl"
      ],
      "additionalProperties": false,
      "description": "Custom model-provider configuration (BYOK).",
      "title": "ProviderConfig",
      "stability": "experimental"
    },
    "ProviderConfigAzure": {
      "type": "object",
      "properties": {
        "apiVersion": {
          "type": "string",
          "description": "API version. When set, uses the versioned deployment route. When omitted, uses the GA versionless v1 route."
        }
      },
      "additionalProperties": false,
      "description": "Azure-specific provider options.",
      "title": "ProviderConfigAzure"
    },
    "ProviderConfigTransport": {
      "type": "string",
      "enum": [
        "http",
        "websockets"
      ],
      "description": "Provider transport. Defaults to \"http\".",
      "title": "ProviderConfigTransport",
      "x-enumDescriptions": {
        "http": "HTTP request/streaming transport.",
        "websockets": "WebSocket transport."
      }
    },
    "ProviderConfigType": {
      "type": "string",
      "enum": [
        "openai",
        "azure",
        "anthropic"
      ],
      "description": "Provider type. Defaults to \"openai\" for generic OpenAI-compatible APIs.",
      "title": "ProviderConfigType",
      "x-enumDescriptions": {
        "openai": "Generic OpenAI-compatible API.",
        "azure": "Azure OpenAI Service endpoint.",
        "anthropic": "Anthropic API endpoint."
      }
    },
    "ProviderConfigWireApi": {
      "type": "string",
      "enum": [
        "completions",
        "responses"
      ],
      "description": "Wire API format (openai/azure only). Defaults to \"completions\".",
      "title": "ProviderConfigWireApi",
      "x-enumDescriptions": {
        "completions": "OpenAI Chat Completions wire format.",
        "responses": "OpenAI Responses API wire format."
      }
    },
    "ProviderEndpoint": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/ProviderEndpointType",
          "description": "Provider family. Matches the `type` field of a BYOK provider config."
        },
        "wireApi": {
          "$ref": "#/definitions/ProviderEndpointWireApi",
          "description": "Wire API to be used, when required for the provider type."
        },
        "transport": {
          "$ref": "#/definitions/ProviderEndpointTransport",
          "description": "Transport to be used for provider requests."
        },
        "baseUrl": {
          "type": "string",
          "format": "uri",
          "description": "Base URL to pass to the LLM client library."
        },
        "apiKey": {
          "type": "string",
          "description": "A credential the caller should use with this endpoint. Omitted only when the endpoint accepts unauthenticated requests."
        },
        "headers": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "HTTP headers the caller must include on every outbound request."
        },
        "sessionToken": {
          "$ref": "#/definitions/ProviderSessionToken",
          "description": "Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one."
        }
      },
      "required": [
        "type",
        "baseUrl",
        "headers"
      ],
      "additionalProperties": false,
      "description": "A snapshot of the provider endpoint the session is currently configured to talk to.",
      "title": "ProviderEndpoint"
    },
    "ProviderEndpointTransport": {
      "type": "string",
      "enum": [
        "http",
        "websockets"
      ],
      "description": "Transport to be used for provider requests.",
      "title": "ProviderEndpointTransport",
      "x-enumDescriptions": {
        "http": "HTTP request/streaming transport.",
        "websockets": "WebSocket transport."
      }
    },
    "ProviderEndpointType": {
      "type": "string",
      "enum": [
        "openai",
        "azure",
        "anthropic"
      ],
      "description": "Provider family. Matches the `type` field of a BYOK provider config.",
      "title": "ProviderEndpointType",
      "x-enumDescriptions": {
        "openai": "OpenAI-compatible endpoint (use the OpenAI client library).",
        "azure": "Azure OpenAI endpoint (use the OpenAI client library with the Azure base URL).",
        "anthropic": "Anthropic endpoint (use the Anthropic client library)."
      }
    },
    "ProviderEndpointWireApi": {
      "type": "string",
      "enum": [
        "completions",
        "responses"
      ],
      "description": "Wire API to be used, when required for the provider type.",
      "title": "ProviderEndpointWireApi",
      "x-enumDescriptions": {
        "completions": "Classic chat-completions request shape.",
        "responses": "Newer responses request shape."
      }
    },
    "ProviderGetEndpointRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "modelId": {
              "type": "string",
              "description": "Model identifier the caller intends to use against the returned endpoint. Used to pick the correct wire shape. Omit to use whichever model the session is currently using."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Optional model identifier to scope the endpoint snapshot to.",
      "title": "ProviderGetEndpointRequest",
      "stability": "experimental"
    },
    "ProviderModelConfig": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Provider-local model id, unique within its provider. The session-wide selection id (shown in the model list and passed to switchTo) is the provider-qualified `provider/id`."
        },
        "provider": {
          "type": "string",
          "description": "Name of the configured provider that serves this model."
        },
        "wireModel": {
          "type": "string",
          "description": "The model name sent to the provider API for inference. Defaults to `id`."
        },
        "modelId": {
          "type": "string",
          "description": "Well-known base model id used for behavior/capability/config lookup. Defaults to `id`."
        },
        "name": {
          "type": "string",
          "description": "Display name for model pickers. Defaults to the provider-qualified selection id (`provider/id`)."
        },
        "maxPromptTokens": {
          "type": "number",
          "description": "Maximum prompt/input tokens for the model."
        },
        "maxContextWindowTokens": {
          "type": "number",
          "description": "Maximum context window tokens for the model."
        },
        "maxOutputTokens": {
          "type": "number",
          "description": "Maximum output tokens for the model."
        },
        "capabilities": {
          "$ref": "#/definitions/ModelCapabilitiesOverride",
          "description": "Optional capability overrides (vision, tool_calls, reasoning, etc.)."
        }
      },
      "required": [
        "id",
        "provider"
      ],
      "additionalProperties": false,
      "description": "A BYOK model definition referencing a named provider.",
      "title": "ProviderModelConfig"
    },
    "ProviderSessionToken": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "The short-lived token value."
        },
        "header": {
          "type": "string",
          "description": "HTTP header name the token must be sent under."
        },
        "model": {
          "type": "string",
          "description": "The model the token is bound to, when applicable. When set, the token is only valid for requests against this model."
        },
        "expiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the token expires, if known. Callers should refresh by calling `getEndpoint` again before this time, or reactively on any 401/403 response from `baseUrl`."
        }
      },
      "required": [
        "token",
        "header"
      ],
      "additionalProperties": false,
      "description": "Short-lived, rotating credential the caller must send on every request, in addition to `apiKey` if one is present. Omitted when the endpoint does not require one.",
      "title": "ProviderSessionToken"
    },
    "ProviderTokenAcquireRequest": {
      "type": "object",
      "properties": {
        "providerName": {
          "type": "string",
          "description": "Name of the BYOK provider needing a token. For the legacy whole-session provider this is the implicit provider name; for named providers it is the configured provider name."
        }
      },
      "required": [
        "providerName"
      ],
      "additionalProperties": false,
      "description": "Asks the SDK client to acquire a bearer token for a BYOK provider whose config set `hasBearerTokenProvider: true`. Issued by the runtime before each outbound model request; the runtime does no caching, so this is sent once per request.",
      "title": "ProviderTokenAcquireRequest",
      "stability": "experimental"
    },
    "ProviderTokenAcquireResult": {
      "type": "object",
      "properties": {
        "token": {
          "type": "string",
          "description": "The bearer token value (without the `Bearer ` prefix)."
        }
      },
      "required": [
        "token"
      ],
      "additionalProperties": false,
      "description": "A bearer token supplied by the SDK client for a BYOK provider. The runtime sets it as `Authorization: Bearer <token>` on the outbound request and does no caching; the SDK consumer owns token caching and refresh.",
      "title": "ProviderTokenAcquireResult"
    },
    "PushAttachment": {
      "anyOf": [
        {
          "$ref": "#/definitions/PushAttachmentFile",
          "description": "File attachment"
        },
        {
          "$ref": "#/definitions/PushAttachmentDirectory",
          "description": "Directory attachment"
        },
        {
          "$ref": "#/definitions/PushAttachmentSelection",
          "description": "Code selection attachment from an editor"
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubReference",
          "description": "GitHub issue, pull request, or discussion reference"
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubCommit",
          "description": "Pointer to a GitHub commit."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubRelease",
          "description": "Pointer to a GitHub release."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubActionsJob",
          "description": "Pointer to a GitHub Actions job."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubRepository",
          "description": "Pointer to a GitHub repository."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubFileDiff",
          "description": "Pointer to a single-file diff. At least one of `head` and `base` must be present."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubTreeComparison",
          "description": "Pointer to a comparison between two git revisions."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubUrl",
          "description": "Generic GitHub URL reference."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubFile",
          "description": "Pointer to a file in a GitHub repository at a specific ref."
        },
        {
          "$ref": "#/definitions/PushAttachmentGitHubSnippet",
          "description": "Pointer to a line range inside a file in a GitHub repository."
        },
        {
          "$ref": "#/definitions/PushAttachmentBlob",
          "description": "Blob attachment with inline base64-encoded data"
        },
        {
          "$ref": "#/definitions/ExtensionContextPushInput",
          "description": "Slim input shape for extension_context attachments; identity fields are runtime-derived."
        }
      ],
      "description": "Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context.",
      "title": "PushAttachment"
    },
    "PushAttachmentBlob": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "blob",
          "description": "Attachment type discriminator"
        },
        "data": {
          "type": "string",
          "description": "Base64-encoded content",
          "contentEncoding": "base64"
        },
        "mimeType": {
          "type": "string",
          "description": "MIME type of the inline data"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        }
      },
      "required": [
        "type",
        "data",
        "mimeType"
      ],
      "additionalProperties": false,
      "description": "Blob attachment with inline base64-encoded data",
      "title": "PushAttachmentBlob"
    },
    "PushAttachmentDirectory": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "directory",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute directory path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "Directory attachment",
      "title": "PushAttachmentDirectory"
    },
    "PushAttachmentFile": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "file",
          "description": "Attachment type discriminator"
        },
        "path": {
          "type": "string",
          "description": "Absolute file path"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the attachment"
        },
        "lineRange": {
          "$ref": "#/definitions/PushAttachmentFileLineRange",
          "description": "Optional line range to scope the attachment to a specific section of the file"
        }
      },
      "required": [
        "type",
        "path",
        "displayName"
      ],
      "additionalProperties": false,
      "description": "File attachment",
      "title": "PushAttachmentFile"
    },
    "PushAttachmentFileLineRange": {
      "type": "object",
      "properties": {
        "start": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Start line number (1-based)"
        },
        "end": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "End line number (1-based, inclusive)"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Optional line range to scope the attachment to a specific section of the file",
      "title": "PushAttachmentFileLineRange"
    },
    "PushAttachmentGitHubActionsJob": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_actions_job",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the workflow run belongs to"
        },
        "jobId": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Job id within the workflow run"
        },
        "jobName": {
          "type": "string",
          "description": "Display name of the job"
        },
        "workflowName": {
          "type": "string",
          "description": "Display name of the workflow the job ran in"
        },
        "url": {
          "type": "string",
          "description": "URL to the job on GitHub"
        },
        "conclusion": {
          "type": "string",
          "description": "Terminal conclusion of the job when finished (e.g., success, failure, cancelled). Absent for in-progress jobs."
        }
      },
      "required": [
        "type",
        "repo",
        "jobId",
        "jobName",
        "workflowName",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub Actions job.",
      "title": "PushAttachmentGitHubActionsJob"
    },
    "PushAttachmentGitHubCommit": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_commit",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the commit belongs to"
        },
        "oid": {
          "type": "string",
          "description": "Full commit SHA"
        },
        "message": {
          "type": "string",
          "description": "First line of the commit message"
        },
        "url": {
          "type": "string",
          "description": "URL to the commit on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "oid",
        "message",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub commit.",
      "title": "PushAttachmentGitHubCommit"
    },
    "PushAttachmentGitHubFile": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_file",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref the file is read at (branch, tag, or commit SHA)"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        },
        "url": {
          "type": "string",
          "description": "URL to the file on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "ref",
        "path",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a file in a GitHub repository at a specific ref.",
      "title": "PushAttachmentGitHubFile"
    },
    "PushAttachmentGitHubFileDiff": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_file_diff",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the diff on GitHub (e.g., a commit, compare, or PR-file URL)"
        },
        "head": {
          "$ref": "#/definitions/PushAttachmentGitHubFileDiffSide",
          "description": "File location on the head side of the diff. Absent for deletions."
        },
        "base": {
          "$ref": "#/definitions/PushAttachmentGitHubFileDiffSide",
          "description": "File location on the base side of the diff. Absent for additions."
        }
      },
      "required": [
        "type",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a single-file diff. At least one of `head` and `base` must be present.",
      "title": "PushAttachmentGitHubFileDiff"
    },
    "PushAttachmentGitHubFileDiffSide": {
      "type": "object",
      "properties": {
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref (branch, tag, or commit SHA) the file is read at"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        }
      },
      "required": [
        "repo",
        "ref",
        "path"
      ],
      "additionalProperties": false,
      "description": "One side of a file diff (head or base)",
      "title": "PushAttachmentGitHubFileDiffSide"
    },
    "PushAttachmentGitHubReference": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_reference",
          "description": "Attachment type discriminator"
        },
        "number": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Issue, pull request, or discussion number"
        },
        "title": {
          "type": "string",
          "description": "Title of the referenced item"
        },
        "referenceType": {
          "$ref": "#/definitions/PushAttachmentGitHubReferenceType",
          "description": "Type of GitHub reference"
        },
        "state": {
          "type": "string",
          "description": "Current state of the referenced item (e.g., open, closed, merged)"
        },
        "url": {
          "type": "string",
          "description": "URL to the referenced item on GitHub"
        }
      },
      "required": [
        "type",
        "number",
        "title",
        "referenceType",
        "state",
        "url"
      ],
      "additionalProperties": false,
      "description": "GitHub issue, pull request, or discussion reference",
      "title": "PushAttachmentGitHubReference"
    },
    "PushAttachmentGitHubReferenceType": {
      "type": "string",
      "enum": [
        "issue",
        "pr",
        "discussion"
      ],
      "description": "Type of GitHub reference",
      "title": "PushAttachmentGitHubReferenceType",
      "x-enumDescriptions": {
        "issue": "GitHub issue reference.",
        "pr": "GitHub pull request reference.",
        "discussion": "GitHub discussion reference."
      }
    },
    "PushAttachmentGitHubRelease": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_release",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the release belongs to"
        },
        "tagName": {
          "type": "string",
          "description": "Git tag the release is anchored to"
        },
        "name": {
          "type": "string",
          "description": "Human-readable release name"
        },
        "url": {
          "type": "string",
          "description": "URL to the release on GitHub"
        }
      },
      "required": [
        "type",
        "repo",
        "tagName",
        "name",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub release.",
      "title": "PushAttachmentGitHubRelease"
    },
    "PushAttachmentGitHubRepository": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_repository",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository pointer"
        },
        "url": {
          "type": "string",
          "description": "URL to the repository on GitHub"
        },
        "description": {
          "type": "string",
          "description": "Short description of the repository"
        },
        "ref": {
          "type": "string",
          "description": "Git ref this attachment is anchored at (branch, tag, or commit). When absent the default branch is implied."
        }
      },
      "required": [
        "type",
        "repo",
        "url"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub repository.",
      "title": "PushAttachmentGitHubRepository"
    },
    "PushAttachmentGitHubSnippet": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_snippet",
          "description": "Attachment type discriminator"
        },
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the file lives in"
        },
        "ref": {
          "type": "string",
          "description": "Git ref the file is read at (branch, tag, or commit SHA)"
        },
        "path": {
          "type": "string",
          "description": "Repository-relative path to the file"
        },
        "url": {
          "type": "string",
          "description": "URL to the snippet on GitHub (with line anchor)"
        },
        "lineRange": {
          "$ref": "#/definitions/PushAttachmentFileLineRange",
          "description": "Line range the snippet covers"
        }
      },
      "required": [
        "type",
        "repo",
        "ref",
        "path",
        "url",
        "lineRange"
      ],
      "additionalProperties": false,
      "description": "Pointer to a line range inside a file in a GitHub repository.",
      "title": "PushAttachmentGitHubSnippet"
    },
    "PushAttachmentGitHubTreeComparison": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_tree_comparison",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the comparison on GitHub"
        },
        "base": {
          "$ref": "#/definitions/PushAttachmentGitHubTreeComparisonSide",
          "description": "Base side of the comparison"
        },
        "head": {
          "$ref": "#/definitions/PushAttachmentGitHubTreeComparisonSide",
          "description": "Head side of the comparison"
        }
      },
      "required": [
        "type",
        "url",
        "base",
        "head"
      ],
      "additionalProperties": false,
      "description": "Pointer to a comparison between two git revisions.",
      "title": "PushAttachmentGitHubTreeComparison"
    },
    "PushAttachmentGitHubTreeComparisonSide": {
      "type": "object",
      "properties": {
        "repo": {
          "$ref": "#/definitions/PushGitHubRepoRef",
          "description": "Repository the revision belongs to"
        },
        "revision": {
          "type": "string",
          "description": "Git revision (branch, tag, or commit SHA)"
        }
      },
      "required": [
        "repo",
        "revision"
      ],
      "additionalProperties": false,
      "description": "One side of a tree comparison (head or base)",
      "title": "PushAttachmentGitHubTreeComparisonSide"
    },
    "PushAttachmentGitHubUrl": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "github_url",
          "description": "Attachment type discriminator"
        },
        "url": {
          "type": "string",
          "description": "URL to the GitHub resource"
        }
      },
      "required": [
        "type",
        "url"
      ],
      "additionalProperties": false,
      "description": "Generic GitHub URL reference.",
      "title": "PushAttachmentGitHubUrl"
    },
    "PushAttachmentSelection": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "selection",
          "description": "Attachment type discriminator"
        },
        "filePath": {
          "type": "string",
          "description": "Absolute path to the file containing the selection"
        },
        "displayName": {
          "type": "string",
          "description": "User-facing display name for the selection"
        },
        "text": {
          "type": "string",
          "description": "The selected text content"
        },
        "selection": {
          "$ref": "#/definitions/PushAttachmentSelectionDetails",
          "description": "Position range of the selection within the file"
        }
      },
      "required": [
        "type",
        "filePath",
        "displayName",
        "text",
        "selection"
      ],
      "additionalProperties": false,
      "description": "Code selection attachment from an editor",
      "title": "PushAttachmentSelection"
    },
    "PushAttachmentSelectionDetails": {
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/definitions/PushAttachmentSelectionDetailsStart",
          "description": "Start position of the selection"
        },
        "end": {
          "$ref": "#/definitions/PushAttachmentSelectionDetailsEnd",
          "description": "End position of the selection"
        }
      },
      "required": [
        "start",
        "end"
      ],
      "additionalProperties": false,
      "description": "Position range of the selection within the file",
      "title": "PushAttachmentSelectionDetails"
    },
    "PushAttachmentSelectionDetailsEnd": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "End line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "End character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "End position of the selection",
      "title": "PushAttachmentSelectionDetailsEnd"
    },
    "PushAttachmentSelectionDetailsStart": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "minimum": 0,
          "description": "Start line number (0-based)"
        },
        "character": {
          "type": "integer",
          "minimum": 0,
          "description": "Start character offset within the line (0-based)"
        }
      },
      "required": [
        "line",
        "character"
      ],
      "additionalProperties": false,
      "description": "Start position of the selection",
      "title": "PushAttachmentSelectionDetailsStart"
    },
    "PushGitHubRepoRef": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Numeric GitHub repository id"
        },
        "name": {
          "type": "string",
          "description": "Repository name (without owner)"
        },
        "owner": {
          "type": "string",
          "description": "Repository owner login (user or organization)"
        }
      },
      "required": [
        "name",
        "owner"
      ],
      "additionalProperties": false,
      "description": "Pointer to a GitHub repository.",
      "title": "PushGitHubRepoRef"
    },
    "QueueBeginDeferredIdleDrainRequest": {
      "type": "object",
      "properties": {
        "activeBackgroundWork": {
          "type": "boolean",
          "description": "Whether the host still has active background work."
        }
      },
      "required": [
        "activeBackgroundWork"
      ],
      "additionalProperties": false,
      "description": "Inputs for starting a deferred-idle drain.",
      "title": "QueueBeginDeferredIdleDrainRequest",
      "stability": "experimental"
    },
    "QueueBeginDeferredIdleDrainResult": {
      "type": "object",
      "properties": {
        "shouldDrain": {
          "type": "boolean",
          "description": "True when the host should run finishDeferredIdleDrain asynchronously."
        }
      },
      "required": [
        "shouldDrain"
      ],
      "additionalProperties": false,
      "description": "Whether a deferred-idle drain should run.",
      "title": "QueueBeginDeferredIdleDrainResult",
      "stability": "experimental"
    },
    "QueueConsumeSystemNotificationsRequest": {
      "type": "object",
      "properties": {
        "filter": {
          "description": "Opaque runtime-owned filter object.",
          "x-opaque-json": true
        }
      },
      "required": [
        "filter"
      ],
      "additionalProperties": false,
      "description": "Internal filter for consuming queued system notifications.",
      "title": "QueueConsumeSystemNotificationsRequest",
      "stability": "experimental"
    },
    "QueuedCommandHandled": {
      "type": "object",
      "properties": {
        "handled": {
          "type": "boolean",
          "const": true,
          "description": "The host actually executed the queued command."
        },
        "stopProcessingQueue": {
          "type": "boolean",
          "description": "When true, the runtime will not process subsequent queued commands until a new request comes in."
        }
      },
      "required": [
        "handled"
      ],
      "additionalProperties": false,
      "description": "Queued-command response indicating the host executed the command, with an optional flag to stop queue processing.",
      "title": "QueuedCommandHandled"
    },
    "QueuedCommandNotHandled": {
      "type": "object",
      "properties": {
        "handled": {
          "type": "boolean",
          "const": false,
          "description": "The host did not execute the queued command. Unblocks the queue without claiming the command was processed (e.g. when the handler threw before completing)."
        }
      },
      "required": [
        "handled"
      ],
      "additionalProperties": false,
      "description": "Queued-command response indicating the host did not execute the command and the queue may continue.",
      "title": "QueuedCommandNotHandled"
    },
    "QueuedCommandResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/QueuedCommandHandled",
          "description": "Queued-command response indicating the host executed the command, with an optional flag to stop queue processing."
        },
        {
          "$ref": "#/definitions/QueuedCommandNotHandled",
          "description": "Queued-command response indicating the host did not execute the command and the queue may continue."
        }
      ],
      "description": "Result of the queued command execution.",
      "title": "QueuedCommandResult"
    },
    "QueueDeferSessionIdleRequest": {
      "type": "object",
      "properties": {
        "aborted": {
          "type": "boolean",
          "description": "Whether the deferred idle was caused by an aborted foreground turn."
        }
      },
      "required": [
        "aborted"
      ],
      "additionalProperties": false,
      "description": "Inputs for marking session.idle deferred in native state.",
      "title": "QueueDeferSessionIdleRequest",
      "stability": "experimental"
    },
    "QueueDuplicateAtRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque ID of the queued item to duplicate."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Parameters for duplicating a queued item.",
      "title": "QueueDuplicateAtRequest",
      "stability": "experimental"
    },
    "QueueDuplicateAtResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Fresh stable opaque id assigned to the duplicate."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Result of duplicating a queued item.",
      "title": "QueueDuplicateAtResult"
    },
    "QueueEnqueueResumePendingResult": {
      "type": "object",
      "properties": {
        "queued": {
          "type": "boolean",
          "description": "True when a wake item was newly queued."
        }
      },
      "required": [
        "queued"
      ],
      "additionalProperties": false,
      "description": "Result of enqueueing the resume-pending wake item.",
      "title": "QueueEnqueueResumePendingResult"
    },
    "QueueFinishDeferredIdleDrainRequest": {
      "type": "object",
      "properties": {
        "activeBackgroundWork": {
          "type": "boolean",
          "description": "Whether the host still has active background work."
        },
        "hasPending": {
          "type": "boolean",
          "description": "Whether native queued work remains."
        }
      },
      "required": [
        "activeBackgroundWork",
        "hasPending"
      ],
      "additionalProperties": false,
      "description": "Inputs for completing a deferred-idle drain.",
      "title": "QueueFinishDeferredIdleDrainRequest",
      "stability": "experimental"
    },
    "QueueFinishDeferredIdleDrainResult": {
      "type": "object",
      "properties": {
        "action": {
          "type": "string",
          "description": "One of none, processQueue, or emitSessionIdle."
        },
        "aborted": {
          "type": "boolean",
          "description": "Whether the deferred idle was caused by an aborted foreground turn."
        }
      },
      "required": [
        "action",
        "aborted"
      ],
      "additionalProperties": false,
      "description": "Action selected by the native deferred-idle drain.",
      "title": "QueueFinishDeferredIdleDrainResult",
      "stability": "experimental"
    },
    "QueueHasPendingResult": {
      "type": "object",
      "properties": {
        "hasPending": {
          "type": "boolean",
          "description": "True when queued or immediate native work is pending."
        }
      },
      "required": [
        "hasPending"
      ],
      "additionalProperties": false,
      "description": "Whether the native queue has pending work.",
      "title": "QueueHasPendingResult"
    },
    "QueueInsertAtRequest": {
      "type": "object",
      "properties": {
        "position": {
          "type": "integer",
          "description": "Zero-based position in the public visible queue. Values outside the queue clamp to an end."
        },
        "message": {
          "$ref": "#/definitions/QueueInsertMessage",
          "description": "Queued message contents and delivery metadata."
        }
      },
      "required": [
        "position",
        "message"
      ],
      "additionalProperties": false,
      "description": "Parameters for inserting a queued message at a public visible position.",
      "title": "QueueInsertAtRequest",
      "stability": "experimental"
    },
    "QueueInsertAtResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Fresh stable opaque id assigned to the inserted item."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Result of inserting a queued message.",
      "title": "QueueInsertAtResult"
    },
    "QueueInsertMessage": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "The user message text."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional user-facing display text."
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attachment",
            "description": "A user message attachment — a file, directory, code selection, blob, GitHub-anchored pointer, or extension-supplied context payload"
          },
          "description": "Optional attachments for the message."
        },
        "agentMode": {
          "$ref": "#/definitions/SendAgentMode",
          "description": "Optional explicit agent mode. When omitted, the session's current mode is assigned."
        },
        "source": {
          "type": "string",
          "description": "Optional provenance source. `system` is rejected: it would hide the inserted row from `pendingItems` and make it unaddressable while still executing, so inserted items must stay visible."
        },
        "billable": {
          "type": "boolean",
          "description": "Whether the message is billable."
        },
        "requiredTool": {
          "type": "string",
          "description": "Required tool name for the turn, when any."
        },
        "requestHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Per-turn request headers."
        },
        "mode": {
          "$ref": "#/definitions/SendMode",
          "description": "Accepted for SendOptions compatibility but ignored; inserted items always use queued delivery semantics."
        },
        "prepend": {
          "type": "boolean",
          "description": "Accepted for SendOptions compatibility but ignored; the requested public position controls placement."
        },
        "wait": {
          "type": "boolean",
          "description": "Accepted for SendOptions compatibility but ignored; insertion scheduling is controlled by the queue drain state."
        },
        "delivery": {
          "type": "string",
          "description": "Accepted for internal SendOptions compatibility but ignored; delivery is derived from current session activity."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Serializable message fields accepted by queue.insertAt.",
      "title": "QueueInsertMessage"
    },
    "QueueMoveItemRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque queued-item id."
        },
        "toPosition": {
          "type": "integer",
          "description": "Zero-based target position in the public visible queue. Values outside the queue clamp to an end."
        }
      },
      "required": [
        "id",
        "toPosition"
      ],
      "additionalProperties": false,
      "description": "Parameters for moving a queued item by stable id.",
      "title": "QueueMoveItemRequest",
      "stability": "experimental"
    },
    "QueueMoveItemResult": {
      "type": "object",
      "properties": {
        "changed": {
          "type": "boolean",
          "description": "True when the item changed position; false when it was already at the requested position."
        }
      },
      "required": [
        "changed"
      ],
      "additionalProperties": false,
      "description": "Result of moving a queued item.",
      "title": "QueueMoveItemResult"
    },
    "QueuePendingItems": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque id for the canonical queued item. Batch rows share one id."
        },
        "messageId": {
          "type": "string",
          "description": "Stable identity of the queued user message. Present for message rows and absent for slash commands and model changes."
        },
        "kind": {
          "$ref": "#/definitions/QueuePendingItemsKind",
          "description": "Whether this item is a queued user message or a queued slash command / model change"
        },
        "displayText": {
          "type": "string",
          "description": "Human-readable text to display for this queue entry in the UI"
        },
        "agentMode": {
          "$ref": "#/definitions/SendAgentMode",
          "description": "Agent mode stored on this queued entry, as stamped when it was enqueued. Items without an explicit mode report interactive. This is not necessarily the mode that will constrain the turn: a plan or autopilot session applies its own write gate, continuation loop and permission posture to every drained item regardless of the mode stored here."
        }
      },
      "required": [
        "id",
        "kind",
        "displayText",
        "agentMode"
      ],
      "additionalProperties": false,
      "description": "User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change.",
      "title": "QueuePendingItems"
    },
    "QueuePendingItemsKind": {
      "type": "string",
      "enum": [
        "message",
        "command"
      ],
      "description": "Whether this item is a queued user message or a queued slash command / model change",
      "title": "QueuePendingItemsKind",
      "x-enumDescriptions": {
        "message": "A queued user message.",
        "command": "A queued slash command or model-change command."
      }
    },
    "QueuePendingItemsResult": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/QueuePendingItems",
            "description": "User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change."
          },
          "description": "Pending queued items in submission order. Includes user messages, queued slash commands, and queued model changes; omits internal system items."
        },
        "steeringMessages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Display text for messages currently in the immediate steering queue (interjections sent during a running turn)."
        },
        "inFlightSteeringCount": {
          "type": "integer",
          "minimum": 0,
          "description": "How many leading entries of `steeringMessages` have already been folded into the running turn (and so have an emitted `user.message`), as opposed to still waiting for one. Absent for hosts that do not distinguish the two."
        }
      },
      "required": [
        "items",
        "steeringMessages"
      ],
      "additionalProperties": false,
      "description": "Snapshot of the session's pending queued items and immediate-steering messages.",
      "title": "QueuePendingItemsResult"
    },
    "QueueRemoveAtRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque ID of the queued item to remove."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Parameters for removing a queued item by stable id.",
      "title": "QueueRemoveAtRequest",
      "stability": "experimental"
    },
    "QueueRemoveAtResult": {
      "type": "object",
      "properties": {
        "removed": {
          "type": "boolean",
          "description": "True when the addressed item was removed."
        }
      },
      "required": [
        "removed"
      ],
      "additionalProperties": false,
      "description": "Result of removing a queued item.",
      "title": "QueueRemoveAtResult"
    },
    "QueueRemoveMostRecentResult": {
      "type": "object",
      "properties": {
        "removed": {
          "type": "boolean",
          "description": "True if a user-facing pending item was removed (LIFO across both queues); false when no removable items remained."
        }
      },
      "required": [
        "removed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether a user-facing pending item was removed.",
      "title": "QueueRemoveMostRecentResult"
    },
    "QueueSendNowRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque ID of the queued item to steer into the live turn."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Parameters for steering a queued message into a live turn.",
      "title": "QueueSendNowRequest",
      "stability": "experimental"
    },
    "QueueSendNowResult": {
      "type": "object",
      "properties": {
        "steered": {
          "type": "boolean",
          "description": "True when the item was accepted into the steering lane; false when no main turn was live."
        }
      },
      "required": [
        "steered"
      ],
      "additionalProperties": false,
      "description": "Result of trying to steer a queued message into a live turn.",
      "title": "QueueSendNowResult"
    },
    "QueueSetDrainPausedRequest": {
      "type": "object",
      "properties": {
        "paused": {
          "type": "boolean",
          "description": "Whether queued-lane draining should be paused."
        }
      },
      "required": [
        "paused"
      ],
      "additionalProperties": false,
      "description": "Parameters for acquiring or releasing the queued-lane drain pause. Acquisition is exclusive and non-idempotent: `paused: true` against an already-paused session fails with `queue_already_paused`. The pause is never released automatically — it is not tied to the caller's lifetime, so a client that exits without sending `paused: false` leaves the lane frozen. Release is unowned: `paused: false` clears the pause for any caller, including one that never acquired it.",
      "title": "QueueSetDrainPausedRequest",
      "stability": "experimental"
    },
    "QueueSnapshotResult": {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/QueuePendingItems",
            "description": "User-facing pending queue entry, with kind and display text for a queued message, slash command, or model change."
          },
          "description": "User-facing pending items in FIFO order."
        },
        "steeringMessages": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Immediate steering messages waiting for an active turn."
        },
        "itemOrders": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Insertion orders for queued items, aligned with `items`."
        },
        "steeringMessageOrders": {
          "type": "array",
          "items": {
            "type": "integer"
          },
          "description": "Insertion orders for immediate steering messages, aligned with `steeringMessages`."
        }
      },
      "required": [
        "items",
        "steeringMessages"
      ],
      "additionalProperties": false,
      "description": "Internal snapshot of native queue state for local session orchestration.",
      "title": "QueueSnapshotResult"
    },
    "QueueUpdateTextRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable opaque ID of the queued item to edit."
        },
        "prompt": {
          "type": "string",
          "description": "Replacement prompt sent to the model."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional replacement prompt displayed to the user."
        }
      },
      "required": [
        "id",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Parameters for editing a single queued message.",
      "title": "QueueUpdateTextRequest",
      "stability": "experimental"
    },
    "QueueUpdateTextResult": {
      "type": "object",
      "properties": {
        "updated": {
          "type": "boolean",
          "description": "True when the stored text changed."
        }
      },
      "required": [
        "updated"
      ],
      "additionalProperties": false,
      "description": "Result of editing a queued message.",
      "title": "QueueUpdateTextResult"
    },
    "ReasoningSummary": {
      "type": "string",
      "enum": [
        "none",
        "concise",
        "detailed"
      ],
      "description": "Reasoning summary mode to request for supported model clients",
      "title": "ReasoningSummary",
      "x-enumDescriptions": {
        "none": "Do not request reasoning summaries from the model.",
        "concise": "Request a concise summary of the model's reasoning.",
        "detailed": "Request a detailed summary of the model's reasoning."
      }
    },
    "RegisterEventInterestParams": {
      "type": "object",
      "properties": {
        "eventType": {
          "type": "string",
          "description": "The event type the consumer wants the runtime to treat as 'observed' for behavior-switching gating. Some runtime code paths inspect whether any consumer is interested in a specific event type and choose a different implementation accordingly (e.g. `mcp.oauth_required`: when interest is registered the runtime delegates interactive OAuth token acquisition to the consumer via `mcp.oauth_required` events; when no interest is registered the runtime still attempts non-interactive reconnect from cached or refreshable tokens, and only marks the server `needs-auth` if usable credentials are unavailable — it does not open a browser or start interactive OAuth without a consumer). SDK clients that long-poll events do NOT automatically appear as listeners to these gating checks — they must explicitly call `registerInterest` for each event type they want the runtime to count as having a consumer. Multiple registrations for the same event type from the same or different consumers are tracked independently and must each be released. See: `mcp.oauth_required`, `sampling.requested`, `auto_mode_switch.requested`, `session_limits_exhausted.requested`, `user_input.requested`, `elicitation.requested`, `command.queued`, `exit_plan_mode.requested`."
        }
      },
      "required": [
        "eventType"
      ],
      "additionalProperties": false,
      "description": "Event type to register consumer interest for, used by runtime gating logic.",
      "title": "RegisterEventInterestParams",
      "stability": "experimental"
    },
    "RegisterEventInterestResult": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "description": "Opaque handle for this registration. Pass to releaseInterest to release. Each call to registerInterest produces a fresh handle, even when the same eventType is registered multiple times."
        }
      },
      "required": [
        "handle"
      ],
      "additionalProperties": false,
      "description": "Opaque handle representing an event-type interest registration.",
      "title": "RegisterEventInterestResult"
    },
    "RegisterExtensionToolsParams": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session to register extension tools on."
        },
        "loader": {
          "description": "In-process ExtensionLoader handle used only by the CLI and excluded from the public SDK surface.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "options": {
          "$ref": "#/definitions/SessionsRegisterExtensionToolsOnSessionOptions",
          "description": "Optional registration options."
        }
      },
      "required": [
        "sessionId",
        "loader"
      ],
      "additionalProperties": false,
      "description": "Params to attach an extension loader's tools to a session.",
      "title": "RegisterExtensionToolsParams",
      "visibility": "internal"
    },
    "RegisterExtensionToolsResult": {
      "type": "object",
      "properties": {
        "unsubscribe": {
          "description": "In-process unsubscribe function used only by the CLI.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "unsubscribe"
      ],
      "additionalProperties": false,
      "description": "Handle for releasing the extension tool registration.",
      "title": "RegisterExtensionToolsResult",
      "visibility": "internal"
    },
    "ReleaseEventInterestParams": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "description": "Handle returned by a previous `registerInterest` call. Idempotent: releasing an unknown or already-released handle is a no-op (returns success). When the last outstanding handle for an event type is released, the runtime reverts to its 'no consumer' code path for that event type."
        }
      },
      "required": [
        "handle"
      ],
      "additionalProperties": false,
      "description": "Opaque handle previously returned by `registerInterest` to release.",
      "title": "ReleaseEventInterestParams",
      "stability": "experimental"
    },
    "RemoteControlConfig": {
      "type": "object",
      "properties": {
        "remote": {
          "type": "boolean",
          "description": "Whether remote export should be enabled."
        },
        "steerable": {
          "type": "boolean",
          "description": "Whether the MC session may steer the local session (write mode)."
        },
        "explicit": {
          "type": "boolean",
          "description": "Whether the user explicitly requested remote (vs. implicit session-sync). Controls warning surfacing for missing-repo cases."
        },
        "silent": {
          "type": "boolean",
          "description": "When true, suppresses timeline messages on successful setup."
        },
        "taskId": {
          "type": "string",
          "description": "Existing Mission Control task ID to attach the exported session to."
        },
        "existingMcSession": {
          "$ref": "#/definitions/RemoteControlConfigExistingMcSession",
          "description": "Reattach to an existing MC session without creating a new one."
        }
      },
      "required": [
        "remote",
        "steerable",
        "explicit",
        "silent"
      ],
      "additionalProperties": false,
      "description": "Configuration for the runtime-managed remote-control singleton.",
      "title": "RemoteControlConfig"
    },
    "RemoteControlConfigExistingMcSession": {
      "type": "object",
      "properties": {
        "mcSessionId": {
          "type": "string",
          "description": "Existing MC session ID to reattach to."
        },
        "mcTaskId": {
          "type": "string",
          "description": "Existing MC task ID for the reattached session."
        }
      },
      "required": [
        "mcSessionId",
        "mcTaskId"
      ],
      "additionalProperties": false,
      "description": "Reattach to an existing MC session without creating a new one.",
      "title": "RemoteControlConfigExistingMcSession"
    },
    "RemoteControlStatus": {
      "anyOf": [
        {
          "$ref": "#/definitions/RemoteControlStatusOff",
          "description": "Remote control is not connected."
        },
        {
          "$ref": "#/definitions/RemoteControlStatusConnecting",
          "description": "Remote control is in the middle of initial setup."
        },
        {
          "$ref": "#/definitions/RemoteControlStatusActive",
          "description": "Remote control is connected to a local session."
        },
        {
          "$ref": "#/definitions/RemoteControlStatusError",
          "description": "The last setup attempt failed. The singleton is otherwise off."
        }
      ],
      "description": "State of the runtime-managed remote-control singleton.",
      "title": "RemoteControlStatus"
    },
    "RemoteControlStatusActive": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "active",
          "description": "Remote control state tag: active."
        },
        "attachedSessionId": {
          "type": "string",
          "description": "Session id remote control is pointed at."
        },
        "frontendUrl": {
          "type": "string",
          "description": "MC frontend URL for this session, when known."
        },
        "isSteerable": {
          "type": "boolean",
          "description": "Whether the MC session may steer this session."
        },
        "promptManager": {
          "description": "In-process prompt-manager handle (CLI-only optimization). Marked internal: this field is excluded from the public SDK surface. Retained as an optional compatibility field; native remote control does not populate or consume it.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "awaitingFirstMessage": {
          "type": "boolean",
          "description": "True while a read-only/session-sync export is deferred, awaiting the first `user.message` before its MC session exists. Marked internal: this field is excluded from the public SDK surface and is populated only on the CLI in-process path.",
          "visibility": "internal"
        }
      },
      "required": [
        "state",
        "attachedSessionId",
        "isSteerable"
      ],
      "additionalProperties": false,
      "description": "Remote control is connected to a local session.",
      "title": "RemoteControlStatusActive"
    },
    "RemoteControlStatusConnecting": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "connecting",
          "description": "Remote control state tag: connecting."
        },
        "attachedSessionId": {
          "type": "string",
          "description": "Session id the connection is attaching to."
        }
      },
      "required": [
        "state",
        "attachedSessionId"
      ],
      "additionalProperties": false,
      "description": "Remote control is in the middle of initial setup.",
      "title": "RemoteControlStatusConnecting"
    },
    "RemoteControlStatusError": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "error",
          "description": "Remote control state tag: setup failed."
        },
        "error": {
          "type": "string",
          "description": "Human-readable error message from the last setup attempt."
        },
        "attachedSessionId": {
          "type": "string",
          "description": "Session id the failing setup attempt targeted, when known."
        }
      },
      "required": [
        "state",
        "error"
      ],
      "additionalProperties": false,
      "description": "The last setup attempt failed. The singleton is otherwise off.",
      "title": "RemoteControlStatusError"
    },
    "RemoteControlStatusOff": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "const": "off",
          "description": "Remote control state tag: not connected."
        }
      },
      "required": [
        "state"
      ],
      "additionalProperties": false,
      "description": "Remote control is not connected.",
      "title": "RemoteControlStatusOff"
    },
    "RemoteControlStatusResult": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/RemoteControlStatus",
          "description": "State of the runtime-managed remote-control singleton."
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false,
      "description": "Wrapper for the singleton's current status.",
      "title": "RemoteControlStatusResult"
    },
    "RemoteControlStopResult": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/RemoteControlStatus",
          "description": "State of the runtime-managed remote-control singleton."
        },
        "stopped": {
          "type": "boolean",
          "description": "Whether the singleton was actually torn down by this call."
        }
      },
      "required": [
        "status",
        "stopped"
      ],
      "additionalProperties": false,
      "description": "Outcome of a stopRemoteControl call.",
      "title": "RemoteControlStopResult"
    },
    "RemoteControlTransferResult": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/RemoteControlStatus",
          "description": "State of the runtime-managed remote-control singleton."
        },
        "transferred": {
          "type": "boolean",
          "description": "Whether the rebinding actually happened."
        }
      },
      "required": [
        "status",
        "transferred"
      ],
      "additionalProperties": false,
      "description": "Outcome of a transferRemoteControl call.",
      "title": "RemoteControlTransferResult"
    },
    "RemoteEnableRequest": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/RemoteSessionMode",
          "description": "Per-session remote mode. \"off\" disables remote, \"export\" exports session events to GitHub without enabling remote steering, \"on\" enables both export and remote steering."
        }
      },
      "additionalProperties": false,
      "description": "Optional remote session mode (\"off\", \"export\", or \"on\"); defaults to enabling both export and remote steering.",
      "title": "RemoteEnableRequest",
      "stability": "experimental"
    },
    "RemoteEnableResult": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "format": "uri",
          "description": "GitHub frontend URL for this session"
        },
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether remote steering is enabled"
        }
      },
      "required": [
        "remoteSteerable"
      ],
      "additionalProperties": false,
      "description": "GitHub URL for the session and a flag indicating whether remote steering is enabled.",
      "title": "RemoteEnableResult"
    },
    "RemoteNotifySteerableChangedRequest": {
      "type": "object",
      "properties": {
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether the session now supports remote steering via GitHub. The runtime persists this as a `session.remote_steerable_changed` event so resume/replay sees the up-to-date capability."
        }
      },
      "required": [
        "remoteSteerable"
      ],
      "additionalProperties": false,
      "description": "New remote-steerability state to persist as a `session.remote_steerable_changed` event.",
      "title": "RemoteNotifySteerableChangedRequest",
      "stability": "experimental"
    },
    "RemoteNotifySteerableChangedResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Persist a steerability change as a `session.remote_steerable_changed` event. Used by the host (CLI / SDK consumer) when it has just finished enabling or disabling steering on a remote exporter that the runtime does not directly own.",
      "title": "RemoteNotifySteerableChangedResult"
    },
    "RemoteSessionConnectionResult": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "SDK session ID for the connected remote session."
        },
        "metadata": {
          "$ref": "#/definitions/ConnectedRemoteSessionMetadata",
          "description": "Metadata for a connected remote session."
        }
      },
      "required": [
        "sessionId",
        "metadata"
      ],
      "additionalProperties": false,
      "description": "Remote session connection result.",
      "title": "RemoteSessionConnectionResult"
    },
    "RemoteSessionHostStatus": {
      "type": "string",
      "enum": [
        "idle",
        "working",
        "input-needed",
        "error"
      ],
      "description": "What a remote host says one of its sessions is doing right now. Deliberately coarse: this is what a host can report for EVERY session in a catalogue listing, without a client subscribing to each one. AHP's `SessionSummary.status` is the source today; `input-needed` covers both a permission prompt and an `ask_user` question, since the summary does not say which.",
      "title": "RemoteSessionHostStatus",
      "x-enumDescriptions": {
        "idle": "No turn is running.",
        "working": "A turn is running.",
        "input-needed": "The session is blocked on the user: a permission prompt or an `ask_user` question.",
        "error": "The session ended its last turn in an error."
      }
    },
    "RemoteSessionMetadataRepository": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "Repository owner."
        },
        "name": {
          "type": "string",
          "description": "Repository name."
        },
        "branch": {
          "type": "string",
          "description": "Branch associated with the remote session."
        }
      },
      "required": [
        "owner",
        "name",
        "branch"
      ],
      "additionalProperties": false,
      "description": "GitHub repository the remote session belongs to.",
      "title": "RemoteSessionMetadataRepository"
    },
    "RemoteSessionMetadataTaskType": {
      "type": "string",
      "enum": [
        "cca",
        "cli"
      ],
      "description": "Whether the remote task originated from CCA or CLI `--remote`.",
      "title": "RemoteSessionMetadataTaskType",
      "x-enumDescriptions": {
        "cca": "GitHub Copilot coding agent task.",
        "cli": "CLI remote task."
      }
    },
    "RemoteSessionMetadataValue": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Stable session identifier."
        },
        "startTime": {
          "type": "string",
          "description": "Session creation time as an ISO 8601 timestamp."
        },
        "modifiedTime": {
          "type": "string",
          "description": "Last-modified time as an ISO 8601 timestamp."
        },
        "summary": {
          "type": "string",
          "description": "Short summary of the session, when one has been derived."
        },
        "name": {
          "type": "string",
          "description": "Optional human-friendly name set via /rename."
        },
        "isRemote": {
          "type": "boolean",
          "const": true,
          "description": "Always true for remote sessions."
        },
        "context": {
          "$ref": "#/definitions/SessionContext",
          "description": "Most recent working directory context."
        },
        "repository": {
          "$ref": "#/definitions/RemoteSessionMetadataRepository",
          "description": "GitHub repository the remote session belongs to."
        },
        "remoteSessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Backing remote session IDs (most recent first)."
        },
        "pullRequestNumber": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Pull request number associated with the session."
        },
        "resourceId": {
          "type": "string",
          "description": "Original remote resource identifier (task ID or PR node ID)."
        },
        "taskType": {
          "$ref": "#/definitions/RemoteSessionMetadataTaskType",
          "description": "Whether the remote task originated from CCA or CLI `--remote`."
        },
        "staleAt": {
          "type": "string",
          "description": "Deadline (ISO 8601) at which a CLI remote session becomes stale without further heartbeats."
        },
        "state": {
          "type": "string",
          "description": "Server-side task state returned by GitHub."
        },
        "hostStatus": {
          "$ref": "#/definitions/RemoteSessionHostStatus",
          "description": "Live status as the owning host reports it in its session listing, so a row for a session running elsewhere can show that it is running. Absent for hosts that publish no such status (the cloud task managers), which read as idle."
        },
        "hostActivity": {
          "type": "string",
          "description": "Host-supplied human description of what the session is doing right now (\"running tests\", \"waiting for approval\"). Optional in the protocol and absent on hosts that do not publish it, so never rely on it -- it enriches `hostStatus`, it does not replace it."
        }
      },
      "required": [
        "sessionId",
        "startTime",
        "modifiedTime",
        "isRemote",
        "repository",
        "remoteSessionIds"
      ],
      "additionalProperties": false,
      "description": "Remote session metadata for the session to hand off (typically obtained from `sessions.list` with `source: \"remote\"`).",
      "title": "RemoteSessionMetadataValue"
    },
    "RemoteSessionMode": {
      "type": "string",
      "enum": [
        "off",
        "export",
        "on"
      ],
      "description": "Per-session remote mode. \"off\" disables remote, \"export\" exports session events to GitHub without enabling remote steering, \"on\" enables both export and remote steering.",
      "title": "RemoteSessionMode",
      "x-enumDescriptions": {
        "off": "Disable remote session export and steering.",
        "export": "Export session events to GitHub without enabling remote steering.",
        "on": "Enable both remote session export and remote steering."
      }
    },
    "RemoteSessionRepository": {
      "type": "object",
      "properties": {
        "owner": {
          "type": "string",
          "description": "Repository owner or organization login."
        },
        "name": {
          "type": "string",
          "description": "Repository name."
        },
        "branch": {
          "type": "string",
          "description": "Optional branch associated with the remote session."
        }
      },
      "required": [
        "owner",
        "name"
      ],
      "additionalProperties": false,
      "description": "Repository context for the remote session.",
      "title": "RemoteSessionRepository"
    },
    "RunOptions": {
      "type": "object",
      "properties": {
        "limits": {
          "$ref": "#/definitions/FactoryRunLimits",
          "description": "Per-invocation resource ceiling overrides."
        },
        "notifyOnComplete": {
          "type": "boolean",
          "description": "Whether to notify the originating session when the factory completes."
        },
        "logPhaseNames": {
          "type": "boolean",
          "description": "Whether to emit factory phase names to the session transcript."
        },
        "resumeFromRunId": {
          "type": "string",
          "description": "Run identifier whose journal and progress should seed this resumed run."
        }
      },
      "additionalProperties": false,
      "description": "Options controlling factory invocation.",
      "title": "RunOptions",
      "stability": "experimental"
    },
    "SandboxConfig": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether sandboxing is enabled for the session."
        },
        "userPolicy": {
          "$ref": "#/definitions/SandboxConfigUserPolicy",
          "description": "User-managed sandbox policy fragment merged into the auto-discovered base policy."
        },
        "addCurrentWorkingDirectory": {
          "type": "boolean",
          "description": "Whether to auto-add the current working directory to readwritePaths. Default: true."
        },
        "auth": {
          "$ref": "#/definitions/SandboxConfigAuth",
          "description": "Credential-injection capability flags."
        },
        "allowDevToolAccess": {
          "type": "boolean",
          "description": "Whether to auto-grant read access to tool directories discovered on PATH and in toolchain environment variables (GOROOT, JAVA_HOME, VIRTUAL_ENV, and similar), and to common developer-tool caches, config, and toolchains. Writable grants cover scratch caches, the Unix GitHub CLI cache, and Cargo's registry, git store, and lock/tracker files. A relocated CARGO_HOME gets the same narrow split: registry and git are read-write; bin is read-only; the home root, config.toml, and credentials.toml stay ungranted. Set to false to disable every grant listed above; user-installed toolchains and caches then need explicit userPolicy.filesystem readonlyPaths and readwritePaths entries. The working directory (see addCurrentWorkingDirectory), temporary storage, session log paths, and system locations follow their own rules and stay granted. Default: true (enabled by default; set to false to opt out)."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Resolved sandbox configuration.",
      "title": "SandboxConfig",
      "stability": "experimental"
    },
    "SandboxConfigAuth": {
      "type": "object",
      "properties": {
        "git": {
          "type": "boolean",
          "description": "Whether to inject git credentials as an `http.<url>.extraheader` so authenticated HTTPS git works inside the sandbox without the shell-based credential helper the sandbox blocks. github.com is served by the Copilot token; every other forge (Azure DevOps, GitHub Enterprise Server, GitLab, ...) by a credential the host resolves from the user's own helper before the sandbox is applied. Default: false (opt-in)."
        },
        "gh": {
          "type": "boolean",
          "description": "Whether to export `GH_TOKEN` so the `gh` CLI authenticates inside the sandbox without the OS keyring the sandbox blocks. Default: false (opt-in)."
        }
      },
      "additionalProperties": false,
      "description": "Credential-injection capability flags applied while the sandbox is enabled. For the same capability independent of sandboxing, and matched to the credential's GitHub host, see `shell.credentials`; the two are additive.",
      "title": "SandboxConfigAuth"
    },
    "SandboxConfigSource": {
      "type": "string",
      "enum": [
        "never_configured",
        "user_enabled",
        "user_disabled",
        "session_flag",
        "session_disabled",
        "unsupported_host",
        "repository_policy"
      ],
      "description": "Origin of the sandbox choice supplied by an internal client.",
      "title": "SandboxConfigSource",
      "visibility": "internal",
      "x-enumDescriptions": {
        "never_configured": "The client applied the default because no sandbox preference was configured.",
        "user_enabled": "The user's persisted settings enabled the sandbox.",
        "user_disabled": "The user's persisted settings disabled the sandbox.",
        "session_flag": "A command-line flag selected the sandbox state for this session.",
        "session_disabled": "The user disabled the sandbox for the current session.",
        "unsupported_host": "The client disabled the sandbox because the host cannot enforce it.",
        "repository_policy": "A repository policy selected the sandbox state."
      }
    },
    "SandboxConfigUserPolicy": {
      "type": "object",
      "properties": {
        "filesystem": {
          "$ref": "#/definitions/SandboxConfigUserPolicyFilesystem",
          "description": "Filesystem rules to merge into the base policy."
        },
        "network": {
          "$ref": "#/definitions/SandboxConfigUserPolicyNetwork",
          "description": "Network rules to merge into the base policy."
        },
        "seatbelt": {
          "$ref": "#/definitions/SandboxConfigUserPolicySeatbelt",
          "description": "macOS seatbelt options to merge into the base policy."
        },
        "experimental": {
          "$ref": "#/definitions/SandboxConfigUserPolicyExperimental",
          "description": "Deprecated legacy location for `seatbelt`; read only when the top-level `seatbelt` is absent."
        }
      },
      "additionalProperties": false,
      "description": "User-managed sandbox policy fragment merged into the auto-discovered base policy.",
      "title": "SandboxConfigUserPolicy"
    },
    "SandboxConfigUserPolicyExperimental": {
      "type": "object",
      "properties": {
        "seatbelt": {
          "$ref": "#/definitions/SandboxConfigUserPolicyExperimentalSeatbelt",
          "description": "macOS seatbelt experimental options."
        }
      },
      "additionalProperties": false,
      "description": "Platform-specific experimental policy fields.",
      "title": "SandboxConfigUserPolicyExperimental"
    },
    "SandboxConfigUserPolicyExperimentalSeatbelt": {
      "type": "object",
      "properties": {
        "keychainAccess": {
          "type": "boolean",
          "description": "Whether the macOS seatbelt profile may access the keychain."
        }
      },
      "additionalProperties": false,
      "description": "macOS seatbelt experimental options.",
      "title": "SandboxConfigUserPolicyExperimentalSeatbelt"
    },
    "SandboxConfigUserPolicyFilesystem": {
      "type": "object",
      "properties": {
        "readwritePaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Paths granted read/write access."
        },
        "readonlyPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Paths granted read-only access."
        },
        "deniedPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Paths explicitly denied."
        },
        "clearPolicyOnExit": {
          "type": "boolean",
          "description": "Whether to clear the policy when the session exits."
        }
      },
      "additionalProperties": false,
      "description": "Filesystem rules to merge into the base policy.",
      "title": "SandboxConfigUserPolicyFilesystem"
    },
    "SandboxConfigUserPolicyNetwork": {
      "type": "object",
      "properties": {
        "allowOutbound": {
          "type": "boolean",
          "description": "Whether outbound network traffic is allowed at all."
        },
        "allowLocalNetwork": {
          "type": "boolean",
          "description": "Whether traffic to local/loopback addresses is allowed."
        },
        "proxy": {
          "$ref": "#/definitions/SandboxConfigUserPolicyNetworkProxy",
          "description": "HTTP proxy for sandboxed process traffic. Linux restricts egress to the proxy endpoint, requires that endpoint to be reachable over IPv4 (the [::] dual-stack wildcard is accepted and routed through the IPv4 gateway), and does not support proxy credentials. macOS relies on applications honoring proxy environment variables. Windows also configures a per-AppContainer WinHTTP proxy, but enforcement depends on the application's networking stack. Configure supported credentials in the separate `username` and `password` fields. A credential-free http:// loopback URL uses the localhost proxy form, while an https:// or authenticated loopback URL uses the URL form."
        }
      },
      "additionalProperties": false,
      "description": "Network rules to merge into the base policy.",
      "title": "SandboxConfigUserPolicyNetwork"
    },
    "SandboxConfigUserPolicyNetworkProxy": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "description": "Proxy URL (e.g. http://proxy.example.com:8080). The port is optional and defaults to the scheme's standard port when omitted; an explicit port must be between 1 and 65535. Credentials must not be embedded here — a `user:pass@` authority is rejected; put them in the separate `username`/`password` fields. A credential-free http:// loopback proxy URL is routed through the localhost proxy automatically; loopback covers localhost and any *.localhost subdomain, the whole 127.0.0.0/8 range, ::1, and IPv4-mapped loopback (::ffff:127.0.0.1). An https:// URL, or one with a username/password set, is used as-is."
        },
        "username": {
          "type": "string",
          "description": "Optional username for proxy authentication. Combined with the URL (and `password`) into `user:pass@host` when the sandboxed process routes through the proxy."
        },
        "password": {
          "type": "string",
          "description": "Optional password for proxy authentication, combined with the URL at spawn time. The persisted value may be a literal password, a `${secret:…}` reference resolved from the OS keychain, or a `${VAR}`/`$VAR` environment reference; it is resolved just before the sandboxed process routes through the proxy. The /sandbox dialog stores a real password in the OS keychain and persists only a `${secret:…}` placeholder (never plaintext in settings.json); the field is masked in the dialog and redacted by /settings show."
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false,
      "description": "HTTP proxy configuration for sandboxed traffic.",
      "title": "SandboxConfigUserPolicyNetworkProxy"
    },
    "SandboxConfigUserPolicySeatbelt": {
      "type": "object",
      "properties": {
        "keychainAccess": {
          "type": "boolean",
          "description": "Whether the macOS seatbelt profile may access the keychain."
        }
      },
      "additionalProperties": false,
      "description": "macOS seatbelt-specific options.",
      "title": "SandboxConfigUserPolicySeatbelt"
    },
    "SandboxEnforcementStatus": {
      "type": "object",
      "properties": {
        "required": {
          "type": "boolean",
          "description": "Whether the effective managed policy requires an available sandbox backend."
        },
        "blocked": {
          "type": "boolean",
          "description": "Whether an enforcement failure has permanently blocked the session."
        },
        "reason": {
          "type": "string",
          "description": "The first sandbox enforcement failure that blocked the session."
        }
      },
      "required": [
        "required",
        "blocked"
      ],
      "additionalProperties": false,
      "description": "Managed sandbox enforcement state for a session.",
      "title": "SandboxEnforcementStatus"
    },
    "ScheduleAddAtRequest": {
      "type": "object",
      "properties": {
        "at": {
          "type": "integer",
          "description": "Epoch milliseconds when the prompt should fire."
        },
        "prompt": {
          "type": "string",
          "description": "Prompt text to enqueue when the schedule fires."
        },
        "recurring": {
          "type": "boolean",
          "description": "Whether the schedule should re-arm after each tick. Defaults to false."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional display-only prompt label."
        }
      },
      "required": [
        "at",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Register an absolute-time scheduled prompt.",
      "title": "ScheduleAddAtRequest",
      "stability": "experimental"
    },
    "ScheduleAddCronRequest": {
      "type": "object",
      "properties": {
        "cron": {
          "type": "string",
          "description": "5-field cron expression."
        },
        "prompt": {
          "type": "string",
          "description": "Prompt text to enqueue when the schedule fires."
        },
        "recurring": {
          "type": "boolean",
          "description": "Whether the schedule should re-arm after each tick. Defaults to true."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional display-only prompt label."
        },
        "tz": {
          "type": "string",
          "description": "IANA timezone for evaluating the cron expression."
        }
      },
      "required": [
        "cron",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Register a cron scheduled prompt.",
      "title": "ScheduleAddCronRequest",
      "stability": "experimental"
    },
    "ScheduleAddRequest": {
      "type": "object",
      "properties": {
        "interval": {
          "type": "string",
          "description": "Human-readable interval such as `30s`, `5m`, or `2h`."
        },
        "prompt": {
          "type": "string",
          "description": "Prompt text to enqueue when the schedule fires."
        },
        "recurring": {
          "type": "boolean",
          "description": "Whether the schedule should re-arm after each tick. Defaults to true."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional display-only prompt label."
        }
      },
      "required": [
        "interval",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Register a relative-interval scheduled prompt.",
      "title": "ScheduleAddRequest",
      "stability": "experimental"
    },
    "ScheduleAddResult": {
      "type": "object",
      "properties": {
        "entry": {
          "$ref": "#/definitions/ScheduleEntry",
          "description": "The registered or updated schedule entry."
        },
        "error": {
          "type": "string",
          "description": "User-facing validation error, when registration failed."
        }
      },
      "additionalProperties": false,
      "description": "Result of registering or re-arming a scheduled prompt.",
      "title": "ScheduleAddResult"
    },
    "ScheduleAddSelfPacedRequest": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "Prompt text to enqueue when the schedule fires."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Optional display-only prompt label."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Register a self-paced scheduled prompt.",
      "title": "ScheduleAddSelfPacedRequest",
      "stability": "experimental"
    },
    "ScheduleEntry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Sequential id assigned by the runtime within the session. Stable across resumes (rebuilt from the event log)."
        },
        "intervalMs": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "format": "duration",
          "description": "Interval between scheduled ticks, in milliseconds (relative-interval schedules)."
        },
        "cron": {
          "type": "string",
          "description": "5-field cron expression for a recurring calendar schedule, evaluated in `tz`."
        },
        "tz": {
          "type": "string",
          "description": "IANA timezone the `cron` expression is evaluated in."
        },
        "at": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Absolute fire time (epoch milliseconds) for a one-shot calendar schedule."
        },
        "prompt": {
          "type": "string",
          "description": "Prompt text that gets enqueued on every tick."
        },
        "recurring": {
          "type": "boolean",
          "description": "Whether the schedule re-arms after each tick (`/every`) or fires once (`/after`)."
        },
        "selfPaced": {
          "type": "boolean",
          "description": "True for a self-paced (`dynamic`) schedule: no fixed cadence; the model arms each next run via the `manage_schedule` `wakeup` action. `nextRunAt` is model-controlled."
        },
        "displayPrompt": {
          "type": "string",
          "description": "Display-only label for the prompt as shown in the UI (e.g. `/skill-name` for a skill-invocation schedule). The actual enqueued prompt is `prompt`."
        },
        "nextRunAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the next tick is scheduled to fire."
        }
      },
      "required": [
        "id",
        "prompt",
        "recurring",
        "nextRunAt"
      ],
      "additionalProperties": false,
      "description": "Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time.",
      "title": "ScheduleEntry"
    },
    "ScheduleHasSelfPacedResult": {
      "type": "object",
      "properties": {
        "hasSelfPaced": {
          "type": "boolean",
          "description": "True when at least one active schedule is self-paced."
        }
      },
      "required": [
        "hasSelfPaced"
      ],
      "additionalProperties": false,
      "description": "Whether the session currently has an active self-paced schedule.",
      "title": "ScheduleHasSelfPacedResult"
    },
    "ScheduleList": {
      "type": "object",
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ScheduleEntry",
            "description": "Scheduled prompt entry with ID, timing (`intervalMs`, `cron`, or `at`), prompt text, recurrence, and next run time."
          },
          "description": "Active scheduled prompts, ordered by id."
        }
      },
      "required": [
        "entries"
      ],
      "additionalProperties": false,
      "description": "Snapshot of the currently active recurring prompts for this session.",
      "title": "ScheduleList"
    },
    "ScheduleRearmSelfPacedRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Id of the self-paced scheduled prompt."
        },
        "at": {
          "type": "integer",
          "description": "Epoch milliseconds when the prompt should next fire."
        }
      },
      "required": [
        "id",
        "at"
      ],
      "additionalProperties": false,
      "description": "Re-arm a self-paced scheduled prompt.",
      "title": "ScheduleRearmSelfPacedRequest",
      "stability": "experimental"
    },
    "ScheduleStopRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "description": "Id of the scheduled prompt to remove."
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Identifier of the scheduled prompt to remove.",
      "title": "ScheduleStopRequest",
      "stability": "experimental"
    },
    "ScheduleStopResult": {
      "type": "object",
      "properties": {
        "entry": {
          "$ref": "#/definitions/ScheduleEntry",
          "description": "The removed entry, or omitted if no entry matched."
        }
      },
      "additionalProperties": false,
      "description": "Remove a scheduled prompt by id. The result entry is omitted if the id was unknown.",
      "title": "ScheduleStopResult"
    },
    "SecretsAddFilterValuesRequest": {
      "type": "object",
      "properties": {
        "values": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Raw secret values to register for redaction"
        }
      },
      "required": [
        "values"
      ],
      "additionalProperties": false,
      "description": "Secret values to add to the redaction filter.",
      "title": "SecretsAddFilterValuesRequest"
    },
    "SecretsAddFilterValuesResult": {
      "type": "object",
      "properties": {
        "ok": {
          "type": "boolean",
          "const": true,
          "description": "Whether the values were successfully registered"
        }
      },
      "required": [
        "ok"
      ],
      "additionalProperties": false,
      "description": "Confirmation that the secret values were registered.",
      "title": "SecretsAddFilterValuesResult"
    },
    "SendAgentMode": {
      "type": "string",
      "enum": [
        "interactive",
        "plan",
        "autopilot",
        "shell"
      ],
      "description": "The UI mode the agent was in when this message was sent. Defaults to the session's current mode.",
      "title": "SendAgentMode",
      "x-enumDescriptions": {
        "interactive": "The agent is responding interactively to the user.",
        "plan": "The agent is preparing a plan before making changes.",
        "autopilot": "The agent is working autonomously toward task completion.",
        "shell": "The agent is in shell-focused UI mode."
      }
    },
    "SendAttachmentsToMessageParams": {
      "type": "object",
      "properties": {
        "instanceId": {
          "type": "string",
          "description": "Optional canvas instance binding the push for provenance. When supplied, the runtime resolves the canvas, verifies it is owned by the calling extension, and stamps canvasId/instanceId onto each extension_context entry. When omitted, no resolution runs and those fields stay unset on the attachment."
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/PushAttachment",
            "description": "Attachment union accepted by push input, covering files, directories, GitHub objects, blobs, snippets, and extension context."
          },
          "description": "Attachments to push into the next user-message turn. extension_context entries take the slim shape; standard variants take their full AttachmentSchema shape."
        }
      },
      "required": [
        "attachments"
      ],
      "additionalProperties": false,
      "description": "Parameters for session.extensions.sendAttachmentsToMessage.",
      "title": "SendAttachmentsToMessageParams",
      "stability": "experimental"
    },
    "SendMessageItem": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "The user message text"
        },
        "displayPrompt": {
          "type": "string",
          "description": "If provided, this is shown in the timeline instead of `prompt`"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attachment",
            "description": "A user message attachment — a file, directory, code selection, blob, GitHub-anchored pointer, or extension-supplied context payload"
          },
          "description": "Optional attachments (files, directories, selections, blobs, GitHub references) to include with this message"
        },
        "billable": {
          "type": "boolean",
          "description": "If false, this message will not trigger a Premium Request Unit charge. User messages default to billable.",
          "visibility": "internal"
        },
        "requiredTool": {
          "type": "string",
          "description": "If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange"
        },
        "source": {
          "type": "string",
          "pattern": "^(user|system|command-.*|schedule-\\d+|agent-.+)$",
          "description": "Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent.",
          "visibility": "internal"
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "description": "A single user message to append to the session as part of a `session.sendMessages` turn",
      "title": "SendMessageItem"
    },
    "SendMessagesRequest": {
      "type": "object",
      "properties": {
        "messages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SendMessageItem",
            "description": "A single user message to append to the session as part of a `session.sendMessages` turn"
          },
          "description": "The user messages to append to the conversation, in order. May be empty, in which case a single turn runs over the existing history with no new user message."
        },
        "mode": {
          "$ref": "#/definitions/SendMode",
          "description": "How to deliver the messages. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn."
        },
        "prepend": {
          "type": "boolean",
          "description": "If true, adds the messages to the front of the queue instead of the end"
        },
        "agentMode": {
          "$ref": "#/definitions/SendAgentMode",
          "description": "The UI mode the agent was in when these messages were sent. Defaults to the session's current mode."
        },
        "requestHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key."
        },
        "traceparent": {
          "type": "string",
          "description": "W3C Trace Context traceparent header for distributed tracing of this agent turn"
        },
        "tracestate": {
          "type": "string",
          "description": "W3C Trace Context tracestate header for distributed tracing"
        },
        "wait": {
          "type": "boolean",
          "description": "If true, await completion of the agentic loop for this turn before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageIds`; the caller can rely on the agent having processed the messages before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly."
        }
      },
      "required": [
        "messages"
      ],
      "additionalProperties": false,
      "description": "Parameters for sending zero or more user messages to the session in a single turn. Remote-backed (Mission Control) sessions do not support this method and will return an error.",
      "title": "SendMessagesRequest",
      "stability": "experimental"
    },
    "SendMessagesResult": {
      "type": "object",
      "properties": {
        "messageIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Unique identifiers assigned to the messages, one per provided message in order. Empty when no messages were provided."
        }
      },
      "required": [
        "messageIds"
      ],
      "additionalProperties": false,
      "description": "Result of sending zero or more user messages",
      "title": "SendMessagesResult"
    },
    "SendMode": {
      "type": "string",
      "enum": [
        "enqueue",
        "immediate"
      ],
      "description": "How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn.",
      "title": "SendMode",
      "x-enumDescriptions": {
        "enqueue": "Append the message to the normal session queue.",
        "immediate": "Interject the message during the in-progress turn."
      }
    },
    "SendRequest": {
      "type": "object",
      "properties": {
        "prompt": {
          "type": "string",
          "description": "The user message text"
        },
        "displayPrompt": {
          "type": "string",
          "description": "If provided, this is shown in the timeline instead of `prompt`"
        },
        "attachments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Attachment",
            "description": "A user message attachment — a file, directory, code selection, blob, GitHub-anchored pointer, or extension-supplied context payload"
          },
          "description": "Optional attachments (files, directories, selections, blobs, GitHub references) to include with the message"
        },
        "mode": {
          "$ref": "#/definitions/SendMode",
          "description": "How to deliver the message. `enqueue` (default) appends to the message queue. `immediate` interjects during an in-progress turn."
        },
        "prepend": {
          "type": "boolean",
          "description": "If true, adds the message to the front of the queue instead of the end"
        },
        "billable": {
          "type": "boolean",
          "description": "If false, this message will not trigger a Premium Request Unit charge. User messages default to billable."
        },
        "requiredTool": {
          "type": "string",
          "description": "If set, the request will fail if the named tool is not available when this message is among the user messages at the start of the current exchange"
        },
        "source": {
          "type": "string",
          "pattern": "^(user|system|command-.*|schedule-\\d+|agent-.+)$",
          "description": "Optional provenance tag copied to the resulting user.message event. Must be `user`, `system`, `command-<command-id>` for command-originated messages, `schedule-<numeric-id>` for scheduled prompts, or `agent-<agent-id>` for prompts sent by another agent.",
          "visibility": "internal"
        },
        "agentMode": {
          "$ref": "#/definitions/SendAgentMode",
          "description": "The UI mode the agent was in when this message was sent. Defaults to the session's current mode."
        },
        "requestHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Custom HTTP headers to include in outbound model requests for this turn. Merged with session-level provider headers; per-turn headers augment and overwrite session-level headers with the same key."
        },
        "traceparent": {
          "type": "string",
          "description": "W3C Trace Context traceparent header for distributed tracing of this agent turn"
        },
        "tracestate": {
          "type": "string",
          "description": "W3C Trace Context tracestate header for distributed tracing"
        },
        "wait": {
          "type": "boolean",
          "description": "If true, await completion of the agentic loop for this message before returning. Defaults to false (fire-and-forget). When true, the result still contains the same `messageId`; the caller can rely on the agent having processed the message before the call resolves. Transport-dependent tail semantics: on a LOCAL (in-process) session the wait additionally blocks until the completed turn's event tail has been dispatched to this session's in-process subscribers, so a subsequent read of subscriber state already reflects the turn; on a REMOTE session the wait resolves once the loop completes and mirrored delivery follows over the wire. Callers that need the stronger local guarantee on remote sessions should await the event stream explicitly."
        }
      },
      "required": [
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Parameters for sending a user message to the session",
      "title": "SendRequest",
      "stability": "experimental"
    },
    "SendResult": {
      "type": "object",
      "properties": {
        "messageId": {
          "type": "string",
          "description": "Unique identifier assigned to the message"
        }
      },
      "required": [
        "messageId"
      ],
      "additionalProperties": false,
      "description": "Result of sending a user message",
      "title": "SendResult"
    },
    "SendSystemNotificationRequest": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Notification text to deliver to the model."
        },
        "kind": {
          "description": "Optional structured notification kind.",
          "x-opaque-json": true
        },
        "options": {
          "description": "Internal delivery options, including passive policy.",
          "x-opaque-json": true
        }
      },
      "required": [
        "message"
      ],
      "additionalProperties": false,
      "description": "Internal request for sending a system notification.",
      "title": "SendSystemNotificationRequest",
      "stability": "experimental"
    },
    "ServerAgentList": {
      "type": "object",
      "properties": {
        "agents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/AgentInfo",
            "description": "Agent metadata, including identifiers, display details, source, tools, model, models, MCP servers, skills, and file path."
          },
          "description": "All discovered agents across all sources"
        }
      },
      "required": [
        "agents"
      ],
      "additionalProperties": false,
      "description": "Agents discovered across user, project, plugin, and remote sources.",
      "title": "ServerAgentList"
    },
    "ServerInstructionSourceList": {
      "type": "object",
      "properties": {
        "sources": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstructionSource",
            "description": "Loaded instruction source for a session, including path, content, category, location, applicability, and optional description."
          },
          "description": "All discovered instruction sources"
        }
      },
      "required": [
        "sources"
      ],
      "additionalProperties": false,
      "description": "Instruction sources discovered across user, repository, and plugin sources.",
      "title": "ServerInstructionSourceList"
    },
    "ServerSkill": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique identifier for the skill"
        },
        "commandName": {
          "type": "string",
          "description": "Canonical slash command name used to invoke the skill, without the leading '/'"
        },
        "description": {
          "type": "string",
          "description": "Description of what the skill does"
        },
        "source": {
          "$ref": "#/definitions/SkillSource",
          "description": "Source location type (e.g., project, personal-copilot, plugin, builtin)"
        },
        "userInvocable": {
          "type": "boolean",
          "description": "Whether the skill can be invoked by the user as a slash command"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the skill is currently enabled (based on global config)"
        },
        "path": {
          "type": "string",
          "description": "Absolute path to the skill file"
        },
        "projectPath": {
          "type": "string",
          "description": "The project path this skill belongs to (only for project/inherited skills)"
        },
        "argumentHint": {
          "type": "string",
          "description": "Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field"
        }
      },
      "required": [
        "name",
        "description",
        "source",
        "userInvocable",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Server-side skill metadata, including name, description, source, enabled/invocable state, path, project path, and argument hint.",
      "title": "ServerSkill"
    },
    "ServerSkillList": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ServerSkill",
            "description": "Server-side skill metadata, including name, description, source, enabled/invocable state, path, project path, and argument hint."
          },
          "description": "All discovered skills across all sources"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Messages for skills that failed to load (e.g. malformed SKILL.md). Empty when host skills are excluded so host-local paths are not disclosed to multitenant callers."
        }
      },
      "required": [
        "skills"
      ],
      "additionalProperties": false,
      "description": "Skills discovered across global and project sources.",
      "title": "ServerSkillList"
    },
    "SessionActivity": {
      "type": "object",
      "properties": {
        "abortable": {
          "type": "boolean",
          "description": "Whether an in-flight operation can currently be aborted."
        },
        "hasActiveWork": {
          "type": "boolean",
          "description": "Whether the session currently has active work, including running turns or tasks."
        }
      },
      "required": [
        "abortable",
        "hasActiveWork"
      ],
      "additionalProperties": false,
      "description": "Current activity flags for the session.",
      "title": "SessionActivity"
    },
    "SessionAuthInfoResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/AuthIdentity",
          "description": "Credential-free authentication identity safe to expose to hosts and user interfaces."
        },
        {
          "type": "null"
        }
      ],
      "description": "Current authentication information, or null when no authentication is active.",
      "title": "SessionAuthInfoResult"
    },
    "SessionAuthLoginRequest": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "description": "GitHub host URL"
        },
        "login": {
          "type": "string",
          "description": "GitHub login"
        },
        "token": {
          "type": "string",
          "description": "GitHub authentication token"
        },
        "persist": {
          "type": "boolean",
          "description": "Whether to persist the token after login"
        }
      },
      "required": [
        "host",
        "login",
        "token"
      ],
      "additionalProperties": false,
      "description": "Internal GitHub login parameters.",
      "title": "SessionAuthLoginRequest",
      "stability": "experimental"
    },
    "SessionAuthLogoutUserRequest": {
      "type": "object",
      "properties": {
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Authentication information to log out"
        }
      },
      "required": [
        "authInfo"
      ],
      "additionalProperties": false,
      "description": "Parameters identifying a GitHub authentication to log out.",
      "title": "SessionAuthLogoutUserRequest",
      "stability": "experimental"
    },
    "SessionAuthStatus": {
      "type": "object",
      "properties": {
        "isAuthenticated": {
          "type": "boolean",
          "description": "Whether the session has resolved authentication"
        },
        "authType": {
          "$ref": "#/definitions/AuthInfoType",
          "description": "Authentication type"
        },
        "host": {
          "type": "string",
          "format": "uri",
          "description": "Authentication host URL"
        },
        "login": {
          "type": "string",
          "description": "Authenticated login/username, if available"
        },
        "statusMessage": {
          "type": "string",
          "description": "Human-readable authentication status description"
        },
        "copilotPlan": {
          "type": "string",
          "description": "Copilot plan tier (e.g., individual_pro, business)"
        }
      },
      "required": [
        "isAuthenticated"
      ],
      "additionalProperties": false,
      "description": "Authentication status and account metadata for the session.",
      "title": "SessionAuthStatus"
    },
    "SessionAuthSwitchRequest": {
      "type": "object",
      "properties": {
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Authentication information to activate"
        },
        "token": {
          "type": "string",
          "description": "Optional token paired with the authentication information"
        }
      },
      "required": [
        "authInfo"
      ],
      "additionalProperties": false,
      "description": "Parameters for switching the session's active authentication.",
      "title": "SessionAuthSwitchRequest",
      "stability": "experimental"
    },
    "SessionBulkDeleteResult": {
      "type": "object",
      "properties": {
        "freedBytes": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          },
          "description": "Map of sessionId -> bytes freed by removing the session's workspace directory. Sessions whose deletion failed are omitted from this map (failures are logged on the server but not surfaced per-id; check the map for absent IDs to detect them)."
        }
      },
      "required": [
        "freedBytes"
      ],
      "additionalProperties": false,
      "description": "Map of sessionId -> bytes freed by removing the session's workspace directory.",
      "title": "SessionBulkDeleteResult"
    },
    "SessionCapability": {
      "type": "string",
      "enum": [
        "tui-hints",
        "plan-mode",
        "memory",
        "cli-documentation",
        "ask-user",
        "interactive-mode",
        "system-notifications",
        "elicitation",
        "session-store",
        "mcp-apps",
        "canvas-renderer"
      ],
      "description": "Session capability enabled for this session",
      "title": "SessionCapability",
      "x-enumDescriptions": {
        "tui-hints": "TUI-specific prompt hints such as keyboard shortcuts.",
        "plan-mode": "Plan-mode handling and instructions.",
        "memory": "Memory tool and memories prompt section.",
        "cli-documentation": "Copilot CLI documentation tool and prompt section.",
        "ask-user": "Interactive ask_user tool support.",
        "interactive-mode": "Interactive CLI identity and behavior.",
        "system-notifications": "Automatic hidden system notifications.",
        "elicitation": "SDK elicitation support.",
        "session-store": "Cross-session history tools and session-store SQL prompt/tool metadata.",
        "mcp-apps": "MCP Apps UI passthrough.",
        "canvas-renderer": "Host-provided canvas rendering support."
      }
    },
    "SessionCompletionItem": {
      "type": "object",
      "properties": {
        "insertText": {
          "type": "string",
          "description": "Text spliced into the composer when the item is accepted."
        },
        "rangeStart": {
          "type": "integer",
          "minimum": 0,
          "description": "Start of the replacement range in `text`, in UTF-16 code units."
        },
        "rangeEnd": {
          "type": "integer",
          "minimum": 0,
          "description": "End (exclusive) of the replacement range in `text`, in UTF-16 code units."
        },
        "label": {
          "type": "string",
          "description": "Primary display label for the picker row. Falls back to `insertText` when absent."
        },
        "kind": {
          "type": "string",
          "description": "Render-kind hint for the picker row (e.g. `\"document\"`, `\"directory\"`), derived from the host's display kind."
        }
      },
      "required": [
        "insertText"
      ],
      "additionalProperties": false,
      "description": "A single host-driven completion. Accepting an item replaces `[rangeStart, rangeEnd)` (UTF-16 code units) in the composer with `insertText`; when the range is absent, the active token around the cursor is replaced.",
      "title": "SessionCompletionItem"
    },
    "SessionContext": {
      "type": "object",
      "properties": {
        "cwd": {
          "type": "string",
          "description": "Most recent working directory for this session"
        },
        "gitRoot": {
          "type": "string",
          "description": "Git repository root, if the cwd was inside a git repo"
        },
        "repository": {
          "type": "string",
          "description": "Repository slug in `owner/name` form, when known"
        },
        "hostType": {
          "$ref": "#/definitions/SessionContextHostType",
          "description": "Repository host type"
        },
        "branch": {
          "type": "string",
          "description": "Active git branch"
        }
      },
      "required": [
        "cwd"
      ],
      "additionalProperties": false,
      "description": "Pre-resolved working-directory context for session startup.",
      "title": "SessionContext"
    },
    "SessionContextAttribution": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "totalTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Total token count of the current context window the entries are measured against (system message + conversation messages + tool definitions — the same total reported by /context). Divide an entry's `tokens` by this to derive its share."
            },
            "modelId": {
              "type": "string",
              "description": "The concrete model id the entire breakdown was tokenized against (feeds the per-model token multiplier). Under `Auto` (Free/Student) this is the resolved model, not the literal `auto` sentinel, so totals are not undercounted. A single-model approximation of a potentially multi-model Auto session."
            },
            "modelSource": {
              "type": "string",
              "description": "How `modelId` was chosen. Not a closed set — tolerate unknown values. Known values today: `autoResolved` (the model Auto resolved to), `selected` (the user's explicitly selected model), `default` (a fallback before any model is known)."
            },
            "promptTokenLimit": {
              "type": "integer",
              "minimum": 0,
              "description": "Maximum prompt tokens the resolved model accepts — the denominator for a `##k/###k` context-usage display. Mirrors `SessionContextInfo.promptTokenLimit`."
            },
            "limit": {
              "type": "integer",
              "minimum": 0,
              "description": "Prompt limit plus the model's output reserve: the full context window `categories.freeSpace` and `categories.buffer` are measured against. Mirrors `SessionContextInfo.limit`."
            },
            "bufferTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Output reserve plus the tokens past the buffer-exhaustion blocking threshold. Mirrors `SessionContextInfo.bufferTokens`."
            },
            "compactionThreshold": {
              "type": "integer",
              "minimum": 0,
              "description": "Token count at which background compaction starts. Mirrors `SessionContextInfo.compactionThreshold`."
            },
            "categories": {
              "type": "object",
              "properties": {
                "systemPrompt": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "System prompt tokens, excluding custom instructions."
                },
                "customInstructions": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Custom-instructions tokens (0 when none are configured)."
                },
                "systemTools": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Non-MCP tool-definition tokens."
                },
                "mcpTools": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "MCP tool-definition tokens."
                },
                "messages": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Conversation (user/assistant/tool) message tokens."
                },
                "freeSpace": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Remaining unused window capacity (clamped at 0)."
                },
                "buffer": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Output reserve plus post-blocking-threshold buffer."
                }
              },
              "required": [
                "systemPrompt",
                "customInstructions",
                "systemTools",
                "mcpTools",
                "messages",
                "freeSpace",
                "buffer"
              ],
              "additionalProperties": false,
              "description": "The six normalized `/context` header buckets, computed from the same tokenization as `entries` so the two never disagree. Convenience rollups: `freeSpace` and `buffer` describe window capacity rather than occupied context, so the values do not sum to `totalTokens`."
            },
            "entries": {
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "kind": {
                    "type": "string",
                    "description": "Source category for this entry. Not a closed set — tolerate unknown values. Known values today: `skill`, `subagent`, `mcpServer`, `tool`, `system`, `toolDefinition`, `plugin`."
                  },
                  "id": {
                    "type": "string",
                    "description": "Identifier for this entry, formed by joining its `kind` and source name (e.g. `tool:bash`, `skill:tmux`, `toolDefinition:bash`); unique within the snapshot. Use it to match the same entry across snapshots, to correlate with other APIs (skill/agent/MCP registries), and as the `parentId` target for nesting. Distinct from the human-facing `label`."
                  },
                  "label": {
                    "type": "string",
                    "description": "Human-readable display label, e.g. `bash` or `skill: tmux`. Presentation-only; may be localized/reformatted without notice — do not key off it."
                  },
                  "tokens": {
                    "type": "integer",
                    "minimum": 0,
                    "description": "Token count currently in context attributable to this entry."
                  },
                  "parentId": {
                    "type": "string",
                    "description": "Optional `id` of the parent entry: e.g. a `plugin` entry parenting its `skill`/`mcpServer` entries, or the `system` entry parenting `toolDefinition` entries. Omitted for top-level entries."
                  },
                  "attributes": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "Supplementary per-entry metadata (e.g. `messageCount`, `role`, `evictable`, `pluginSource`). Values are stringified; parse as needed and ignore unrecognized keys."
                  }
                },
                "required": [
                  "kind",
                  "id",
                  "label",
                  "tokens"
                ],
                "additionalProperties": false
              },
              "description": "Flat list of per-source attribution entries. Group by `kind` and render unrecognized kinds generically. Nesting and rollups are expressed via `parentId`."
            },
            "compactions": {
              "type": "object",
              "properties": {
                "count": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Number of successful compactions in this session."
                }
              },
              "required": [
                "count"
              ],
              "additionalProperties": false,
              "description": "Successful compaction history for the session."
            }
          },
          "required": [
            "totalTokens",
            "modelId",
            "modelSource",
            "promptTokenLimit",
            "limit",
            "bufferTokens",
            "compactionThreshold",
            "categories",
            "entries",
            "compactions"
          ],
          "additionalProperties": false,
          "description": "Per-source token attribution snapshot for the current context window. The heaviest individual messages are available separately via `metadata.getContextHeaviestMessages`."
        },
        {
          "type": "null"
        }
      ],
      "description": "Per-source context-window attribution, or null if the session has not yet been initialized (no system prompt or tool metadata cached).",
      "title": "SessionContextAttribution"
    },
    "SessionContextHostType": {
      "type": "string",
      "enum": [
        "github",
        "ado"
      ],
      "description": "Repository host type",
      "title": "SessionContextHostType",
      "x-enumDescriptions": {
        "github": "Session repository is hosted on GitHub.",
        "ado": "Session repository is hosted on Azure DevOps."
      }
    },
    "SessionContextInfo": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "modelName": {
              "type": "string",
              "description": "The model used for token counting"
            },
            "systemTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Tokens consumed by the system prompt"
            },
            "conversationTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Tokens consumed by user/assistant/tool messages"
            },
            "toolDefinitionsTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Tokens consumed by tool definitions sent to the model (excludes deferred tools)"
            },
            "mcpToolsTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools)"
            },
            "totalTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Sum of system, conversation and tool-definition tokens"
            },
            "promptTokenLimit": {
              "type": "integer",
              "minimum": 0,
              "description": "Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified)"
            },
            "compactionThreshold": {
              "type": "integer",
              "minimum": 0,
              "description": "Token count at which background compaction starts (configurable percentage of promptTokenLimit)"
            },
            "limit": {
              "type": "integer",
              "minimum": 0,
              "description": "Prompt token limit plus the model's full output token limit."
            },
            "bufferTokens": {
              "type": "integer",
              "minimum": 0,
              "description": "Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%)"
            }
          },
          "required": [
            "modelName",
            "systemTokens",
            "conversationTokens",
            "toolDefinitionsTokens",
            "mcpToolsTokens",
            "totalTokens",
            "promptTokenLimit",
            "compactionThreshold",
            "limit",
            "bufferTokens"
          ],
          "additionalProperties": false,
          "description": "Token-usage breakdown for the session's current context window"
        },
        {
          "type": "null"
        }
      ],
      "description": "Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached).",
      "title": "SessionContextInfo"
    },
    "SessionEnrichMetadataResult": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LocalSessionMetadataValue",
            "description": "Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID."
          },
          "description": "Enriched records, with summary and context backfilled. Sessions confirmed empty and unnamed may be omitted."
        }
      },
      "required": [
        "sessions"
      ],
      "additionalProperties": false,
      "description": "The enriched metadata records, with summary and context fields backfilled where available. Sessions confirmed empty and unnamed are omitted.",
      "title": "SessionEnrichMetadataResult"
    },
    "SessionFsAppendFileRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        },
        "content": {
          "type": "string",
          "description": "Content to append"
        },
        "mode": {
          "type": "integer",
          "minimum": 0,
          "description": "Optional POSIX-style mode for newly created files"
        }
      },
      "required": [
        "path",
        "content"
      ],
      "additionalProperties": false,
      "description": "File path, content to append, and optional mode for the client-provided session filesystem.",
      "title": "SessionFsAppendFileRequest",
      "stability": "experimental"
    },
    "SessionFsError": {
      "type": "object",
      "properties": {
        "code": {
          "$ref": "#/definitions/SessionFsErrorCode",
          "description": "Error classification"
        },
        "message": {
          "type": "string",
          "description": "Free-form detail about the error, for logging/diagnostics"
        }
      },
      "required": [
        "code"
      ],
      "additionalProperties": false,
      "description": "Describes a filesystem error.",
      "title": "SessionFsError"
    },
    "SessionFsErrorCode": {
      "type": "string",
      "enum": [
        "ENOENT",
        "UNKNOWN"
      ],
      "description": "Error classification",
      "title": "SessionFsErrorCode",
      "x-enumDescriptions": {
        "ENOENT": "The requested path does not exist.",
        "UNKNOWN": "The filesystem operation failed for an unspecified reason."
      }
    },
    "SessionFsExistsRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path to test for existence in the client-provided session filesystem.",
      "title": "SessionFsExistsRequest",
      "stability": "experimental"
    },
    "SessionFsExistsResult": {
      "type": "object",
      "properties": {
        "exists": {
          "type": "boolean",
          "description": "Whether the path exists"
        }
      },
      "required": [
        "exists"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the requested path exists in the client-provided session filesystem.",
      "title": "SessionFsExistsResult"
    },
    "SessionFsMkdirRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        },
        "recursive": {
          "type": "boolean",
          "description": "Create parent directories as needed"
        },
        "mode": {
          "type": "integer",
          "minimum": 0,
          "description": "Optional POSIX-style mode for newly created directories"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Directory path to create in the client-provided session filesystem, with options for recursive creation and POSIX mode.",
      "title": "SessionFsMkdirRequest",
      "stability": "experimental"
    },
    "SessionFsReaddirRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Directory path whose entries should be listed from the client-provided session filesystem.",
      "title": "SessionFsReaddirRequest",
      "stability": "experimental"
    },
    "SessionFsReaddirResult": {
      "type": "object",
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Entry names in the directory"
        },
        "error": {
          "$ref": "#/definitions/SessionFsError",
          "description": "Describes a filesystem error."
        }
      },
      "required": [
        "entries"
      ],
      "additionalProperties": false,
      "description": "Names of entries in the requested directory, or a filesystem error if the read failed.",
      "title": "SessionFsReaddirResult"
    },
    "SessionFsReaddirWithTypesEntry": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Entry name"
        },
        "type": {
          "$ref": "#/definitions/SessionFsReaddirWithTypesEntryType",
          "description": "Entry type"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "Directory entry returned by session filesystem `readdirWithTypes`, with name and entry type.",
      "title": "SessionFsReaddirWithTypesEntry"
    },
    "SessionFsReaddirWithTypesEntryType": {
      "type": "string",
      "enum": [
        "file",
        "directory"
      ],
      "description": "Entry type",
      "title": "SessionFsReaddirWithTypesEntryType",
      "x-enumDescriptions": {
        "file": "The entry is a file.",
        "directory": "The entry is a directory."
      }
    },
    "SessionFsReaddirWithTypesRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Directory path whose entries (with type information) should be listed from the client-provided session filesystem.",
      "title": "SessionFsReaddirWithTypesRequest",
      "stability": "experimental"
    },
    "SessionFsReaddirWithTypesResult": {
      "type": "object",
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionFsReaddirWithTypesEntry",
            "description": "Directory entry returned by session filesystem `readdirWithTypes`, with name and entry type."
          },
          "description": "Directory entries with type information"
        },
        "error": {
          "$ref": "#/definitions/SessionFsError",
          "description": "Describes a filesystem error."
        }
      },
      "required": [
        "entries"
      ],
      "additionalProperties": false,
      "description": "Entries in the requested directory paired with file/directory type information, or a filesystem error if the read failed.",
      "title": "SessionFsReaddirWithTypesResult"
    },
    "SessionFsReadFileRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path of the file to read from the client-provided session filesystem.",
      "title": "SessionFsReadFileRequest",
      "stability": "experimental"
    },
    "SessionFsReadFileResult": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "File content as UTF-8 string"
        },
        "error": {
          "$ref": "#/definitions/SessionFsError",
          "description": "Describes a filesystem error."
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "File content as a UTF-8 string, or a filesystem error if the read failed.",
      "title": "SessionFsReadFileResult"
    },
    "SessionFsRenameRequest": {
      "type": "object",
      "properties": {
        "src": {
          "type": "string",
          "description": "Source path using SessionFs conventions"
        },
        "dest": {
          "type": "string",
          "description": "Destination path using SessionFs conventions"
        }
      },
      "required": [
        "src",
        "dest"
      ],
      "additionalProperties": false,
      "description": "Source and destination paths for renaming or moving an entry in the client-provided session filesystem.",
      "title": "SessionFsRenameRequest",
      "stability": "experimental"
    },
    "SessionFsRmRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        },
        "recursive": {
          "type": "boolean",
          "description": "Remove directories and their contents recursively"
        },
        "force": {
          "type": "boolean",
          "description": "Ignore errors if the path does not exist"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path to remove from the client-provided session filesystem, with options for recursive removal and force.",
      "title": "SessionFsRmRequest",
      "stability": "experimental"
    },
    "SessionFsSetProviderCapabilities": {
      "type": "object",
      "properties": {
        "sqlite": {
          "type": "boolean",
          "description": "Whether the provider supports SQLite query/exists operations"
        }
      },
      "additionalProperties": false,
      "description": "Optional capabilities declared by the provider",
      "title": "SessionFsSetProviderCapabilities"
    },
    "SessionFsSetProviderConventions": {
      "type": "string",
      "enum": [
        "windows",
        "posix"
      ],
      "description": "Path conventions used by this filesystem",
      "title": "SessionFsSetProviderConventions",
      "x-enumDescriptions": {
        "windows": "Paths use Windows path conventions.",
        "posix": "Paths use POSIX path conventions."
      }
    },
    "SessionFsSetProviderRequest": {
      "type": "object",
      "properties": {
        "initialCwd": {
          "type": "string",
          "description": "Initial working directory for sessions"
        },
        "sessionStatePath": {
          "type": "string",
          "description": "Path within each session's SessionFs where the runtime stores files for that session"
        },
        "conventions": {
          "$ref": "#/definitions/SessionFsSetProviderConventions",
          "description": "Path conventions used by this filesystem"
        },
        "capabilities": {
          "$ref": "#/definitions/SessionFsSetProviderCapabilities",
          "description": "Optional capabilities declared by the provider"
        }
      },
      "required": [
        "initialCwd",
        "sessionStatePath",
        "conventions"
      ],
      "additionalProperties": false,
      "description": "Initial working directory, session-state path layout, and path conventions used to register the calling SDK client as the session filesystem provider.",
      "title": "SessionFsSetProviderRequest"
    },
    "SessionFsSetProviderResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the provider was set successfully"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the calling client was registered as the session filesystem provider.",
      "title": "SessionFsSetProviderResult"
    },
    "SessionFsSqliteExistsResult": {
      "type": "object",
      "properties": {
        "exists": {
          "type": "boolean",
          "description": "Whether the session database already exists"
        }
      },
      "required": [
        "exists"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the per-session SQLite database already exists.",
      "title": "SessionFsSqliteExistsResult"
    },
    "SessionFsSqliteQueryRequest": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "SQL query to execute"
        },
        "queryType": {
          "$ref": "#/definitions/SessionFsSqliteQueryType",
          "description": "How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected)"
        },
        "params": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Optional named bind parameters"
        }
      },
      "required": [
        "query",
        "queryType"
      ],
      "additionalProperties": false,
      "description": "SQL query, query type, and optional bind parameters for executing a SQLite query against the per-session database. The provider applies its SQLite busy timeout for every call.",
      "title": "SessionFsSqliteQueryRequest",
      "stability": "experimental"
    },
    "SessionFsSqliteQueryResult": {
      "type": "object",
      "properties": {
        "rows": {
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "x-opaque-json": true
            }
          },
          "description": "For SELECT: array of row objects. For others: empty array."
        },
        "columns": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Column names from the result set"
        },
        "rowsAffected": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of rows affected (for INSERT/UPDATE/DELETE)"
        },
        "lastInsertRowid": {
          "type": "integer",
          "description": "SQLite last_insert_rowid() value for INSERT."
        },
        "error": {
          "$ref": "#/definitions/SessionFsError",
          "description": "Describes a filesystem error."
        }
      },
      "required": [
        "rows",
        "columns",
        "rowsAffected"
      ],
      "additionalProperties": false,
      "description": "Query results including rows, columns, and rows affected, or a filesystem error if execution failed.",
      "title": "SessionFsSqliteQueryResult"
    },
    "SessionFsSqliteQueryType": {
      "type": "string",
      "enum": [
        "exec",
        "query",
        "run"
      ],
      "description": "How to execute the query: 'exec' for DDL/multi-statement (no results), 'query' for SELECT (returns rows), 'run' for INSERT/UPDATE/DELETE (returns rowsAffected)",
      "title": "SessionFsSqliteQueryType",
      "x-enumDescriptions": {
        "exec": "Execute DDL or multi-statement SQL without returning rows.",
        "query": "Execute a SELECT-style query and return rows.",
        "run": "Execute INSERT, UPDATE, or DELETE SQL and return affected-row metadata."
      }
    },
    "SessionFsSqliteTransactionError": {
      "type": "object",
      "properties": {
        "errorClass": {
          "$ref": "#/definitions/SessionFsSqliteTransactionErrorClass",
          "description": "Machine-readable classification of the transaction failure."
        },
        "message": {
          "type": "string",
          "description": "Human-readable transaction failure message."
        }
      },
      "required": [
        "errorClass",
        "message"
      ],
      "additionalProperties": false,
      "description": "Classified SQLite transaction failure. busyOrLocked guarantees rollback; postCommitAmbiguous must never be retried.",
      "title": "SessionFsSqliteTransactionError",
      "stability": "experimental"
    },
    "SessionFsSqliteTransactionErrorClass": {
      "type": "string",
      "enum": [
        "busyOrLocked",
        "fatal",
        "postCommitAmbiguous"
      ],
      "description": "SQLite transaction failure classification.",
      "title": "SessionFsSqliteTransactionErrorClass",
      "x-enumDescriptions": {
        "busyOrLocked": "SQLite reported BUSY or LOCKED before commit; the transaction was rolled back and may be retried.",
        "fatal": "The statement, database, or provider failed definitively and must not be retried automatically.",
        "postCommitAmbiguous": "The transport failed after the provider may have committed; retrying could duplicate effects."
      }
    },
    "SessionFsSqliteTransactionRequest": {
      "type": "object",
      "properties": {
        "statements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionFsSqliteTransactionStatement",
            "description": "One statement in an atomic SQLite transaction."
          },
          "description": "Ordered SQL statements to execute in one transaction."
        }
      },
      "required": [
        "statements"
      ],
      "additionalProperties": false,
      "description": "Statements to execute atomically. Providers apply busy handling for every call.",
      "title": "SessionFsSqliteTransactionRequest",
      "stability": "experimental"
    },
    "SessionFsSqliteTransactionResult": {
      "type": "object",
      "properties": {
        "results": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionFsSqliteQueryResult",
            "description": "Query results including rows, columns, and rows affected, or a filesystem error if execution failed."
          },
          "description": "Per-statement query results in input order."
        },
        "error": {
          "$ref": "#/definitions/SessionFsSqliteTransactionError",
          "description": "Classified transaction failure, when execution did not succeed."
        }
      },
      "required": [
        "results"
      ],
      "additionalProperties": false,
      "description": "Per-statement results, or a classified transaction error.",
      "title": "SessionFsSqliteTransactionResult",
      "stability": "experimental"
    },
    "SessionFsSqliteTransactionStatement": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "SQL statement to execute."
        },
        "queryType": {
          "$ref": "#/definitions/SessionFsSqliteQueryType",
          "description": "How to execute the statement."
        },
        "params": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Optional named bind parameters."
        }
      },
      "required": [
        "query",
        "queryType"
      ],
      "additionalProperties": false,
      "description": "One statement in an atomic SQLite transaction.",
      "title": "SessionFsSqliteTransactionStatement",
      "stability": "experimental"
    },
    "SessionFsStatRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Path whose metadata should be returned from the client-provided session filesystem.",
      "title": "SessionFsStatRequest",
      "stability": "experimental"
    },
    "SessionFsStatResult": {
      "type": "object",
      "properties": {
        "isFile": {
          "type": "boolean",
          "description": "Whether the path is a file"
        },
        "isDirectory": {
          "type": "boolean",
          "description": "Whether the path is a directory"
        },
        "size": {
          "type": "integer",
          "minimum": 0,
          "description": "File size in bytes"
        },
        "mtime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp of last modification"
        },
        "birthtime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp of creation"
        },
        "error": {
          "$ref": "#/definitions/SessionFsError",
          "description": "Describes a filesystem error."
        }
      },
      "required": [
        "isFile",
        "isDirectory",
        "size",
        "mtime",
        "birthtime"
      ],
      "additionalProperties": false,
      "description": "Filesystem metadata for the requested path, or a filesystem error if the stat failed.",
      "title": "SessionFsStatResult"
    },
    "SessionFsWriteFileRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path using SessionFs conventions"
        },
        "content": {
          "type": "string",
          "description": "Content to write"
        },
        "mode": {
          "type": "integer",
          "minimum": 0,
          "description": "Optional POSIX-style mode for newly created files"
        }
      },
      "required": [
        "path",
        "content"
      ],
      "additionalProperties": false,
      "description": "File path, content to write, and optional mode for the client-provided session filesystem.",
      "title": "SessionFsWriteFileRequest",
      "stability": "experimental"
    },
    "SessionInstalledPlugin": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Plugin name"
        },
        "marketplace": {
          "type": "string",
          "description": "Marketplace the plugin came from (empty string for direct repo installs)"
        },
        "version": {
          "type": "string",
          "description": "Installed version, if known"
        },
        "installed_at": {
          "type": "string",
          "description": "Installation timestamp (ISO-8601)"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the plugin is currently enabled"
        },
        "cache_path": {
          "type": "string",
          "description": "Path where the plugin is cached locally"
        },
        "source": {
          "$ref": "#/definitions/SessionInstalledPluginSource",
          "description": "Source descriptor for direct repo installs (when marketplace is empty)"
        },
        "source_sha": {
          "type": "string",
          "description": "Per-plugin source fingerprint (a SHA-256 hash of the plugin's catalog source spec plus its resolved source subtree — NOT a Git commit SHA) captured at marketplace install/update time. Auto-update compares it against the freshly recomputed fingerprint to detect a content change that does not bump the version. Absent for pre-existing installs and for direct (non-marketplace) installs."
        },
        "installed_from": {
          "type": "string",
          "description": "Absolute path of the marketplace directory a live plugin was resolved from. Present only on live, never-persisted records — those synthesized at session start for a directory/local marketplace, whose cache_path points at the real plugin directory on disk rather than a copy under the installed-plugins cache. Its presence is what marks a record as live, and no record carrying it is ever written to the persisted installedPlugins key."
        }
      },
      "required": [
        "name",
        "marketplace",
        "installed_at",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source.",
      "title": "SessionInstalledPlugin"
    },
    "SessionInstalledPluginSource": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^[^/]+\\/[^/]+$"
        },
        {
          "$ref": "#/definitions/SessionInstalledPluginSourceGitHub",
          "description": "Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath."
        },
        {
          "$ref": "#/definitions/SessionInstalledPluginSourceUrl",
          "description": "Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath."
        },
        {
          "$ref": "#/definitions/SessionInstalledPluginSourceLocal",
          "description": "Source descriptor for a direct local plugin install, with a local filesystem path."
        }
      ],
      "description": "Source descriptor for direct repo installs (when marketplace is empty)",
      "title": "SessionInstalledPluginSource",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "SessionInstalledPluginSourceGitHub": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "github",
          "description": "Constant value. Always \"github\"."
        },
        "repo": {
          "type": "string",
          "pattern": "^[^/]+\\/[^/]+$",
          "description": "GitHub repository in `owner/repo` form."
        },
        "ref": {
          "type": "string",
          "description": "Optional Git ref to resolve."
        },
        "sha": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{40}$",
          "description": "Optional full 40-character hexadecimal commit SHA."
        },
        "path": {
          "type": "string",
          "description": "Optional repository-relative path to the plugin."
        }
      },
      "required": [
        "source",
        "repo"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct GitHub plugin install, with `owner/repo`, optional ref or full commit SHA, and optional subpath.",
      "title": "SessionInstalledPluginSourceGitHub"
    },
    "SessionInstalledPluginSourceLocal": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "local",
          "description": "Constant value. Always \"local\"."
        },
        "path": {
          "type": "string",
          "description": "Local filesystem path to the plugin."
        }
      },
      "required": [
        "source",
        "path"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct local plugin install, with a local filesystem path.",
      "title": "SessionInstalledPluginSourceLocal"
    },
    "SessionInstalledPluginSourceUrl": {
      "type": "object",
      "properties": {
        "source": {
          "type": "string",
          "const": "url",
          "description": "Constant value. Always \"url\"."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "URL of the plugin source."
        },
        "ref": {
          "type": "string",
          "description": "Optional Git ref to resolve."
        },
        "sha": {
          "type": "string",
          "pattern": "^[0-9a-fA-F]{40}$",
          "description": "Optional full 40-character hexadecimal commit SHA."
        },
        "path": {
          "type": "string",
          "description": "Optional source-relative path to the plugin."
        }
      },
      "required": [
        "source",
        "url"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a direct URL plugin install, with URL, optional ref or full commit SHA, and optional subpath.",
      "title": "SessionInstalledPluginSourceUrl"
    },
    "SessionLimitPredictionBaselineData": {
      "type": "object",
      "properties": {
        "windowStart": {
          "type": "string",
          "description": "Start of the baseline data slice."
        },
        "windowEnd": {
          "type": "string",
          "description": "End of the baseline data slice."
        }
      },
      "required": [
        "windowStart",
        "windowEnd"
      ],
      "additionalProperties": false,
      "description": "Baseline data provenance for a prediction.",
      "title": "SessionLimitPredictionBaselineData"
    },
    "SessionLimitPredictionClientType": {
      "type": "string",
      "enum": [
        "cli-interactive",
        "cli-prompt"
      ],
      "description": "Client population used for the prediction baseline.",
      "title": "SessionLimitPredictionClientType",
      "x-enumDescriptions": {
        "cli-interactive": "Interactive CLI sessions where a user can accept, edit, or top up the limit.",
        "cli-prompt": "Prompt/non-interactive CLI sessions where the initial limit must cover more of the run."
      }
    },
    "SessionLimitPredictionDetails": {
      "type": "object",
      "properties": {
        "clientType": {
          "$ref": "#/definitions/SessionLimitPredictionClientType",
          "description": "Client population used for the prediction."
        },
        "modelId": {
          "type": "string",
          "description": "Model identifier used for lookup."
        },
        "source": {
          "$ref": "#/definitions/SessionLimitPredictionSource",
          "description": "Baseline fallback level used to create the prediction."
        },
        "sourceKey": {
          "type": "string",
          "description": "Key matched at the source level, such as a model id, family id, or `global`."
        },
        "family": {
          "type": "string",
          "description": "Resolved model family when known."
        },
        "tiers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionLimitPredictionTierOption",
            "description": "Semantic usage tier and its AI-credit cap."
          },
          "description": "Ordered usage tiers and their AI-credit caps."
        },
        "baselineData": {
          "$ref": "#/definitions/SessionLimitPredictionBaselineData",
          "description": "Baseline data provenance."
        },
        "recommendedTier": {
          "$ref": "#/definitions/SessionLimitPredictionTier",
          "description": "Tier chosen as the recommended cap."
        },
        "recommendedCap": {
          "type": "number",
          "description": "Recommended maximum AI credits for this session."
        }
      },
      "required": [
        "clientType",
        "modelId",
        "source",
        "sourceKey",
        "tiers",
        "baselineData",
        "recommendedTier",
        "recommendedCap"
      ],
      "additionalProperties": false,
      "description": "Explainable AI-credit session-limit prediction.",
      "title": "SessionLimitPredictionDetails"
    },
    "SessionLimitPredictionRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "modelId": {
              "type": "string",
              "description": "Optional model identifier override. If omitted, the session's current model is used."
            },
            "clientType": {
              "$ref": "#/definitions/SessionLimitPredictionClientType",
              "description": "Client type to size for. Defaults to `cli-interactive`."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Parameters for predicting an AI-credit session limit. Omitting `modelId` uses the session's currently selected model.",
      "title": "SessionLimitPredictionRequest",
      "stability": "experimental"
    },
    "SessionLimitPredictionResult": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "prediction": {
              "$ref": "#/definitions/SessionLimitPredictionDetails",
              "description": "Predicted session limit details."
            },
            "kind": {
              "type": "string",
              "const": "available",
              "description": "Prediction result variant discriminator."
            }
          },
          "required": [
            "kind",
            "prediction"
          ],
          "additionalProperties": false
        },
        {
          "type": "object",
          "properties": {
            "reason": {
              "$ref": "#/definitions/SessionLimitPredictionUnavailableReason",
              "description": "Reason no prediction is available."
            },
            "kind": {
              "type": "string",
              "const": "unavailable",
              "description": "Prediction result variant discriminator."
            }
          },
          "required": [
            "kind",
            "reason"
          ],
          "additionalProperties": false
        }
      ],
      "description": "Prediction result. Available results include prediction details; unavailable results include an explicit reason.",
      "title": "SessionLimitPredictionResult"
    },
    "SessionLimitPredictionSource": {
      "type": "string",
      "enum": [
        "model",
        "family",
        "global"
      ],
      "description": "Baseline fallback level used to create the prediction.",
      "title": "SessionLimitPredictionSource",
      "x-enumDescriptions": {
        "model": "The prediction used the exact resolved model's baseline cell.",
        "family": "The exact model was unavailable, so the prediction used the model family's baseline cell.",
        "global": "No model or family cell was available, so the prediction used the global client-type baseline cell."
      }
    },
    "SessionLimitPredictionTier": {
      "type": "string",
      "enum": [
        "recommended",
        "additional_headroom",
        "generous_headroom",
        "maximum_headroom"
      ],
      "description": "Semantic usage tier used for a recommended cap or additional headroom.",
      "title": "SessionLimitPredictionTier",
      "x-enumDescriptions": {
        "recommended": "Recommended starting tier.",
        "additional_headroom": "Additional headroom for longer-running sessions.",
        "generous_headroom": "Generous headroom for unusually high usage.",
        "maximum_headroom": "Maximum available headroom tier."
      }
    },
    "SessionLimitPredictionTierOption": {
      "type": "object",
      "properties": {
        "tier": {
          "$ref": "#/definitions/SessionLimitPredictionTier",
          "description": "Semantic usage tier."
        },
        "cap": {
          "type": "number",
          "description": "AI-credit cap for this tier."
        }
      },
      "required": [
        "tier",
        "cap"
      ],
      "additionalProperties": false,
      "description": "Semantic usage tier and its AI-credit cap.",
      "title": "SessionLimitPredictionTierOption"
    },
    "SessionLimitPredictionUnavailableReason": {
      "type": "string",
      "enum": [
        "auto_unresolved",
        "no_model"
      ],
      "description": "Reason a prediction could not be computed.",
      "title": "SessionLimitPredictionUnavailableReason",
      "x-enumDescriptions": {
        "auto_unresolved": "The current model is auto and has not resolved to a concrete model yet.",
        "no_model": "No model was provided and the session does not currently have a selected model."
      }
    },
    "SessionLimitsConfig": {
      "type": "object",
      "properties": {
        "maxAiCredits": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Maximum AI Credits allowed across the session's current accounting window."
        }
      },
      "additionalProperties": false,
      "description": "Optional session limits.",
      "title": "SessionLimitsConfig"
    },
    "SessionList": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionListEntry",
            "description": "Local or remote session metadata entry. Narrow on `isRemote` to access source-specific fields."
          },
          "description": "Sessions ordered most-recently-modified first. Discriminated by `isRemote`."
        }
      },
      "required": [
        "sessions"
      ],
      "additionalProperties": false,
      "description": "Sessions matching the filter, ordered most-recently-modified first.",
      "title": "SessionList"
    },
    "SessionListEntry": {
      "anyOf": [
        {
          "$ref": "#/definitions/LocalSessionMetadataValue",
          "description": "Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID."
        },
        {
          "$ref": "#/definitions/RemoteSessionMetadataValue",
          "description": "Full remote-session metadata in wire-portable form."
        }
      ],
      "description": "Local or remote session metadata entry. Narrow on `isRemote` to access source-specific fields.",
      "title": "SessionListEntry"
    },
    "SessionListFilter": {
      "type": "object",
      "properties": {
        "cwd": {
          "type": "string",
          "description": "Match sessions whose context.cwd equals this value"
        },
        "gitRoot": {
          "type": "string",
          "description": "Match sessions whose context.gitRoot equals this value"
        },
        "repository": {
          "type": "string",
          "description": "Match sessions whose context.repository equals this value"
        },
        "branch": {
          "type": "string",
          "description": "Match sessions whose context.branch equals this value"
        }
      },
      "additionalProperties": false,
      "description": "Optional filter applied to the returned sessions",
      "title": "SessionListFilter"
    },
    "SessionLoadDeferredRepoHooksResult": {
      "type": "object",
      "properties": {
        "startupPrompts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Repo-level startup prompts queued from repo hook configs. Empty on resume, when no repo configs were pending, or when disableAllHooks is set."
        },
        "hookCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Total hook command count (user + plugin + repo) loaded for the session by this call. Captured atomically with startupPrompts so callers don't need to read a separate counter."
        }
      },
      "required": [
        "startupPrompts",
        "hookCount"
      ],
      "additionalProperties": false,
      "description": "Queued repo-level startup prompts and the total hook command count after loading.",
      "title": "SessionLoadDeferredRepoHooksResult"
    },
    "SessionLogLevel": {
      "type": "string",
      "enum": [
        "info",
        "warning",
        "error"
      ],
      "description": "Log severity level. Determines how the message is displayed in the timeline. Defaults to \"info\".",
      "title": "SessionLogLevel",
      "x-enumDescriptions": {
        "info": "Informational message.",
        "warning": "Warning message that may require attention.",
        "error": "Error message describing a failure."
      }
    },
    "SessionManagedPermissions": {
      "type": "object",
      "properties": {
        "disableBypassPermissionsMode": {
          "type": "string",
          "description": "When set to `disable`, prevents bypass/allow-all permission modes. `allow-auto-only` blocks full allow-all but permits advisory auto-approval. Any other value is accepted rather than failing the session, but is enforced as `disable`: the key is only present to restrict something, so a mode this runtime cannot interpret fails closed to the most restrictive one it knows. Omit the key entirely to impose no restriction."
        },
        "deny": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Permission rules that block matching operations. Deny has highest precedence."
        },
        "ask": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Permission rules that require explicit human approval."
        },
        "allow": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Permission rules that allow matching operations unless another managed source, deny, or ask rule restricts them."
        }
      },
      "additionalProperties": false,
      "description": "Enterprise permission policy expressed with the runtime's managed permission-rule syntax.",
      "title": "SessionManagedPermissions"
    },
    "SessionManagedSettings": {
      "type": "object",
      "properties": {
        "permissions": {
          "$ref": "#/definitions/SessionManagedPermissions",
          "description": "Managed permission policy injected by the SDK host."
        }
      },
      "additionalProperties": false,
      "description": "Managed settings an SDK host may inject at session startup. Only permissions are accepted in this initial contract.",
      "title": "SessionManagedSettings"
    },
    "SessionMetadataSnapshot": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "The unique identifier of the session"
        },
        "startTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp of when the session started"
        },
        "modifiedTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp of when the session's persisted state was last modified on disk. For new sessions, equals startTime. For resumed sessions, reflects the previous modification time at construction."
        },
        "isRemote": {
          "type": "boolean",
          "description": "Whether this is a remote session (i.e., one whose runtime executes elsewhere and is steered through this process)"
        },
        "alreadyInUse": {
          "type": "boolean",
          "description": "True when the session was detected to be in use by another process at construction time. Local consumers may surface a confirmation prompt before fully attaching. Always false for new sessions."
        },
        "workspacePath": {
          "type": [
            "string",
            "null"
          ],
          "description": "Absolute path to the session's workspace directory on disk, or null if the session has no associated workspace"
        },
        "initialName": {
          "type": "string",
          "description": "User-provided name supplied at session construction (via `--name`), if any. Immutable after construction."
        },
        "clientName": {
          "type": "string",
          "description": "Runtime client name associated with the session (telemetry identifier)."
        },
        "remoteMetadata": {
          "$ref": "#/definitions/MetadataSnapshotRemoteMetadata",
          "description": "Remote-session-specific metadata. Populated only when `isRemote` is true. Fields are immutable for the lifetime of the session."
        },
        "summary": {
          "type": "string",
          "description": "Short human-readable summary of the session, if known. Omitted when no summary has been generated."
        },
        "workingDirectory": {
          "type": "string",
          "description": "Absolute path to the session's current working directory"
        },
        "currentMode": {
          "$ref": "#/definitions/MetadataSnapshotCurrentMode",
          "description": "The current agent mode for this session (e.g., 'interactive', 'plan', 'autopilot')"
        },
        "selectedModel": {
          "type": "string",
          "description": "Currently selected model identifier, if any"
        },
        "sessionLimits": {
          "anyOf": [
            {
              "$ref": "#/definitions/SessionLimitsConfig",
              "description": "Optional session limits."
            },
            {
              "type": "null"
            }
          ],
          "description": "Current session limits, or null when no limits are active"
        },
        "workspace": {
          "$ref": "#/definitions/WorkspaceSummary",
          "description": "Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags)."
        }
      },
      "required": [
        "sessionId",
        "startTime",
        "modifiedTime",
        "isRemote",
        "alreadyInUse",
        "workspacePath",
        "workingDirectory",
        "currentMode",
        "sessionLimits",
        "workspace"
      ],
      "additionalProperties": false,
      "description": "Point-in-time snapshot of slow-changing session identifier and state fields",
      "title": "SessionMetadataSnapshot"
    },
    "SessionMode": {
      "type": "string",
      "enum": [
        "interactive",
        "plan",
        "autopilot"
      ],
      "description": "The session mode the agent is operating in",
      "title": "SessionMode",
      "x-enumDescriptions": {
        "interactive": "The agent is responding interactively to the user.",
        "plan": "The agent is preparing a plan before making changes.",
        "autopilot": "The agent is working autonomously toward task completion."
      }
    },
    "SessionModelList": {
      "type": "object",
      "properties": {
        "list": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          },
          "description": "Available models, ordered with the most preferred default first. Includes both Copilot (CAPI) models and any registry BYOK models; a BYOK model appears under its provider-qualified selection id (`provider/id`)."
        },
        "modelPriceCategories": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionModelPriceCategory",
            "description": "Cost-category metadata for a CAPI model."
          },
          "description": "Cost categories for the full CAPI catalog, including picker-disabled models that Auto may select. Metadata only; entries absent from `list` are not manually selectable."
        },
        "quotaSnapshots": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Per-quota snapshots returned alongside the model list, keyed by quota type."
        }
      },
      "required": [
        "list"
      ],
      "additionalProperties": false,
      "description": "The list of models available to this session.",
      "title": "SessionModelList"
    },
    "SessionModelPriceCategory": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "CAPI model identifier."
        },
        "priceCategory": {
          "$ref": "#/definitions/ModelPickerPriceCategory",
          "description": "Cost category assigned to the model."
        }
      },
      "required": [
        "id",
        "priceCategory"
      ],
      "additionalProperties": false,
      "description": "Cost-category metadata for a CAPI model.",
      "title": "SessionModelPriceCategory"
    },
    "SessionOpenOptions": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Optional stable session identifier to use for a new session."
        },
        "name": {
          "type": "string",
          "description": "Optional human-friendly session name."
        },
        "model": {
          "type": "string",
          "description": "Initial model identifier."
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Initial reasoning effort level. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied."
        },
        "reasoningSummary": {
          "$ref": "#/definitions/SessionOpenOptionsReasoningSummary",
          "description": "Initial reasoning summary mode for supported model clients."
        },
        "verbosity": {
          "$ref": "#/definitions/Verbosity",
          "description": "Initial output verbosity level for supported models."
        },
        "clientName": {
          "type": "string",
          "description": "Identifier of the client driving the session."
        },
        "clientKind": {
          "type": "string",
          "description": "Structured client kind used for runtime behavior gates."
        },
        "lspClientName": {
          "type": "string",
          "description": "Identifier sent to LSP-style integrations."
        },
        "integrationId": {
          "type": "string",
          "description": "Stable integration identifier for analytics."
        },
        "expAssignments": {
          "description": "ExP assignment ('flight') data injected by an SDK integrator, in the same JSON shape the Copilot CLI fetches from the experimentation service (CopilotExpAssignmentResponse). When supplied this is fed into the FeatureFlagService exactly like CLI-fetched assignments and ExP-backed flags wait for it. When absent the session does not block on ExP.",
          "x-opaque-json": true,
          "visibility": "internal"
        },
        "enableManagedSettings": {
          "type": "boolean",
          "description": "Opt-in: self-fetch and enforce enterprise managed settings at session bootstrap."
        },
        "managedSettings": {
          "$ref": "#/definitions/SessionManagedSettings",
          "description": "Permissions-only enterprise policy injected by the SDK host at session create or resume. Composes restrictively with self-fetched and device policy and is not persisted."
        },
        "enableFileChangeTracking": {
          "type": "boolean",
          "description": "Opt in to capturing file changes for session rewind and session diff. Capture cannot reconstruct changes made before it was enabled. On create it starts capture from the first turn. It is also honored on resume: for a session that already has tracked prior turns, tracking continues automatically even if this is omitted; passing it on resume additionally enables tracking for an eligible session that has no prior root turn yet. Resuming a session whose prior root turns were never tracked has no restorable baseline, so tracking stays disabled for it and rewind reports file change tracking as unavailable; the resume itself still succeeds, so sessions that predate tracking remain loadable. The opt-in is only rejected when the session can never track (a subagent session, or one without local session storage). It is intentionally absent from the mutable options update because enabling it after edits have occurred would create an incomplete, misleading baseline. Subagents share the parent session's capture store and are not tracked as separate rewind points: a file a subagent writes is attributed to whichever root user turn was open when the capture was staged, just before the tool body ran. A turn cannot open while a staged capture is still in flight, so a subagent tool that staged under the spawning turn stays attributed to it however late the write lands, while a capture it stages after the user's next message belongs to that later turn. Attribution decides which turn's rewind point counts and file preview include that write; it does not narrow which rewinds revert it, because a rewind restores every capture from the selected turn onward, so the earlier spawning turn reverts it as well."
        },
        "featureFlags": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "description": "Feature-flag values resolved by the host."
        },
        "isExperimentalMode": {
          "type": "boolean",
          "description": "Whether experimental behavior is enabled."
        },
        "authInfo": {
          "$ref": "#/definitions/AuthInfo",
          "description": "Initial authentication info for the session."
        },
        "provider": {
          "$ref": "#/definitions/ProviderConfig",
          "description": "Custom model-provider configuration (BYOK)."
        },
        "capi": {
          "$ref": "#/definitions/CapiSessionOptions",
          "description": "Options scoped to the built-in CAPI (Copilot API) provider."
        },
        "providers": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/NamedProviderConfig",
            "description": "External SDK input for a named custom model provider. Ingested by the native protocol boundary before host dispatch."
          },
          "description": "Named BYOK provider connections, additive to CAPI auth. Combining with `provider` is rejected.",
          "stability": "experimental"
        },
        "models": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProviderModelConfig",
            "description": "A BYOK model definition referencing a named provider."
          },
          "description": "BYOK model definitions added to the selectable model list, each referencing a provider name.",
          "stability": "experimental"
        },
        "workingDirectory": {
          "type": "string",
          "description": "Working directory to anchor the session."
        },
        "additionalDirectories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Additional directories the agent may access beyond the working directory. Each entry is granted to the session's file-access allow-list and surfaced to the model (system prompt context and `@`-mention completion). Conventional `.github/skills/` and `.github/agents/` definitions under each directory also join the session's project catalogs when their existing subsystem gates are enabled: added-root skills require both `enableConfigDiscovery` and effective `enableSkills`; added-root agents require `enableConfigDiscovery`. Supplying a directory therefore activates configuration from it and should be treated as a trust decision. Absolute paths are recommended; a relative path is resolved against the session's working directory. Nonexistent or unresolvable entries are skipped with a warning. This is applied during session creation and cold resume and is not persisted, so a cold resume must re-supply the directories."
        },
        "workingDirectoryContext": {
          "$ref": "#/definitions/SessionContext",
          "description": "Pre-resolved working-directory context for session startup."
        },
        "remoteSteerable": {
          "type": "boolean",
          "description": "Whether this session supports remote steering."
        },
        "remoteExporting": {
          "type": "boolean",
          "description": "Telemetry-only remote exporting flag."
        },
        "remoteDefaultedOn": {
          "type": "boolean",
          "description": "Telemetry-only remote-defaulted flag."
        },
        "detachedFromSpawningParentSessionId": {
          "type": "string",
          "description": "Parent session ID for detached child telemetry rollup."
        },
        "detachedFromSpawningParentEngagementId": {
          "type": "string",
          "description": "Parent engagement ID for detached child telemetry rollup."
        },
        "availableTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowlist of available tool names."
        },
        "excludedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Denylist of tool names."
        },
        "includedBuiltinAgents": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available."
        },
        "excludedBuiltinAgents": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available."
        },
        "enableScriptSafety": {
          "type": "boolean",
          "description": "Whether shell-script safety heuristics are enabled."
        },
        "shell": {
          "$ref": "#/definitions/ShellOptions",
          "description": "Per-session settings for built-in shell tools."
        },
        "shellInitProfile": {
          "type": "string",
          "description": "Use shell.initProfile instead. Shell init profile.",
          "deprecated": true
        },
        "shellProcessFlags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "PowerShell process flags applied to built-in and user-requested shell commands."
        },
        "sandboxConfig": {
          "$ref": "#/definitions/SandboxConfig",
          "description": "Resolved sandbox configuration."
        },
        "sandboxConfigSource": {
          "$ref": "#/definitions/SandboxConfigSource",
          "description": "Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently.",
          "visibility": "internal"
        },
        "logInteractiveShells": {
          "type": "boolean",
          "description": "Whether interactive shell sessions are logged."
        },
        "envValueMode": {
          "$ref": "#/definitions/SessionOpenOptionsEnvValueMode",
          "description": "How MCP server environment values are interpreted."
        },
        "disabledMcpServers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "MCP server names disabled for this session. Disabled servers are not started or authenticated on create or cold resume."
        },
        "allowAllMcpServerInstructions": {
          "type": "boolean",
          "description": "Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers."
        },
        "skillDirectories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Additional directories to search for skills."
        },
        "includedBuiltinSkills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available."
        },
        "disabledSkills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Skill IDs disabled for this session."
        },
        "installedPlugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstalledPlugin",
            "description": "Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source."
          },
          "description": "Installed plugins visible to the session."
        },
        "customAgentsLocalOnly": {
          "type": "boolean",
          "description": "Whether custom agents default to local-only execution."
        },
        "skipCustomInstructions": {
          "type": "boolean",
          "description": "Whether to skip custom instruction sources."
        },
        "disabledInstructionSources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Instruction source IDs disabled for this session."
        },
        "coauthorEnabled": {
          "type": "boolean",
          "description": "Whether commit-message coauthor trailers are enabled."
        },
        "trajectoryFile": {
          "type": "string",
          "description": "Optional trajectory output file path."
        },
        "enableStreaming": {
          "type": "boolean",
          "description": "Whether model responses stream as delta events."
        },
        "enableCitations": {
          "type": "boolean",
          "description": "Experimental: enable native model citations for supported Anthropic and OpenAI models, normalized onto the `assistant.message` event. Off by default; may change or be removed while the citations surface is experimental.",
          "stability": "experimental"
        },
        "copilotUrl": {
          "type": "string",
          "description": "Override URL for the Copilot API endpoint."
        },
        "askUserDisabled": {
          "type": "boolean",
          "description": "Whether ask_user is explicitly disabled."
        },
        "continueOnAutoMode": {
          "type": "boolean",
          "description": "Whether auto-mode continuation is enabled."
        },
        "runningInInteractiveMode": {
          "type": "boolean",
          "description": "Whether the host is an interactive UI."
        },
        "enableOnDemandInstructionDiscovery": {
          "type": "boolean",
          "description": "Whether on-demand custom instruction discovery is enabled."
        },
        "maxInlineBinaryBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum decoded byte size of a single inline model-facing binary tool result persisted in session events (default 10 MB)."
        },
        "modelCapabilitiesOverrides": {
          "$ref": "#/definitions/ModelCapabilitiesOverride",
          "description": "Initial model capability overrides."
        },
        "sessionLimits": {
          "$ref": "#/definitions/SessionLimitsConfig",
          "description": "Initial session limits."
        },
        "agentContext": {
          "type": "string",
          "description": "Runtime context discriminator for agent filtering."
        },
        "eventsLogDirectory": {
          "type": "string",
          "description": "Override directory for session event logs."
        },
        "eventsLogIncludesSubagents": {
          "type": "boolean",
          "description": "Whether subagent callback events should be forwarded into the session event log sink."
        },
        "configDir": {
          "type": "string",
          "description": "Override Copilot configuration directory."
        },
        "additionalContentExclusionPolicies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionOpenOptionsAdditionalContentExclusionPolicy",
            "description": "Content-exclusion policy supplied to `sessions.open` options, with rules, last-updated data, and scope."
          },
          "description": "Additional content-exclusion policies to merge into the session policy set.",
          "stability": "experimental"
        },
        "memory": {
          "$ref": "#/definitions/MemoryConfiguration",
          "description": "Memory configuration for this session."
        },
        "sessionCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionCapability",
            "description": "Session capability enabled for this session"
          },
          "description": "Capabilities enabled for this session."
        }
      },
      "additionalProperties": false,
      "description": "Session construction options.",
      "title": "SessionOpenOptions"
    },
    "SessionOpenOptionsAdditionalContentExclusionPolicy": {
      "type": "object",
      "properties": {
        "rules": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionOpenOptionsAdditionalContentExclusionPolicyRule",
            "description": "Single content-exclusion rule supplied to `sessions.open` options, with paths, match conditions, and source."
          },
          "description": "Content-exclusion rules to apply."
        },
        "last_updated_at": {
          "description": "Opaque policy update timestamp supplied by the host.",
          "x-opaque-json": true
        },
        "scope": {
          "$ref": "#/definitions/SessionOpenOptionsAdditionalContentExclusionPolicyScope",
          "description": "Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration."
        }
      },
      "required": [
        "rules",
        "last_updated_at",
        "scope"
      ],
      "description": "Content-exclusion policy supplied to `sessions.open` options, with rules, last-updated data, and scope.",
      "title": "SessionOpenOptionsAdditionalContentExclusionPolicy"
    },
    "SessionOpenOptionsAdditionalContentExclusionPolicyRule": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Path patterns covered by this rule."
        },
        "ifAnyMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions of which at least one must match."
        },
        "ifNoneMatch": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Conditions none of which may match."
        },
        "source": {
          "$ref": "#/definitions/SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource",
          "description": "Source descriptor for a `sessions.open` content-exclusion rule, with source name and type."
        }
      },
      "required": [
        "paths",
        "source"
      ],
      "description": "Single content-exclusion rule supplied to `sessions.open` options, with paths, match conditions, and source.",
      "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRule"
    },
    "SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the policy source."
        },
        "type": {
          "type": "string",
          "description": "Type of the policy source."
        }
      },
      "required": [
        "name",
        "type"
      ],
      "additionalProperties": false,
      "description": "Source descriptor for a `sessions.open` content-exclusion rule, with source name and type.",
      "title": "SessionOpenOptionsAdditionalContentExclusionPolicyRuleSource"
    },
    "SessionOpenOptionsAdditionalContentExclusionPolicyScope": {
      "type": "string",
      "enum": [
        "repo",
        "all"
      ],
      "description": "Allowed values for the `SessionOpenOptionsAdditionalContentExclusionPolicyScope` enumeration.",
      "title": "SessionOpenOptionsAdditionalContentExclusionPolicyScope",
      "x-enumDescriptions": {
        "repo": "The content exclusion policy applies to the current repository.",
        "all": "The content exclusion policy applies across all repositories."
      }
    },
    "SessionOpenOptionsEnvValueMode": {
      "type": "string",
      "enum": [
        "direct",
        "indirect"
      ],
      "description": "How MCP server environment values are interpreted.",
      "title": "SessionOpenOptionsEnvValueMode",
      "x-enumDescriptions": {
        "direct": "Pass MCP server environment values as literal strings.",
        "indirect": "Resolve MCP server environment values from host-side references."
      }
    },
    "SessionOpenOptionsReasoningSummary": {
      "type": "string",
      "enum": [
        "none",
        "concise",
        "detailed"
      ],
      "description": "Initial reasoning summary mode for supported model clients.",
      "title": "SessionOpenOptionsReasoningSummary",
      "x-enumDescriptions": {
        "none": "Do not request reasoning summaries from the model.",
        "concise": "Request a concise summary of model reasoning.",
        "detailed": "Request a detailed summary of model reasoning."
      }
    },
    "SessionOpenParams": {
      "anyOf": [
        {
          "$ref": "#/definitions/SessionsOpenCreate",
          "description": "Parameters for creating a new local session."
        },
        {
          "$ref": "#/definitions/SessionsOpenResume",
          "description": "Parameters for resuming a specific local session."
        },
        {
          "$ref": "#/definitions/SessionsOpenResumeLast",
          "description": "Parameters for resuming the most relevant local session."
        },
        {
          "$ref": "#/definitions/SessionsOpenAttach",
          "description": "Parameters for attaching to an already-active session by ID."
        },
        {
          "$ref": "#/definitions/SessionsOpenRemote",
          "description": "Parameters for connecting to a live remote session."
        },
        {
          "$ref": "#/definitions/SessionsOpenCloud",
          "description": "Parameters for creating a new cloud session."
        },
        {
          "$ref": "#/definitions/SessionsOpenHandoff",
          "description": "Parameters for fetching a remote session and handing it off to a new local session."
        }
      ],
      "description": "Open a session by creating, resuming, attaching, connecting to a remote, or handing off.",
      "title": "SessionOpenParams"
    },
    "SessionOpenResult": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/SessionsOpenStatus",
          "description": "Outcome of the open request."
        },
        "sessionId": {
          "type": "string",
          "description": "Opened session ID. Omitted when status is `not_found`."
        },
        "sessionApi": {
          "description": "In-process SessionClientApi handle for the opened session, returned to CLI callers as a transitional shortcut. Marked internal so the public SDK surface does not expose it; SDK consumers should construct per-session clients from `sessionId` instead.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "startupPrompts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Startup prompts queued by user-level hook configs at session creation. Only populated when status is `created`; resumed sessions return an empty array."
        },
        "remoteSessionId": {
          "type": "string",
          "description": "Remote session ID, present when status is `connected`."
        },
        "metadata": {
          "$ref": "#/definitions/RemoteSessionMetadataValue",
          "description": "Remote session metadata, present when status is `connected`."
        },
        "progress": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionsOpenProgress",
            "description": "`sessions.open` handoff progress update with step, status, and optional message."
          },
          "description": "Handoff progress steps, present when status is `handed_off`."
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false,
      "description": "Result of opening a session.",
      "title": "SessionOpenResult"
    },
    "SessionPruneResult": {
      "type": "object",
      "properties": {
        "deleted": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs that were deleted (always empty in dry-run mode)"
        },
        "candidates": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs that would be deleted in dry-run mode (always empty otherwise)"
        },
        "skipped": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs that were skipped (e.g., named sessions)"
        },
        "freedBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Total bytes freed (actual when not dry-run, projected when dry-run)"
        },
        "dryRun": {
          "type": "boolean",
          "description": "True when no deletions were actually performed"
        }
      },
      "required": [
        "deleted",
        "candidates",
        "skipped",
        "freedBytes",
        "dryRun"
      ],
      "additionalProperties": false,
      "description": "Outcome of the prune operation: deleted IDs, dry-run candidates, skipped IDs, total bytes freed, and the dry-run flag.",
      "title": "SessionPruneResult"
    },
    "SessionsBulkDeleteRequest": {
      "type": "object",
      "properties": {
        "sessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs to close, deactivate, and delete from disk"
        }
      },
      "required": [
        "sessionIds"
      ],
      "additionalProperties": false,
      "description": "Session IDs to close, deactivate, and delete from disk.",
      "title": "SessionsBulkDeleteRequest"
    },
    "SessionsCheckInUseRequest": {
      "type": "object",
      "properties": {
        "sessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs to test for live in-use locks"
        }
      },
      "required": [
        "sessionIds"
      ],
      "additionalProperties": false,
      "description": "Session IDs to test for live in-use locks.",
      "title": "SessionsCheckInUseRequest"
    },
    "SessionsCheckInUseResult": {
      "type": "object",
      "properties": {
        "inUse": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs from the input set that are currently held by another running process via an alive lock file"
        }
      },
      "required": [
        "inUse"
      ],
      "additionalProperties": false,
      "description": "Session IDs from the input set that are currently in use by another process.",
      "title": "SessionsCheckInUseResult"
    },
    "SessionsCloseRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID to close"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID to close.",
      "title": "SessionsCloseRequest"
    },
    "SessionsCloseResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Closes a session: emits shutdown, flushes pending events to disk, releases the in-use lock, disposes the active session. Idempotent: succeeds even if the session is not currently active.",
      "title": "SessionsCloseResult"
    },
    "SessionsDeleteRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID to delete"
        },
        "sessionPath": {
          "type": [
            "string",
            "null"
          ],
          "description": "Internal resolved session directory path to delete"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID to delete from disk.",
      "title": "SessionsDeleteRequest"
    },
    "SessionsEnrichMetadataRequest": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/LocalSessionMetadataValue",
            "description": "Persisted local session metadata, including identifiers, timestamps, summary/name, client, context, detached state, and task ID."
          },
          "description": "Session metadata records to enrich. Records that already have summary and context are returned unchanged."
        }
      },
      "required": [
        "sessions"
      ],
      "additionalProperties": false,
      "description": "Session metadata records to enrich with summary and context information.",
      "title": "SessionsEnrichMetadataRequest"
    },
    "SessionSetCredentialsParams": {
      "type": "object",
      "properties": {
        "credentials": {
          "$ref": "#/definitions/SettableAuthInfo",
          "description": "The new auth credentials to install on the session. When omitted or `undefined`, the call is a no-op and the session's existing credentials are preserved. The runtime installs the supplied value immediately for outbound model/API requests. When the credential carries a raw token (`token`, `env`, or `gh-cli`) but no `copilotUser`, the runtime additionally re-resolves `copilotUser` server-side (best-effort, asynchronously, after the synchronous install) so plan/quota/billing metadata regains fidelity; on resolution failure the verbatim credential remains installed. It does NOT otherwise validate the credential. Several variants carry secret material; treat this method's params as containing secrets at rest and in transit."
        }
      },
      "additionalProperties": false,
      "description": "New auth credentials to install on the session. Omit to leave credentials unchanged.",
      "title": "SessionSetCredentialsParams",
      "stability": "experimental"
    },
    "SessionSetCredentialsResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        },
        "copilotUserResolved": {
          "type": "boolean",
          "description": "Whether the session ended up with a populated `copilotUser` for the installed credentials. `true` when the supplied credential already carried `copilotUser` or it was successfully re-resolved server-side. `false` when the credential is installed without `copilotUser` — either re-resolution failed, or the variant cannot be re-resolved from the credential alone (only the raw-token variants `token`, `env`, and `gh-cli` can). In both `false` cases the token swap still applied, but plan/quota/billing metadata is degraded. Present whenever a credential was supplied; omitted only when no credential was supplied (no-op call)."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the credential update succeeded.",
      "title": "SessionSetCredentialsResult"
    },
    "SessionSettingsBuiltInToolAvailabilitySnapshot": {
      "type": "object",
      "properties": {
        "reportProgress": {
          "type": "boolean",
          "description": "Whether the report-progress tool is available."
        },
        "createPullRequest": {
          "type": "boolean",
          "description": "Whether the create-pull-request tool is available."
        }
      },
      "additionalProperties": false,
      "description": "Availability of built-in job tools surfaced to boundary consumers.",
      "title": "SessionSettingsBuiltInToolAvailabilitySnapshot"
    },
    "SessionSettingsEvaluatePredicateRequest": {
      "type": "object",
      "properties": {
        "name": {
          "$ref": "#/definitions/SessionSettingsPredicateName",
          "description": "Predicate name. The runtime owns the raw feature-flag names and composition logic."
        },
        "toolName": {
          "type": "string",
          "description": "Tool name for tool-scoped predicates such as trivial-change handling."
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Named Rust-owned settings predicate to evaluate for this session.",
      "title": "SessionSettingsEvaluatePredicateRequest",
      "stability": "experimental"
    },
    "SessionSettingsEvaluatePredicateResult": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether the named settings predicate evaluated to enabled."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Result of evaluating a Rust-owned settings predicate.",
      "title": "SessionSettingsEvaluatePredicateResult"
    },
    "SessionSettingsJobSnapshot": {
      "type": "object",
      "properties": {
        "eventType": {
          "type": "string",
          "description": "GitHub Actions event type for the job."
        },
        "isTriggerJob": {
          "type": "boolean",
          "description": "Whether this is the workflow's trigger job."
        },
        "builtInToolAvailability": {
          "$ref": "#/definitions/SessionSettingsBuiltInToolAvailabilitySnapshot",
          "description": "Availability of job-specific built-in tools."
        }
      },
      "additionalProperties": false,
      "description": "Redacted job settings for a session. The job nonce is excluded.",
      "title": "SessionSettingsJobSnapshot"
    },
    "SessionSettingsModelSnapshot": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Selected model identifier."
        },
        "defaultReasoningEffort": {
          "type": "string",
          "description": "Default reasoning effort for the selected model."
        },
        "instanceId": {
          "type": "string",
          "description": "Agent job identifier for the session."
        },
        "callbackUrl": {
          "type": "string",
          "description": "Agent service callback URL for job and progress updates."
        }
      },
      "additionalProperties": false,
      "description": "Redacted model routing settings for a session.",
      "title": "SessionSettingsModelSnapshot"
    },
    "SessionSettingsOnlineEvaluationSnapshot": {
      "type": "object",
      "properties": {
        "disableOnlineEvaluation": {
          "type": "boolean",
          "description": "Whether online evaluation is disabled."
        },
        "enableOnlineEvaluationOutputFile": {
          "type": "boolean",
          "description": "Whether online-evaluation output-file generation is enabled."
        }
      },
      "additionalProperties": false,
      "description": "Online-evaluation settings safe to expose across the SDK boundary.",
      "title": "SessionSettingsOnlineEvaluationSnapshot"
    },
    "SessionSettingsPredicateName": {
      "type": "string",
      "enum": [
        "securityToolsEnabled",
        "thirdPartySecurityPromptEnabled",
        "parallelValidationEnabled",
        "runtimeTimingTelemetryEnabled",
        "coAuthorHookEnabled",
        "chronicleEnabled",
        "contentExclusionSelfFetchEnabled",
        "capClaudeOpusTokenLimitsEnabled",
        "codeReviewFeatureEnabled",
        "ccaUseTsAutofindEnabled",
        "dependencyCheckerEnabled",
        "dependabotCheckerEnabled",
        "codeqlCheckerEnabled",
        "trivialChangeEnabled",
        "trivialChangeSkipEnabled",
        "trivialChangeEnabledForCodeReview",
        "trivialChangeSkipEnabledForCodeReview",
        "trivialChangeEnabledForTool",
        "trivialChangeSkipEnabledForTool"
      ],
      "description": "Rust-owned settings predicates exposed across the SDK boundary. Raw feature-flag names are intentionally not part of the contract.",
      "title": "SessionSettingsPredicateName",
      "x-enumDescriptions": {
        "securityToolsEnabled": "Whether the security-tools feature flag enables security tool wiring.",
        "thirdPartySecurityPromptEnabled": "Whether third-party security tools should receive the security prompt.",
        "parallelValidationEnabled": "Whether validation may run in parallel.",
        "runtimeTimingTelemetryEnabled": "Whether runtime timing telemetry is enabled.",
        "coAuthorHookEnabled": "Whether the co-author hook is enabled.",
        "chronicleEnabled": "Whether Chronicle integration is enabled.",
        "contentExclusionSelfFetchEnabled": "Whether content-exclusion policy may self-fetch data.",
        "capClaudeOpusTokenLimitsEnabled": "Whether Claude Opus token-limit caps should be applied.",
        "codeReviewFeatureEnabled": "Whether code-review behavior is enabled.",
        "ccaUseTsAutofindEnabled": "Whether CCA should use the TypeScript autofind behavior.",
        "dependencyCheckerEnabled": "Whether the dependency checker is enabled.",
        "dependabotCheckerEnabled": "Whether the Dependabot checker is enabled.",
        "codeqlCheckerEnabled": "Whether the CodeQL checker is enabled.",
        "trivialChangeEnabled": "Whether trivial-change handling is enabled.",
        "trivialChangeSkipEnabled": "Whether trivial-change skip behavior is enabled.",
        "trivialChangeEnabledForCodeReview": "Whether trivial-change handling is enabled for code review.",
        "trivialChangeSkipEnabledForCodeReview": "Whether trivial-change skip behavior is enabled for code review.",
        "trivialChangeEnabledForTool": "Whether trivial-change handling is enabled for a specific tool.",
        "trivialChangeSkipEnabledForTool": "Whether trivial-change skip behavior is enabled for a specific tool."
      }
    },
    "SessionSettingsRepoSnapshot": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Repository name."
        },
        "id": {
          "type": "number",
          "description": "GitHub repository database ID."
        },
        "branch": {
          "type": "string",
          "description": "Checked-out repository branch."
        },
        "commit": {
          "type": "string",
          "description": "Checked-out commit SHA."
        },
        "readWrite": {
          "type": "boolean",
          "description": "Whether the repository is writable."
        },
        "ownerName": {
          "type": "string",
          "description": "Repository owner login."
        },
        "ownerId": {
          "type": "number",
          "description": "GitHub repository owner database ID."
        },
        "serverUrl": {
          "type": "string",
          "description": "GitHub server base URL."
        },
        "host": {
          "type": "string",
          "description": "GitHub server host name."
        },
        "hostProtocol": {
          "type": "string",
          "description": "Protocol used to access the GitHub host."
        },
        "secretScanningUrl": {
          "type": "string",
          "description": "GitHub secret-scanning service URL."
        },
        "prCommitCount": {
          "type": "number",
          "description": "Number of commits in the pull request."
        }
      },
      "additionalProperties": false,
      "description": "Redacted repository and GitHub host settings for a session.",
      "title": "SessionSettingsRepoSnapshot"
    },
    "SessionSettingsSnapshot": {
      "type": "object",
      "properties": {
        "version": {
          "type": "string",
          "description": "Agent runtime version selector copied from the session settings, such as `latest` or a runtime release identifier."
        },
        "clientName": {
          "type": "string",
          "description": "Name of the SDK client that created the session."
        },
        "timeoutMs": {
          "type": "number",
          "description": "Session timeout in milliseconds."
        },
        "startTimeMs": {
          "type": "number",
          "description": "Session start time as Unix epoch milliseconds."
        },
        "repo": {
          "$ref": "#/definitions/SessionSettingsRepoSnapshot",
          "description": "Redacted repository and host settings."
        },
        "model": {
          "$ref": "#/definitions/SessionSettingsModelSnapshot",
          "description": "Redacted model routing settings."
        },
        "validation": {
          "$ref": "#/definitions/SessionSettingsValidationSnapshot",
          "description": "Redacted validation and memory-tool settings."
        },
        "job": {
          "$ref": "#/definitions/SessionSettingsJobSnapshot",
          "description": "Redacted job settings."
        },
        "onlineEvaluation": {
          "$ref": "#/definitions/SessionSettingsOnlineEvaluationSnapshot",
          "description": "Online-evaluation settings safe for SDK consumers."
        }
      },
      "required": [
        "repo",
        "model",
        "validation",
        "job",
        "onlineEvaluation"
      ],
      "additionalProperties": false,
      "description": "Redacted, serializable view of session runtime settings for SDK boundary consumers. Secrets and raw feature flags are intentionally excluded.",
      "title": "SessionSettingsSnapshot"
    },
    "SessionSettingsValidationSnapshot": {
      "type": "object",
      "properties": {
        "timeout": {
          "type": "number",
          "description": "General validation timeout budget in seconds."
        },
        "dependabotTimeout": {
          "type": "number",
          "description": "Dependabot validation timeout budget in seconds."
        },
        "codeqlEnabled": {
          "type": "boolean",
          "description": "Whether CodeQL validation is enabled."
        },
        "codeReviewEnabled": {
          "type": "boolean",
          "description": "Whether code-review validation is enabled."
        },
        "codeReviewModel": {
          "type": "string",
          "description": "Model used for code-review validation."
        },
        "advisoryEnabled": {
          "type": "boolean",
          "description": "Whether advisory validation is enabled."
        },
        "secretScanningEnabled": {
          "type": "boolean",
          "description": "Whether secret-scanning validation is enabled."
        },
        "memoryStoreEnabled": {
          "type": "boolean",
          "description": "Whether the memory-store tool is enabled."
        },
        "memoryVoteEnabled": {
          "type": "boolean",
          "description": "Whether the memory-vote tool is enabled."
        }
      },
      "additionalProperties": false,
      "description": "Redacted validation and memory-tool settings for a session.",
      "title": "SessionSettingsValidationSnapshot"
    },
    "SessionsFindByPrefixRequest": {
      "type": "object",
      "properties": {
        "prefix": {
          "type": "string",
          "description": "UUID prefix (>=7 hex chars, <36 chars). Returns the unique session ID, or undefined when there is no match or the prefix matches multiple sessions."
        }
      },
      "required": [
        "prefix"
      ],
      "additionalProperties": false,
      "description": "UUID prefix to resolve to a unique session ID.",
      "title": "SessionsFindByPrefixRequest"
    },
    "SessionsFindByPrefixResult": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Omitted when no unique session matches the prefix (no match or ambiguous)"
        }
      },
      "additionalProperties": false,
      "description": "Session ID matching the prefix, omitted when no unique match exists.",
      "title": "SessionsFindByPrefixResult"
    },
    "SessionsFindByTaskIDRequest": {
      "type": "object",
      "properties": {
        "taskId": {
          "type": "string",
          "description": "GitHub task ID to look up"
        }
      },
      "required": [
        "taskId"
      ],
      "additionalProperties": false,
      "description": "GitHub task ID to look up.",
      "title": "SessionsFindByTaskIDRequest"
    },
    "SessionsFindByTaskIDResult": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Omitted when no local session is bound to that GitHub task"
        }
      },
      "additionalProperties": false,
      "description": "ID of the local session bound to the given GitHub task, or omitted when none.",
      "title": "SessionsFindByTaskIDResult"
    },
    "SessionsForkRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Source session ID to fork from"
        },
        "toEventId": {
          "type": "string",
          "description": "Optional event ID boundary. When provided, the fork includes only events before this ID (exclusive). When omitted, all events are included."
        },
        "name": {
          "type": "string",
          "description": "Optional friendly name to assign to the forked session."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Source session identifier to fork from, optional event-ID boundary, and optional friendly name for the new session.",
      "title": "SessionsForkRequest"
    },
    "SessionsForkResult": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "The new forked session's ID"
        },
        "name": {
          "type": "string",
          "description": "Friendly name assigned to the forked session, if any."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Identifier and optional friendly name assigned to the newly forked session.",
      "title": "SessionsForkResult"
    },
    "SessionsGetBoardEntryCountRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID whose board entry count should be returned."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID whose board entry count should be returned.",
      "title": "SessionsGetBoardEntryCountRequest"
    },
    "SessionsGetBoardEntryCountResult": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "Board entry count, when available."
        }
      },
      "additionalProperties": false,
      "description": "Dynamic-context board entry count, when available.",
      "title": "SessionsGetBoardEntryCountResult"
    },
    "SessionsGetEventFilePathRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID whose event-log file path to compute"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID whose event-log file path to compute.",
      "title": "SessionsGetEventFilePathRequest"
    },
    "SessionsGetEventFilePathResult": {
      "type": "object",
      "properties": {
        "filePath": {
          "type": "string",
          "description": "Absolute path to the session's events.jsonl file"
        }
      },
      "required": [
        "filePath"
      ],
      "additionalProperties": false,
      "description": "Absolute path to the session's events.jsonl file on disk.",
      "title": "SessionsGetEventFilePathResult"
    },
    "SessionsGetLastForContextRequest": {
      "type": "object",
      "properties": {
        "context": {
          "$ref": "#/definitions/SessionContext",
          "description": "Optional working-directory context used to score session relevance. When omitted the most-recently-modified session wins."
        }
      },
      "additionalProperties": false,
      "description": "Optional working-directory context used to score session relevance.",
      "title": "SessionsGetLastForContextRequest"
    },
    "SessionsGetLastForContextResult": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Most-relevant session ID for the supplied context, or omitted when no sessions exist"
        }
      },
      "additionalProperties": false,
      "description": "Most-relevant session ID for the supplied context, or omitted when no sessions exist.",
      "title": "SessionsGetLastForContextResult"
    },
    "SessionsGetMetadataRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID to inspect"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID whose persisted metadata should be read.",
      "title": "SessionsGetMetadataRequest"
    },
    "SessionsGetMetadataResult": {
      "type": "object",
      "properties": {
        "session": {
          "$ref": "#/definitions/LocalSessionMetadataValue",
          "description": "Local session metadata, omitted when the session does not exist."
        }
      },
      "additionalProperties": false,
      "description": "Persisted local session metadata when the session exists.",
      "title": "SessionsGetMetadataResult"
    },
    "SessionsGetPersistedRemoteSteerableRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID to look up the persisted remote-steerable flag for"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID to look up the persisted remote-steerable flag for.",
      "title": "SessionsGetPersistedRemoteSteerableRequest"
    },
    "SessionsGetPersistedRemoteSteerableResult": {
      "type": "object",
      "properties": {
        "remoteSteerable": {
          "type": "boolean",
          "description": "The session's persisted remote-steerable flag if recorded; omitted when no value has been persisted"
        }
      },
      "additionalProperties": false,
      "description": "The session's persisted remote-steerable flag, or omitted when no value has been persisted.",
      "title": "SessionsGetPersistedRemoteSteerableResult"
    },
    "SessionSizes": {
      "type": "object",
      "properties": {
        "sizes": {
          "type": "object",
          "additionalProperties": {
            "type": "integer",
            "minimum": 0
          },
          "description": "Map of sessionId -> on-disk size in bytes for the session's workspace directory"
        }
      },
      "required": [
        "sizes"
      ],
      "additionalProperties": false,
      "description": "Map of sessionId -> on-disk size in bytes for each session's workspace directory.",
      "title": "SessionSizes"
    },
    "SessionsListNonEmptySessionIdsRequest": {
      "type": "object",
      "properties": {
        "limit": {
          "type": "integer",
          "description": "Maximum number of session IDs to return."
        }
      },
      "additionalProperties": false,
      "description": "Limit for non-empty local session IDs.",
      "title": "SessionsListNonEmptySessionIdsRequest"
    },
    "SessionsListNonEmptySessionIdsResult": {
      "type": "object",
      "properties": {
        "sessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs ordered newest-first."
        }
      },
      "required": [
        "sessionIds"
      ],
      "additionalProperties": false,
      "description": "Recent local session IDs that contain user-visible history.",
      "title": "SessionsListNonEmptySessionIdsResult"
    },
    "SessionsListRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "source": {
              "$ref": "#/definitions/SessionSource",
              "description": "Which session sources to include. Defaults to `local` for backward compatibility."
            },
            "metadataLimit": {
              "type": "integer",
              "minimum": 0,
              "description": "When provided, only the first N local sessions (sorted by modification time, newest first) load full metadata; remaining sessions return basic info only. Use 0 to return only basic info for every local session. Has no effect on remote entries (which always carry their full shape)."
            },
            "filter": {
              "$ref": "#/definitions/SessionListFilter",
              "description": "Optional filter applied to the returned sessions"
            },
            "includeDetached": {
              "type": "boolean",
              "description": "When true, include detached maintenance sessions. Defaults to false for user-facing session lists."
            },
            "throwOnError": {
              "type": "boolean",
              "description": "Only meaningful when `source` includes remote. When true, propagates errors from the remote service instead of silently returning an empty remote list. Defaults to false."
            }
          },
          "additionalProperties": false,
          "description": "Optional source filter, metadata-load limit, and context filter applied to the returned sessions."
        }
      ],
      "description": "Optional source filter, metadata-load limit, and context filter applied to the returned sessions.",
      "title": "SessionsListRequest"
    },
    "SessionsLoadDeferredRepoHooksRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Active session ID whose deferred repo-level hooks should be loaded"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Active session ID whose deferred repo-level hooks should be loaded.",
      "title": "SessionsLoadDeferredRepoHooksRequest"
    },
    "SessionsOpenAttach": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "attach",
          "description": "Attach to an already-active in-process session by ID. Unlike `resume`, this does NOT re-load from disk; the session must already be loaded by an earlier `create`/`resume` call. Returns `status: 'not_found'` when no active session matches the id. Useful for in-process consumers that need a fresh API handle to a session opened elsewhere (e.g., a peer foreground-session switch)."
        },
        "sessionId": {
          "type": "string",
          "description": "Session ID to attach to."
        }
      },
      "required": [
        "kind",
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Parameters for attaching to an already-active session by ID.",
      "title": "SessionsOpenAttach"
    },
    "SessionsOpenCloud": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "cloud",
          "description": "Create a new cloud (coding-agent) session."
        },
        "repository": {
          "$ref": "#/definitions/RemoteSessionRepository",
          "description": "Repository for the cloud session."
        },
        "owner": {
          "type": "string",
          "description": "Optional owner (user or organization login) to associate with the cloud session when no repository is provided. Ignored when `repository` is set (the repo's owner takes precedence)."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session options for cloud session creation."
        },
        "onTaskCreated": {
          "description": "In-process callback invoked when the cloud task is created, before connection. Internal because function references cannot cross the JSON-RPC boundary.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Parameters for creating a new cloud session.",
      "title": "SessionsOpenCloud"
    },
    "SessionsOpenCreate": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "create",
          "description": "Create a new local session."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session construction options."
        },
        "emitStart": {
          "type": "boolean",
          "description": "Whether to emit session.start during creation. Defaults to true."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Parameters for creating a new local session.",
      "title": "SessionsOpenCreate"
    },
    "SessionsOpenHandoff": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "handoff",
          "description": "Fetch a remote session and hand it off to a new local session."
        },
        "metadata": {
          "$ref": "#/definitions/RemoteSessionMetadataValue",
          "description": "Remote session metadata for the session to hand off (typically obtained from `sessions.list` with `source: \"remote\"`)."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session construction options for the new local session."
        },
        "taskType": {
          "$ref": "#/definitions/SessionsOpenHandoffTaskType",
          "description": "Task type determines the handoff strategy (CCA fetches events; CLI prepares a transient session)."
        },
        "onProgress": {
          "description": "In-process progress callback `(update) => void` invoked for each handoff step. Marked internal because a function reference cannot cross the JSON-RPC boundary. The host-side `handoffSession` is already declared as `AsyncGenerator<HandoffProgress, HandoffResult>`; the schema layer flattens it because it does not yet support streaming methods. The wire-clean replacement is to expose the AsyncGenerator directly (or use vscode-jsonrpc `$/progress` notifications) once the schema/transport layer supports it.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "onConfirm": {
          "description": "In-process confirmation callback `(request) => boolean | Promise<boolean>` invoked when the handoff needs the caller to confirm a non-fatal blocker (e.g. a repository mismatch between the current working directory and the remote session). Returning `true` proceeds with the handoff; returning `false` (or omitting the callback) aborts it. Marked internal because a function reference cannot cross the JSON-RPC boundary, for the same reasons as `onProgress`.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "kind",
        "metadata"
      ],
      "additionalProperties": false,
      "description": "Parameters for fetching a remote session and handing it off to a new local session.",
      "title": "SessionsOpenHandoff"
    },
    "SessionsOpenHandoffTaskType": {
      "type": "string",
      "enum": [
        "cca",
        "cli"
      ],
      "description": "Task type determines the handoff strategy (CCA fetches events; CLI prepares a transient session).",
      "title": "SessionsOpenHandoffTaskType",
      "x-enumDescriptions": {
        "cca": "GitHub Copilot coding agent task.",
        "cli": "CLI remote task."
      }
    },
    "SessionsOpenProgress": {
      "type": "object",
      "properties": {
        "step": {
          "$ref": "#/definitions/SessionsOpenProgressStep",
          "description": "Handoff step."
        },
        "status": {
          "$ref": "#/definitions/SessionsOpenProgressStatus",
          "description": "Step status."
        },
        "message": {
          "type": "string",
          "description": "Optional step message."
        }
      },
      "required": [
        "step",
        "status"
      ],
      "additionalProperties": false,
      "description": "`sessions.open` handoff progress update with step, status, and optional message.",
      "title": "SessionsOpenProgress"
    },
    "SessionsOpenProgressStatus": {
      "type": "string",
      "enum": [
        "in-progress",
        "complete"
      ],
      "description": "Step status.",
      "title": "SessionsOpenProgressStatus",
      "x-enumDescriptions": {
        "in-progress": "The step has started and has not yet finished.",
        "complete": "The step has completed successfully."
      }
    },
    "SessionsOpenProgressStep": {
      "type": "string",
      "enum": [
        "load-session",
        "validate-repo",
        "check-changes",
        "checkout-branch",
        "create-session",
        "save-session"
      ],
      "description": "Handoff step.",
      "title": "SessionsOpenProgressStep",
      "x-enumDescriptions": {
        "load-session": "Loading the source session's events from the remote service.",
        "validate-repo": "Validating that the local repository matches the remote session's repository.",
        "check-changes": "Checking the local working tree for uncommitted changes that would block the handoff.",
        "checkout-branch": "Checking out the branch associated with the remote session in the local working tree.",
        "create-session": "Creating the new local session and seeding it with the source session's events.",
        "save-session": "Persisting the newly-created local session to disk."
      }
    },
    "SessionsOpenRemote": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "remote",
          "description": "Connect to a live remote session."
        },
        "remoteSessionId": {
          "type": "string",
          "description": "Remote session identifier to connect to."
        },
        "repository": {
          "$ref": "#/definitions/RemoteSessionRepository",
          "description": "Repository context for the remote session."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session options for the connection."
        }
      },
      "required": [
        "kind",
        "remoteSessionId"
      ],
      "additionalProperties": false,
      "description": "Parameters for connecting to a live remote session.",
      "title": "SessionsOpenRemote"
    },
    "SessionsOpenResume": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "resume",
          "description": "Resume a specific local session by ID or prefix."
        },
        "sessionId": {
          "type": "string",
          "description": "Session ID or unique prefix to resume."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session resume options."
        },
        "resume": {
          "type": "boolean",
          "description": "Whether to emit session.resume after loading. Defaults to true."
        },
        "suppressResumeWorkspaceMetadataWriteback": {
          "type": "boolean",
          "description": "Suppress workspace.yaml metadata writeback when resuming from an incidental cwd."
        }
      },
      "required": [
        "kind",
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Parameters for resuming a specific local session.",
      "title": "SessionsOpenResume"
    },
    "SessionsOpenResumeLast": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "resumeLast",
          "description": "Resume the most relevant existing local session."
        },
        "context": {
          "$ref": "#/definitions/SessionContext",
          "description": "Working-directory context used to choose the most relevant session."
        },
        "options": {
          "$ref": "#/definitions/SessionOpenOptions",
          "description": "Session resume options."
        },
        "suppressResumeWorkspaceMetadataWriteback": {
          "type": "boolean",
          "description": "Suppress workspace.yaml metadata writeback when resuming from an incidental cwd."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Parameters for resuming the most relevant local session.",
      "title": "SessionsOpenResumeLast"
    },
    "SessionsOpenStatus": {
      "type": "string",
      "enum": [
        "created",
        "resumed",
        "not_found",
        "connected",
        "handed_off"
      ],
      "description": "Outcome of the open request.",
      "title": "SessionsOpenStatus",
      "x-enumDescriptions": {
        "created": "A new session was created.",
        "resumed": "An existing session was loaded or reattached.",
        "not_found": "No matching persisted session was found.",
        "connected": "Connected to an existing remote session.",
        "handed_off": "Remote session was handed off to a new local session."
      }
    },
    "SessionSource": {
      "type": "string",
      "enum": [
        "local",
        "remote",
        "all"
      ],
      "description": "Which session sources to include. Defaults to `local` for backward compatibility.",
      "title": "SessionSource",
      "x-enumDescriptions": {
        "local": "Return only local sessions.",
        "remote": "Return only remote sessions.",
        "all": "Return both local and remote sessions."
      }
    },
    "SessionsPruneOldRequest": {
      "type": "object",
      "properties": {
        "olderThanDays": {
          "type": "integer",
          "minimum": 0,
          "description": "Delete sessions whose modifiedTime is at least this many days old"
        },
        "dryRun": {
          "type": "boolean",
          "description": "When true, only report what would be deleted without performing any deletion"
        },
        "includeNamed": {
          "type": "boolean",
          "description": "When true, named sessions (set via /rename) are also eligible for pruning"
        },
        "excludeSessionIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Session IDs that should never be considered for pruning"
        }
      },
      "required": [
        "olderThanDays"
      ],
      "additionalProperties": false,
      "description": "Age threshold and optional flags controlling which old sessions are pruned (or simulated when dryRun is true).",
      "title": "SessionsPruneOldRequest"
    },
    "SessionsReadPersistedEventsRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID whose persisted event journal should be read."
        },
        "cursor": {
          "type": "string",
          "description": "Opaque cursor returned by a previous persisted-event read. Omit on the first call."
        },
        "max": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 1000,
          "description": "Maximum number of events to return in this batch (1–1000, default 200)."
        },
        "direction": {
          "$ref": "#/definitions/EventsReadDirection",
          "description": "Direction to page through persisted history. Forward starts at the beginning; backward starts with the newest events. Events in each page remain chronological."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Pagination options for reading an inactive or active local session's persisted event journal.",
      "title": "SessionsReadPersistedEventsRequest"
    },
    "SessionsRegisterExtensionToolsOnSessionOptions": {
      "type": "object",
      "properties": {
        "enabled": {
          "description": "In-process `() => boolean` gating callback used only by the CLI.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "additionalProperties": false,
      "description": "Optional registration options.",
      "title": "SessionsRegisterExtensionToolsOnSessionOptions"
    },
    "SessionsReleaseLockRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID whose in-use lock should be released"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID whose in-use lock should be released.",
      "title": "SessionsReleaseLockRequest"
    },
    "SessionsReleaseLockResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Release the in-use lock held by this process for the given session. No-op when this process does not currently hold a lock for the session.",
      "title": "SessionsReleaseLockResult"
    },
    "SessionsReloadPluginHooksRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Active session ID to reload hooks for"
        },
        "deferRepoHooks": {
          "type": "boolean",
          "description": "When true, skip repo-level hooks. Use before folder trust is confirmed; loadDeferredRepoHooks loads them post-trust."
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Active session ID and an optional flag for deferring repo-level hooks until folder trust.",
      "title": "SessionsReloadPluginHooksRequest"
    },
    "SessionsReloadPluginHooksResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Reload all hooks (user, plugin, optionally repo) and apply them to the active session. Call after installing or removing plugins so their hooks take effect immediately. No-op when no active session matches the given sessionId.",
      "title": "SessionsReloadPluginHooksResult"
    },
    "SessionsSaveRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Session ID whose pending events should be flushed to disk"
        }
      },
      "required": [
        "sessionId"
      ],
      "additionalProperties": false,
      "description": "Session ID whose pending events should be flushed to disk.",
      "title": "SessionsSaveRequest"
    },
    "SessionsSaveResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Flush a session's pending events to disk. No-op when no writer exists for the session (e.g., already closed).",
      "title": "SessionsSaveResult"
    },
    "SessionsSetAdditionalPluginsRequest": {
      "type": "object",
      "properties": {
        "plugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InstalledPlugin",
            "description": "Installed plugin record from global state, with marketplace, version, install time, enabled state, cache path, and source."
          },
          "description": "Manager-wide additional plugins to register. Replaces any previously-configured set. Pass an empty array to clear."
        }
      },
      "required": [
        "plugins"
      ],
      "additionalProperties": false,
      "description": "Manager-wide additional plugins to register; replaces any previously-configured set.",
      "title": "SessionsSetAdditionalPluginsRequest"
    },
    "SessionsSetAdditionalPluginsResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Replace the manager-wide additional plugins. New session creations and subsequent hook reloads see the new set; already-running sessions keep their existing hook installation until the next reload.",
      "title": "SessionsSetAdditionalPluginsResult"
    },
    "SessionsSetRemoteControlSteeringRequest": {
      "type": "object",
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Target steering state. Today only `true` is actionable on the underlying exporter; `false` is reserved for future use."
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Patch for the singleton's steering state.",
      "title": "SessionsSetRemoteControlSteeringRequest"
    },
    "SessionsStartRemoteControlRequest": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string",
          "description": "Local session id to attach remote control to."
        },
        "config": {
          "$ref": "#/definitions/RemoteControlConfig",
          "description": "Configuration for the runtime-managed remote-control singleton."
        }
      },
      "required": [
        "sessionId",
        "config"
      ],
      "additionalProperties": false,
      "description": "Parameters for attaching the remote-control singleton to a session.",
      "title": "SessionsStartRemoteControlRequest"
    },
    "SessionsStopRemoteControlRequest": {
      "anyOf": [
        {
          "not": {}
        },
        {
          "type": "object",
          "properties": {
            "expectedSessionId": {
              "type": "string",
              "description": "When provided, the stop is rejected unless the singleton currently points at this session id (compare-and-swap semantics)."
            },
            "force": {
              "type": "boolean",
              "description": "When true, the singleton is unconditionally torn down regardless of `expectedSessionId`. Use during shutdown or explicit `/remote off`."
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "Parameters for stopping the remote-control singleton.",
      "title": "SessionsStopRemoteControlRequest"
    },
    "SessionsTransferRemoteControlRequest": {
      "type": "object",
      "properties": {
        "toSessionId": {
          "type": "string",
          "description": "Local session id to point remote control at."
        },
        "expectedFromSessionId": {
          "type": "string",
          "description": "When provided, the transfer is rejected unless the singleton currently points at this session id (compare-and-swap semantics to avoid clobbering newer state)."
        }
      },
      "required": [
        "toSessionId"
      ],
      "additionalProperties": false,
      "description": "Parameters for atomically rebinding the remote-control singleton.",
      "title": "SessionsTransferRemoteControlRequest"
    },
    "SessionTelemetryEngagement": {
      "type": "object",
      "properties": {
        "engagementId": {
          "type": "string",
          "description": "Current telemetry engagement ID, when available."
        }
      },
      "additionalProperties": false,
      "description": "Telemetry engagement ID for the session, when available.",
      "title": "SessionTelemetryEngagement"
    },
    "SessionUpdateOptionsParams": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "The model ID to use for assistant turns."
        },
        "modelCapabilitiesOverrides": {
          "$ref": "#/definitions/ModelCapabilitiesOverride",
          "description": "Per-property model capability overrides for the selected model."
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort for the selected model. CAPI values are model-defined and validated against the selected model; BYOK providers may define additional values. When omitted, no effort override is applied."
        },
        "reasoningSummary": {
          "$ref": "#/definitions/OptionsUpdateReasoningSummary",
          "description": "Reasoning summary mode for supported model clients."
        },
        "verbosity": {
          "$ref": "#/definitions/Verbosity",
          "description": "Output verbosity level for supported models."
        },
        "clientName": {
          "type": "string",
          "description": "Identifier of the client driving the session."
        },
        "lspClientName": {
          "type": "string",
          "description": "Identifier sent to LSP-style integrations."
        },
        "integrationId": {
          "type": "string",
          "description": "Stable integration identifier used for analytics and rate-limit attribution."
        },
        "featureFlags": {
          "type": "object",
          "additionalProperties": {
            "type": "boolean"
          },
          "description": "Map of feature-flag IDs to their boolean enabled state."
        },
        "isExperimentalMode": {
          "type": "boolean",
          "description": "Whether experimental capabilities are enabled."
        },
        "provider": {
          "$ref": "#/definitions/ProviderConfig",
          "description": "Custom model-provider configuration (BYOK)."
        },
        "capi": {
          "$ref": "#/definitions/CapiSessionOptions",
          "description": "Options scoped to the built-in CAPI (Copilot API) provider."
        },
        "workingDirectory": {
          "type": "string",
          "description": "Absolute working-directory path for shell tools."
        },
        "availableTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowlist of tool names available to this session."
        },
        "excludedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Denylist of tool names for this session."
        },
        "includedBuiltinAgents": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "Built-in subagent names to include in this session. When specified, only these built-ins are available, subject to runtime availability and exclusions. Custom agents with the same name remain available. Set to null to remove the allowlist restriction."
        },
        "excludedBuiltinAgents": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Built-in subagent names to exclude from this session. Excluded built-ins are hidden from agent discovery and cannot be dispatched unless a custom agent with the same name is available."
        },
        "toolFilterPrecedence": {
          "$ref": "#/definitions/OptionsUpdateToolFilterPrecedence",
          "description": "Controls how availableTools (allowlist) and excludedTools (denylist) combine when both are set."
        },
        "enableScriptSafety": {
          "type": "boolean",
          "description": "Whether shell-script safety heuristics are enabled."
        },
        "shell": {
          "$ref": "#/definitions/ShellOptions",
          "description": "Per-session settings for built-in shell tools."
        },
        "shellInitProfile": {
          "type": "string",
          "description": "Use shell.initProfile instead. Shell init profile (`None` or `NonInteractive`).",
          "deprecated": true
        },
        "shellProcessFlags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "PowerShell process flags applied to built-in and user-requested shell commands."
        },
        "sandboxConfig": {
          "$ref": "#/definitions/SandboxConfig",
          "description": "Resolved sandbox configuration."
        },
        "sandboxConfigSource": {
          "$ref": "#/definitions/SandboxConfigSource",
          "description": "Origin of the sandbox choice. The runtime uses this only for internal telemetry provenance; managed policy is derived independently.",
          "visibility": "internal"
        },
        "logInteractiveShells": {
          "type": "boolean",
          "description": "Whether interactive shell sessions are logged."
        },
        "envValueMode": {
          "$ref": "#/definitions/OptionsUpdateEnvValueMode",
          "description": "How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch)."
        },
        "allowAllMcpServerInstructions": {
          "type": "boolean",
          "description": "Whether to include instructions from every MCP server in the system prompt instead of only allowlisted servers."
        },
        "skillDirectories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Additional directories to search for skills."
        },
        "includedBuiltinSkills": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "Built-in skill names to include in this session. When specified, only these runtime-bundled skills are available. Skills from other sources with the same name remain available. Set to null to remove the allowlist restriction."
        },
        "disabledSkills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Skill IDs that should be excluded from this session."
        },
        "enableOnDemandInstructionDiscovery": {
          "type": "boolean",
          "description": "Whether to discover custom instructions on demand after successful file views (AGENTS.md / CLAUDE.md / .github/copilot-instructions.md surfacing). Combined with `skipCustomInstructions`."
        },
        "maxInlineBinaryBytes": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum decoded byte size of a single model-facing binary tool result (e.g. an image) persisted inline in session events and re-presented to the model on later turns / resume. Larger results are persisted as a metadata-only marker and shown to the model as a short text note. Defaults to 10 MB."
        },
        "installedPlugins": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionInstalledPlugin",
            "description": "Installed plugin record for a session, with marketplace, version, install time, enabled state, cache path, and source."
          },
          "description": "Full set of installed plugins for the session. Replaces the existing list; the runtime invalidates the skills cache only when the list materially changes."
        },
        "customAgentsLocalOnly": {
          "type": "boolean",
          "description": "Whether to default custom agents to local-only execution."
        },
        "suppressCustomAgentPrompt": {
          "type": "boolean",
          "description": "When true, the selected custom agent's prompt is not injected into the user message (skill context is still injected). Used by automation triggers where the agent prompt is already in the problem statement."
        },
        "skipCustomInstructions": {
          "type": "boolean",
          "description": "Whether to skip loading custom instruction sources."
        },
        "disabledInstructionSources": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Instruction source IDs to exclude from the system prompt."
        },
        "coauthorEnabled": {
          "type": "boolean",
          "description": "Whether to include the `Co-authored-by` trailer in commit messages."
        },
        "trajectoryFile": {
          "type": "string",
          "description": "Optional path for trajectory output."
        },
        "enableStreaming": {
          "type": "boolean",
          "description": "Whether to stream model responses."
        },
        "copilotUrl": {
          "type": "string",
          "description": "Override URL for the Copilot API endpoint."
        },
        "askUserDisabled": {
          "type": "boolean",
          "description": "Whether to disable the `ask_user` tool (encourages autonomous behavior)."
        },
        "continueOnAutoMode": {
          "type": "boolean",
          "description": "Whether to allow auto-mode continuation across turns."
        },
        "runningInInteractiveMode": {
          "type": "boolean",
          "description": "Whether the session is running in an interactive UI."
        },
        "enableReasoningSummaries": {
          "type": "boolean",
          "description": "Whether to surface reasoning-summary events from the model."
        },
        "agentContext": {
          "type": "string",
          "description": "Runtime context discriminator (e.g., `cli`, `actions`)."
        },
        "eventsLogDirectory": {
          "type": "string",
          "description": "Override directory for the session-events log. When unset, the runtime's default events log directory is used."
        },
        "eventsLogIncludesSubagents": {
          "type": "boolean",
          "description": "Whether subagent callback events should be forwarded into the session event log sink."
        },
        "additionalContentExclusionPolicies": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/OptionsUpdateAdditionalContentExclusionPolicy",
            "description": "Content-exclusion policy supplied to `session.options.update`, with rules, last-updated data, and scope."
          },
          "description": "Additional content-exclusion policies to merge into the session's policy set.",
          "stability": "experimental"
        },
        "manageScheduleEnabled": {
          "type": "boolean",
          "description": "Whether to expose the `manage_schedule` tool to the agent. The runtime always owns the per-session schedule registry; this flag only controls tool exposure (typically gated to staff users)."
        },
        "sessionCapabilities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SessionCapability",
            "description": "Session capability id"
          },
          "description": "Replaces the session's capability set with the given list. Use to enable or disable capabilities mid-session (e.g., remove `memory` for reproducible scripted runs). Omit the field to leave the existing capability set unchanged."
        },
        "skipEmbeddingRetrieval": {
          "type": "boolean",
          "description": "Whether to skip embedding retrieval pipeline initialization and execution."
        },
        "organizationCustomInstructions": {
          "type": "string",
          "description": "Organization-level custom instructions to inject into the system prompt."
        },
        "enableFileHooks": {
          "type": "boolean",
          "description": "Whether to enable loading of `.github/hooks/` filesystem hooks. Separate from the SDK callback hook mechanism."
        },
        "enableHostGitOperations": {
          "type": "boolean",
          "description": "Whether to enable host git operations (context resolution, child repo scanning, git info in system prompt)."
        },
        "enableSessionStore": {
          "type": "boolean",
          "description": "Whether to enable cross-session store writes and reads."
        },
        "enableSkills": {
          "type": "boolean",
          "description": "Whether to enable skill directory scanning and loading. Falls back to enableConfigDiscovery when unset."
        },
        "contextTier": {
          "$ref": "#/definitions/OptionsUpdateContextTier",
          "description": "Context tier for models with tiered pricing. The session uses this to derive effective `modelCapabilitiesOverrides` so compaction, truncation, token display, and request limits honor the selected tier."
        },
        "sessionLimits": {
          "anyOf": [
            {
              "$ref": "#/definitions/SessionLimitsConfig",
              "description": "Optional session limits."
            },
            {
              "type": "null"
            }
          ],
          "description": "Optional session limits. Pass null to clear the session limits."
        }
      },
      "additionalProperties": false,
      "description": "Patch of mutable session options to apply to the running session.",
      "title": "SessionUpdateOptionsParams",
      "stability": "experimental"
    },
    "SessionUpdateOptionsResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the operation succeeded"
        },
        "pluginHookCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of hooks loaded from installed plugins, returned when installedPlugins is updated"
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the session options patch was applied successfully.",
      "title": "SessionUpdateOptionsResult"
    },
    "SessionVisibilityStatus": {
      "type": "string",
      "enum": [
        "repo",
        "unshared"
      ],
      "description": "Sharing status for a synced session. \"repo\" makes the session visible to anyone with read access to the repository; \"unshared\" restricts it to the creator and collaborators.",
      "title": "SessionVisibilityStatus",
      "x-enumDescriptions": {
        "repo": "The session is visible to repository readers.",
        "unshared": "The session is restricted to its creator and collaborators."
      }
    },
    "SessionWorkingDirectoryContext": {
      "type": "object",
      "properties": {
        "cwd": {
          "type": "string",
          "description": "Current working directory path"
        },
        "gitRoot": {
          "type": "string",
          "description": "Root directory of the git repository, resolved via git rev-parse"
        },
        "repository": {
          "type": "string",
          "description": "Repository identifier derived from the git remote URL (\"owner/name\" for GitHub, \"org/project/repo\" for Azure DevOps)"
        },
        "hostType": {
          "$ref": "#/definitions/SessionWorkingDirectoryContextHostType",
          "description": "Hosting platform type of the repository"
        },
        "repositoryHost": {
          "type": "string",
          "description": "Raw host string from the git remote URL (e.g. \"github.com\", \"dev.azure.com\")"
        },
        "branch": {
          "type": "string",
          "description": "Current git branch name"
        },
        "headCommit": {
          "type": "string",
          "description": "Head commit of the current git branch"
        },
        "baseCommit": {
          "type": "string",
          "description": "Merge-base commit SHA (fork point from the remote default branch)"
        }
      },
      "required": [
        "cwd"
      ],
      "additionalProperties": false,
      "description": "Updated working directory and git context. Emitted as the new payload of `session.context_changed`.",
      "title": "SessionWorkingDirectoryContext"
    },
    "SessionWorkingDirectoryContextHostType": {
      "type": "string",
      "enum": [
        "github",
        "ado"
      ],
      "description": "Hosting platform type of the repository",
      "title": "SessionWorkingDirectoryContextHostType",
      "x-enumDescriptions": {
        "github": "The working directory repository is hosted on GitHub.",
        "ado": "The working directory repository is hosted on Azure DevOps."
      }
    },
    "SettableAuthInfo": {
      "anyOf": [
        {
          "$ref": "#/definitions/HMACAuthInfo",
          "description": "Authentication-info input variant for GitHub-internal HMAC auth, carrying the public GitHub host and HMAC secret."
        },
        {
          "$ref": "#/definitions/EnvAuthInfo",
          "description": "Authentication-info input variant for a token sourced from an environment variable, with host, optional login, token, and env var name."
        },
        {
          "$ref": "#/definitions/SettableTokenAuthInfo",
          "description": "Token authentication accepted by session.gitHubAuth.setCredentials."
        },
        {
          "$ref": "#/definitions/CopilotApiTokenAuthInfo",
          "description": "Authentication-info variant for direct Copilot API token auth sourced from environment variables, with public GitHub host."
        },
        {
          "$ref": "#/definitions/UserAuthInfo",
          "description": "Authentication-info variant for OAuth user auth, with host and login; the token remains in the runtime secret store."
        },
        {
          "$ref": "#/definitions/GhCliAuthInfo",
          "description": "Authentication-info input variant for GitHub CLI credentials, carrying host, login, and the `gh auth token` value."
        },
        {
          "$ref": "#/definitions/ApiKeyAuthInfo",
          "description": "Authentication-info input variant for API-key authentication to a non-GitHub LLM provider, carrying the secret `apiKey` and host."
        }
      ],
      "description": "Authentication credentials accepted by session.gitHubAuth.setCredentials. Session-owned token-provider identities cannot be installed through this method.",
      "title": "SettableAuthInfo"
    },
    "SettableTokenAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "token",
          "description": "SDK-side token authentication; the host configured the token directly via the SDK."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "token": {
          "type": "string",
          "description": "The token value itself. Treat as a secret."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "token"
      ],
      "additionalProperties": false,
      "description": "Token authentication accepted by session.gitHubAuth.setCredentials.",
      "title": "SettableTokenAuthInfo"
    },
    "ShellCancelUserRequestedRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Request ID previously passed to executeUserRequested"
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "User-requested shell execution cancellation handle.",
      "title": "ShellCancelUserRequestedRequest",
      "stability": "experimental"
    },
    "ShellCredentials": {
      "type": "object",
      "properties": {
        "git": {
          "type": "boolean",
          "description": "Whether to authenticate the agent's `git` commands as the session's GitHub credential, by\ninjecting an `http.<host>.extraheader` (plus `insteadOf` rewrites so SSH-spelled remotes for\nthat host use the authenticated HTTPS transport). Applied only to a spawn that runs a\nremote-contacting `git` subcommand. Default: false (opt-in)."
        },
        "gh": {
          "type": "boolean",
          "description": "Whether to authenticate the agent's `gh` commands as the session's GitHub credential, by\nexporting `GH_TOKEN` to a spawn that runs `gh`. Any inherited `gh` credential is removed from\nspawns that do not, so the credential stays command-scoped.\n\nApplies to a github.com credential only. `gh` picks its credential variable from the host a\ncommand targets rather than the one the credential belongs to, and the command can choose that\ntarget, so `GH_ENTERPRISE_TOKEN` would offer a single-tenant enterprise credential to every\nother enterprise host. A session whose credential is enterprise-scoped therefore runs `gh`\nunauthenticated; its `git` commands are unaffected, because `http.<host>.extraheader` is scoped\nto one host by construction. Default: false (opt-in)."
        }
      },
      "additionalProperties": false,
      "description": "Command-scoped GitHub credential injection for the shell commands an agent runs.\n\nEach channel is opt-in and independent, and injection is scoped to the individual command\nspawn: the credential is resolved from the session's *current* authentication at every spawn\nand reaches only spawns whose script actually invokes `git` or `gh`. Because nothing is\nretained between spawns, replacing the session credential (`session.gitHubAuth.setCredentials`)\nchanges what the next spawned command presents — which seeding a credential into the runtime\nprocess's own environment cannot do, since a child's environment is fixed at `exec`.\n\nThe credential is matched to the host it authenticates to, so a github.com credential is never\npresented to a GitHub Enterprise host and vice versa. Where a channel cannot express that\nboundary it injects nothing rather than crossing it -- see `gh` below.\n\nThis is independent of `sandboxConfig`: it is a decision about which identity the agent\npresents, not about what the agent may touch, and it works on every platform whether or not\nan OS sandboxing backend is available. `sandboxConfig.auth` remains the sandbox-scoped\nspelling and is additive with this one.",
      "title": "ShellCredentials",
      "stability": "experimental"
    },
    "ShellExecRequest": {
      "type": "object",
      "properties": {
        "command": {
          "type": "string",
          "description": "Shell command to execute"
        },
        "cwd": {
          "type": "string",
          "description": "Working directory (defaults to session working directory)"
        },
        "timeout": {
          "type": "integer",
          "minimum": 0,
          "format": "duration",
          "description": "Timeout in milliseconds (default: 30000)"
        }
      },
      "required": [
        "command"
      ],
      "additionalProperties": false,
      "description": "Shell command to run, with optional working directory and timeout in milliseconds.",
      "title": "ShellExecRequest",
      "stability": "experimental"
    },
    "ShellExecResult": {
      "type": "object",
      "properties": {
        "processId": {
          "type": "string",
          "description": "Unique identifier for tracking streamed output"
        }
      },
      "required": [
        "processId"
      ],
      "additionalProperties": false,
      "description": "Identifier of the spawned process, used to correlate streamed output and exit notifications.",
      "title": "ShellExecResult"
    },
    "ShellExecuteUserRequestedRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "Caller-provided cancellation handle for this execution"
        },
        "command": {
          "type": "string",
          "description": "Shell command to execute"
        }
      },
      "required": [
        "requestId",
        "command"
      ],
      "additionalProperties": false,
      "description": "User-requested shell command and cancellation handle.",
      "title": "ShellExecuteUserRequestedRequest",
      "stability": "experimental"
    },
    "ShellInitProfile": {
      "type": "string",
      "enum": [
        "none",
        "non-interactive"
      ],
      "description": "Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected.",
      "title": "ShellInitProfile",
      "x-enumDescriptions": {
        "none": "Disable automatic non-interactive profile loading. Explicit initScripts still run.",
        "non-interactive": "Allow automatic non-interactive profile loading when supported. Explicit initScripts still run."
      }
    },
    "ShellInitScript": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to the script to source."
        },
        "shell": {
          "$ref": "#/definitions/ShellInitScriptShell",
          "description": "Built-in shell that may source this script."
        }
      },
      "required": [
        "path",
        "shell"
      ],
      "additionalProperties": false,
      "description": "A host-provided script sourced before each built-in shell command when its shell target matches the active shell.",
      "title": "ShellInitScript"
    },
    "ShellInitScriptShell": {
      "type": "string",
      "enum": [
        "bash",
        "powershell"
      ],
      "description": "Supported built-in shells for initialization scripts.",
      "title": "ShellInitScriptShell",
      "x-enumDescriptions": {
        "bash": "Source the script in the built-in Bash shell on macOS and Linux.",
        "powershell": "Source the script in the built-in PowerShell shell on Windows."
      }
    },
    "ShellKillRequest": {
      "type": "object",
      "properties": {
        "processId": {
          "type": "string",
          "description": "Process identifier returned by shell.exec"
        },
        "signal": {
          "$ref": "#/definitions/ShellKillSignal",
          "description": "Signal to send (default: SIGTERM)"
        }
      },
      "required": [
        "processId"
      ],
      "additionalProperties": false,
      "description": "Identifier of a process previously returned by \"shell.exec\" and the signal to send.",
      "title": "ShellKillRequest",
      "stability": "experimental"
    },
    "ShellKillResult": {
      "type": "object",
      "properties": {
        "killed": {
          "type": "boolean",
          "description": "Whether the signal was sent successfully"
        }
      },
      "required": [
        "killed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the signal was delivered; false if the process was unknown or already exited.",
      "title": "ShellKillResult"
    },
    "ShellKillSignal": {
      "type": "string",
      "enum": [
        "SIGTERM",
        "SIGKILL",
        "SIGINT"
      ],
      "description": "Signal to send (default: SIGTERM)",
      "title": "ShellKillSignal",
      "x-enumDescriptions": {
        "SIGTERM": "Request graceful process termination.",
        "SIGKILL": "Forcefully terminate the process.",
        "SIGINT": "Send an interrupt signal to the process."
      }
    },
    "ShellOptions": {
      "type": "object",
      "properties": {
        "initProfile": {
          "$ref": "#/definitions/ShellInitProfile",
          "description": "Controls automatic non-interactive profile loading where supported. Explicit initScripts are unaffected."
        },
        "initScripts": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ShellInitScript",
            "description": "A host-provided script sourced before each built-in shell command when its shell target matches the active shell."
          },
          "description": "Ordered host-provided script paths sourced before each built-in shell command when the\nentry's shell target matches the active shell. Use these for rc files, environment setup scripts,\nor other custom scripts. A script that returns a nonzero status is reported, and later scripts\nand the user command continue while the shell remains running. Because scripts are sourced into\nthe command shell, `exit`, `exec`, failures under `set -e`, or other shell-terminating behavior\ncan prevent continuation. Script standard output is preserved; Bash script stderr is discarded,\nPowerShell exception messages are replaced, and runtime-generated failure notices omit\nconfigured script paths. When sandboxing is enabled, each script must already be readable under\nthe active sandbox filesystem policy. Pass an empty array to clear the list."
        },
        "processFlags": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Flags passed to the active built-in shell process on startup, replacing its default flags.\nWhen omitted, the built-in Bash shell uses `--norc --noprofile`,\nand the built-in PowerShell shell uses `-NoProfile -NoLogo`."
        },
        "credentials": {
          "$ref": "#/definitions/ShellCredentials",
          "description": "Command-scoped GitHub credential injection for shell commands."
        }
      },
      "additionalProperties": false,
      "description": "Per-session settings for built-in shell tools.",
      "title": "ShellOptions"
    },
    "ShutdownRequest": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/ShutdownType",
          "description": "Why the session is being shut down. Defaults to \"routine\" when omitted."
        },
        "reason": {
          "type": "string",
          "description": "Optional human-readable reason. Typically the message of the error that triggered shutdown when type is 'error'."
        }
      },
      "additionalProperties": false,
      "description": "Parameters for shutting down the session",
      "title": "ShutdownRequest",
      "stability": "experimental"
    },
    "ShutdownType": {
      "type": "string",
      "enum": [
        "routine",
        "error"
      ],
      "description": "Why the session is being shut down. Defaults to \"routine\" when omitted.",
      "title": "ShutdownType",
      "x-enumDescriptions": {
        "routine": "The session is shutting down normally.",
        "error": "The session is shutting down because of an error."
      }
    },
    "Skill": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique identifier for the skill"
        },
        "commandName": {
          "type": "string",
          "description": "Canonical slash command name used to invoke the skill, without the leading '/'"
        },
        "description": {
          "type": "string",
          "description": "Description of what the skill does"
        },
        "source": {
          "$ref": "#/definitions/SkillSource",
          "description": "Source location type (e.g., project, personal-copilot, plugin, builtin)"
        },
        "userInvocable": {
          "type": "boolean",
          "description": "Whether the skill can be invoked by the user as a slash command"
        },
        "enabled": {
          "type": "boolean",
          "description": "Whether the skill is currently enabled"
        },
        "path": {
          "type": "string",
          "description": "Absolute path to the skill file"
        },
        "pluginName": {
          "type": "string",
          "description": "Name of the plugin that provides the skill, when source is 'plugin'"
        },
        "argumentHint": {
          "type": "string",
          "description": "Optional freeform hint describing the skill's expected arguments, from the `argument-hint` frontmatter field"
        }
      },
      "required": [
        "name",
        "description",
        "source",
        "userInvocable",
        "enabled"
      ],
      "additionalProperties": false,
      "description": "Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint.",
      "title": "Skill"
    },
    "SkillDiscoveryPath": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Absolute path of the create/discovery target (may not exist on disk yet)"
        },
        "scope": {
          "$ref": "#/definitions/SkillDiscoveryScope",
          "description": "Which tier this directory belongs to"
        },
        "preferredForCreation": {
          "type": "boolean",
          "description": "Whether this is the canonical directory to create a new skill in its tier. At most one entry per tier is preferred; the `personal-agents` and `custom` scopes are never preferred."
        },
        "projectPath": {
          "type": "string",
          "description": "The input project path this directory was derived from (only for project scope)"
        }
      },
      "required": [
        "path",
        "scope",
        "preferredForCreation"
      ],
      "additionalProperties": false,
      "description": "Canonical directory where skills can be discovered or created, with scope, preference, and optional project path.",
      "title": "SkillDiscoveryPath"
    },
    "SkillDiscoveryPathList": {
      "type": "object",
      "properties": {
        "paths": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SkillDiscoveryPath",
            "description": "Canonical directory where skills can be discovered or created, with scope, preference, and optional project path."
          },
          "description": "Canonical skill create/discovery directories, in priority order"
        }
      },
      "required": [
        "paths"
      ],
      "additionalProperties": false,
      "description": "Canonical locations where skills can be created so the runtime will recognize them.",
      "title": "SkillDiscoveryPathList"
    },
    "SkillDiscoveryScope": {
      "type": "string",
      "enum": [
        "project",
        "personal-copilot",
        "personal-agents",
        "custom"
      ],
      "description": "Which tier this directory belongs to",
      "title": "SkillDiscoveryScope",
      "x-enumDescriptions": {
        "project": "A project's repository skill directory.",
        "personal-copilot": "The user's personal Copilot skill directory.",
        "personal-agents": "The user's personal agents skill directory.",
        "custom": "A configured custom skill directory."
      }
    },
    "SkillList": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Skill",
            "description": "Skill metadata available to a session, with name, description, source, enabled/invocable state, path, plugin, and argument hint."
          },
          "description": "Available skills"
        }
      },
      "required": [
        "skills"
      ],
      "additionalProperties": false,
      "description": "Skills available to the session, with their enabled state.",
      "title": "SkillList"
    },
    "SkillsConfigSetDisabledSkillsRequest": {
      "type": "object",
      "properties": {
        "disabledSkills": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of skill names to disable"
        }
      },
      "required": [
        "disabledSkills"
      ],
      "additionalProperties": false,
      "description": "Skill names to mark as disabled in global configuration, replacing any previous list.",
      "title": "SkillsConfigSetDisabledSkillsRequest"
    },
    "SkillsConfigSetSkillDisabledRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the skill to add to or remove from the disabled list"
        },
        "disabled": {
          "type": "boolean",
          "description": "True to disable the skill, false to enable it"
        }
      },
      "required": [
        "name",
        "disabled"
      ],
      "additionalProperties": false,
      "description": "Adds or removes a single skill from the global disabled list, leaving every other entry untouched.",
      "title": "SkillsConfigSetSkillDisabledRequest"
    },
    "SkillsDisableRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the skill to disable"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name of the skill to disable for the session.",
      "title": "SkillsDisableRequest",
      "stability": "experimental"
    },
    "SkillsDiscoverRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths to scan for project-scoped skills"
        },
        "skillDirectories": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of additional skill directory paths to include"
        },
        "excludeHostSkills": {
          "type": "boolean",
          "description": "When true, omit skills from the host's global sources (personal, custom, plugin, and built-in), returning only project-scoped skills. For multitenant deployments."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths and additional skill directories to include in discovery.",
      "title": "SkillsDiscoverRequest"
    },
    "SkillsEnableRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the skill to enable"
        }
      },
      "required": [
        "name"
      ],
      "additionalProperties": false,
      "description": "Name of the skill to enable for the session.",
      "title": "SkillsEnableRequest",
      "stability": "experimental"
    },
    "SkillsGetDiscoveryPathsRequest": {
      "type": "object",
      "properties": {
        "projectPaths": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional list of project directory paths. When omitted or empty, only personal and custom directories are returned."
        },
        "excludeHostSkills": {
          "type": "boolean",
          "description": "When true, omit the host's personal and custom skill directories, leaving only project directories. For multitenant deployments."
        }
      },
      "additionalProperties": false,
      "description": "Optional project paths to enumerate.",
      "title": "SkillsGetDiscoveryPathsRequest"
    },
    "SkillsGetInvokedResult": {
      "type": "object",
      "properties": {
        "skills": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SkillsInvokedSkill",
            "description": "Skill invocation record with name, path, content, allowed tools, and turn number."
          },
          "description": "Skills invoked during this session, ordered by invocation time (most recent last)"
        }
      },
      "required": [
        "skills"
      ],
      "additionalProperties": false,
      "description": "Skills invoked during this session, ordered by invocation time (most recent last).",
      "title": "SkillsGetInvokedResult"
    },
    "SkillsInvokedSkill": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Unique identifier for the skill"
        },
        "path": {
          "type": "string",
          "description": "Path to the SKILL.md file"
        },
        "content": {
          "type": "string",
          "description": "Full content of the skill file"
        },
        "allowedTools": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Tools that should be auto-approved when this skill is active, captured at invocation time"
        },
        "invokedAtTurn": {
          "type": "integer",
          "minimum": 0,
          "description": "Turn number when the skill was invoked"
        }
      },
      "required": [
        "name",
        "path",
        "content",
        "invokedAtTurn"
      ],
      "additionalProperties": false,
      "description": "Skill invocation record with name, path, content, allowed tools, and turn number.",
      "title": "SkillsInvokedSkill"
    },
    "SkillsLoadDiagnostics": {
      "type": "object",
      "properties": {
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Warnings emitted while loading skills (e.g. skills that loaded but had issues)"
        },
        "errors": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Errors emitted while loading skills (e.g. skills that failed to load entirely)"
        }
      },
      "required": [
        "warnings",
        "errors"
      ],
      "additionalProperties": false,
      "description": "Diagnostics from reloading skill definitions, with warnings and errors as separate lists.",
      "title": "SkillsLoadDiagnostics"
    },
    "SkillSource": {
      "type": "string",
      "enum": [
        "project",
        "inherited",
        "personal-copilot",
        "personal-agents",
        "plugin",
        "custom",
        "builtin"
      ],
      "description": "Source location type (e.g., project, personal-copilot, plugin, builtin)",
      "title": "SkillSource",
      "x-enumDescriptions": {
        "project": "Skill defined in the current project's skill directories.",
        "inherited": "Skill discovered from a parent directory in the current workspace tree.",
        "personal-copilot": "Skill defined in the user's Copilot skill directory.",
        "personal-agents": "Skill defined in the user's personal agents skill directory.",
        "plugin": "Skill provided by an installed plugin.",
        "custom": "Skill loaded from a configured custom skill directory.",
        "builtin": "Skill bundled with the runtime."
      }
    },
    "SlashCommandAddTimelineEntryResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "add-timeline-entry",
          "description": "Discriminator for an add-timeline-entry result."
        },
        "entry": {
          "$ref": "#/definitions/SlashCommandTimelineEntry",
          "description": "Timeline entry the host should append."
        },
        "prefillInput": {
          "type": "string",
          "description": "Optional text the host should prefill into the input editor."
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "Whether command execution changed persisted runtime settings."
        }
      },
      "required": [
        "kind",
        "entry"
      ],
      "additionalProperties": false
    },
    "SlashCommandAgentPromptResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "agent-prompt",
          "description": "Agent prompt result discriminator"
        },
        "prompt": {
          "type": "string",
          "description": "Prompt to submit to the agent"
        },
        "displayPrompt": {
          "type": "string",
          "description": "Prompt text to display to the user"
        },
        "mode": {
          "$ref": "#/definitions/SessionMode",
          "description": "Optional target session mode for the agent prompt"
        },
        "notice": {
          "type": "string",
          "description": "Optional user-facing notice to show before the prompt is submitted"
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "True when the invocation mutated user runtime settings; consumers caching settings should refresh"
        }
      },
      "required": [
        "kind",
        "prompt",
        "displayPrompt"
      ],
      "additionalProperties": false,
      "description": "Slash-command invocation result that submits an agent prompt, with display prompt, optional mode, optional user-facing notice, and settings-change flag.",
      "title": "SlashCommandAgentPromptResult"
    },
    "SlashCommandCompletedResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "completed",
          "description": "Completed result discriminator"
        },
        "message": {
          "type": "string",
          "description": "Optional user-facing message describing the completed command"
        },
        "mode": {
          "$ref": "#/definitions/SessionMode",
          "description": "Optional target session mode applied without submitting an agent prompt"
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "True when the invocation mutated user runtime settings; consumers caching settings should refresh"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Slash-command invocation result indicating completion, with optional message and settings-change flag.",
      "title": "SlashCommandCompletedResult"
    },
    "SlashCommandInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Canonical command name without a leading slash"
        },
        "aliases": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Canonical aliases without leading slashes"
        },
        "description": {
          "type": "string",
          "description": "Human-readable command description"
        },
        "kind": {
          "$ref": "#/definitions/SlashCommandKind",
          "description": "Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command"
        },
        "input": {
          "$ref": "#/definitions/SlashCommandInput",
          "description": "Optional unstructured input hint"
        },
        "allowDuringAgentExecution": {
          "type": "boolean",
          "description": "Whether the command may run while an agent turn is active"
        },
        "experimental": {
          "type": "boolean",
          "description": "Whether the command is experimental"
        },
        "schedulable": {
          "type": "boolean",
          "description": "Whether the command may be the target of `/every` / `/after` schedules. Resolution happens at every tick, so only set this when the command is safe to re-invoke and produces an agent prompt."
        }
      },
      "required": [
        "name",
        "description",
        "kind",
        "allowDuringAgentExecution"
      ],
      "additionalProperties": false,
      "description": "Slash-command metadata with name, aliases, description, kind, input hint, execution allowance, and schedulability.",
      "title": "SlashCommandInfo"
    },
    "SlashCommandInput": {
      "type": "object",
      "properties": {
        "hint": {
          "type": "string",
          "description": "Hint to display when command input has not been provided"
        },
        "choices": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SlashCommandInputChoice",
            "description": "A literal choice the command input accepts, with a human-facing description"
          },
          "description": "Optional literal choices the input accepts, each with a human-facing description; clients may render these as selectable options"
        },
        "required": {
          "type": "boolean",
          "description": "When true, the command requires non-empty input; clients should render the input hint as required"
        },
        "completion": {
          "$ref": "#/definitions/SlashCommandInputCompletion",
          "description": "Optional completion hint for the input (e.g. 'directory' for filesystem path completion)"
        },
        "preserveMultilineInput": {
          "type": "boolean",
          "description": "When true, clients should pass the full text after the command name as a single argument rather than splitting on whitespace"
        }
      },
      "required": [
        "hint"
      ],
      "additionalProperties": false,
      "description": "Optional unstructured input hint",
      "title": "SlashCommandInput"
    },
    "SlashCommandInputChoice": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The literal choice value (e.g. 'on', 'off', 'show')"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description shown alongside the choice"
        }
      },
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "A literal choice the command input accepts, with a human-facing description",
      "title": "SlashCommandInputChoice"
    },
    "SlashCommandInputCompletion": {
      "type": "string",
      "enum": [
        "directory"
      ],
      "description": "Optional completion hint for the input (e.g. 'directory' for filesystem path completion)",
      "title": "SlashCommandInputCompletion",
      "x-enumDescriptions": {
        "directory": "Input should complete filesystem directories."
      }
    },
    "SlashCommandInvocationResult": {
      "anyOf": [
        {
          "$ref": "#/definitions/SlashCommandTextResult",
          "description": "Slash-command invocation result containing text output plus Markdown/ANSI rendering flags."
        },
        {
          "$ref": "#/definitions/SlashCommandAgentPromptResult",
          "description": "Slash-command invocation result that submits an agent prompt, with display prompt, optional mode, optional user-facing notice, and settings-change flag."
        },
        {
          "$ref": "#/definitions/SlashCommandCompletedResult",
          "description": "Slash-command invocation result indicating completion, with optional message and settings-change flag."
        },
        {
          "$ref": "#/definitions/SlashCommandSelectSubcommandResult",
          "description": "Slash-command invocation result asking the client to present subcommand options for a parent command."
        },
        {
          "$ref": "#/definitions/SlashCommandAddTimelineEntryResult"
        },
        {
          "$ref": "#/definitions/SlashCommandShowDialogResult"
        },
        {
          "$ref": "#/definitions/SlashCommandSetModelResult"
        },
        {
          "$ref": "#/definitions/SlashCommandSetPlanModelResult"
        }
      ],
      "description": "Result of invoking the slash command (text output, prompt to send to the agent, completion, or subcommand selection).",
      "title": "SlashCommandInvocationResult"
    },
    "SlashCommandKind": {
      "type": "string",
      "enum": [
        "builtin",
        "skill",
        "client"
      ],
      "description": "Coarse command category for grouping and behavior: runtime built-in, skill-backed command, or SDK/client-owned command",
      "title": "SlashCommandKind",
      "x-enumDescriptions": {
        "builtin": "Command implemented by the runtime.",
        "skill": "Command backed by a skill.",
        "client": "Command registered by an SDK client or extension."
      }
    },
    "SlashCommandModelPickerDialog": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "model-picker",
          "description": "Discriminator for a model-picker dialog."
        },
        "modelToEnable": {
          "type": "string",
          "description": "Model that should be enabled before it can be selected."
        },
        "scope": {
          "type": "string",
          "description": "Settings scope the picker should modify."
        },
        "target": {
          "type": "string",
          "description": "Model-selection target represented by the picker."
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false
    },
    "SlashCommandSelectSubcommandOption": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Subcommand name to invoke"
        },
        "description": {
          "type": "string",
          "description": "Human-readable description of the subcommand"
        },
        "group": {
          "type": "string",
          "description": "Optional group label for organizing options"
        }
      },
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "Selectable slash-command subcommand option with name, description, and optional group label.",
      "title": "SlashCommandSelectSubcommandOption"
    },
    "SlashCommandSelectSubcommandResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "select-subcommand",
          "description": "Select subcommand result discriminator"
        },
        "command": {
          "type": "string",
          "description": "Parent command name that requires subcommand selection"
        },
        "title": {
          "type": "string",
          "description": "Human-readable title for the selection UI"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SlashCommandSelectSubcommandOption",
            "description": "Selectable slash-command subcommand option with name, description, and optional group label."
          },
          "description": "Available subcommand options for the client to present"
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "True when the invocation mutated user runtime settings; consumers caching settings should refresh"
        }
      },
      "required": [
        "kind",
        "command",
        "title",
        "options"
      ],
      "additionalProperties": false,
      "description": "Slash-command invocation result asking the client to present subcommand options for a parent command.",
      "title": "SlashCommandSelectSubcommandResult"
    },
    "SlashCommandSetModelResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "set-model",
          "description": "Discriminator for a set-model result."
        },
        "model": {
          "type": "string",
          "description": "Model selected by the command."
        },
        "scope": {
          "type": "string",
          "description": "Settings scope modified by the command."
        },
        "warning": {
          "type": "string",
          "description": "User-facing warning produced while selecting the model."
        },
        "reasoningEffort": {
          "type": "string",
          "description": "Reasoning effort selected for the model."
        },
        "revertOnCancel": {
          "type": "object",
          "properties": {},
          "description": "User-settings snapshot to restore if the host cancels the model switch."
        },
        "repoScope": {
          "type": "string",
          "description": "Repository settings scope modified by the command."
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "Whether command execution changed persisted runtime settings."
        }
      },
      "required": [
        "kind",
        "model"
      ],
      "additionalProperties": false
    },
    "SlashCommandSetPlanModelResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "set-plan-model",
          "description": "Discriminator for a set-plan-model result."
        },
        "planModel": {
          "type": "string",
          "description": "Dedicated model selected for plan mode."
        },
        "message": {
          "type": "string",
          "description": "User-facing confirmation message for the plan-model selection."
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "Whether command execution changed persisted runtime settings."
        }
      },
      "required": [
        "kind",
        "message"
      ],
      "additionalProperties": false
    },
    "SlashCommandShowDialogResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "show-dialog",
          "description": "Discriminator for a show-dialog result."
        },
        "dialog": {
          "$ref": "#/definitions/SlashCommandModelPickerDialog",
          "description": "Dialog the host should display."
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "Whether command execution changed persisted runtime settings."
        }
      },
      "required": [
        "kind",
        "dialog"
      ],
      "additionalProperties": false
    },
    "SlashCommandTextResult": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "text",
          "description": "Text result discriminator"
        },
        "text": {
          "type": "string",
          "description": "Text output for the client to render"
        },
        "markdown": {
          "type": "boolean",
          "description": "Whether text contains Markdown"
        },
        "preserveAnsi": {
          "type": "boolean",
          "description": "Whether ANSI sequences should be preserved"
        },
        "runtimeSettingsChanged": {
          "type": "boolean",
          "description": "True when the invocation mutated user runtime settings; consumers caching settings should refresh"
        }
      },
      "required": [
        "kind",
        "text"
      ],
      "additionalProperties": false,
      "description": "Slash-command invocation result containing text output plus Markdown/ANSI rendering flags.",
      "title": "SlashCommandTextResult"
    },
    "SlashCommandTimelineEntry": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "Timeline entry presentation type."
        },
        "text": {
          "type": "string",
          "description": "Text displayed for the timeline entry."
        },
        "url": {
          "type": "string",
          "description": "Optional URL associated with the timeline entry."
        }
      },
      "required": [
        "type",
        "text"
      ],
      "additionalProperties": false
    },
    "SubagentSettings": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "agents": {
              "type": "object",
              "additionalProperties": {
                "$ref": "#/definitions/SubagentSettingsEntry",
                "description": "Subagent model, reasoning effort, and context tier settings"
              },
              "description": "Per-agent settings keyed by subagent agent_type"
            },
            "disabledSubagents": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "description": "Names of subagents the user has turned off; they cannot be dispatched"
            },
            "maxConcurrency": {
              "type": "integer",
              "minimum": 1,
              "maximum": 128,
              "description": "Maximum number of subagents that can run concurrently; applies to usage-based billing users only"
            },
            "maxDepth": {
              "type": "integer",
              "minimum": 1,
              "maximum": 128,
              "description": "Maximum subagent nesting depth; applies to usage-based billing users only"
            }
          },
          "additionalProperties": false,
          "description": "Configured per-agent subagent overrides"
        },
        {
          "type": "null"
        }
      ],
      "description": "Subagent settings to apply, or null to clear the live session override",
      "title": "SubagentSettings"
    },
    "SubagentSettingsEntry": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Model override for matching subagents"
        },
        "modelPolicy": {
          "$ref": "#/definitions/AgentModelPolicy",
          "description": "Whether the configured model strategy is preferred or required"
        },
        "effortLevel": {
          "type": "string",
          "description": "Reasoning effort override for matching subagents"
        },
        "contextTier": {
          "$ref": "#/definitions/SubagentSettingsEntryContextTier",
          "description": "Context tier override for matching subagents"
        }
      },
      "additionalProperties": false,
      "description": "Subagent model, reasoning effort, and context tier settings",
      "title": "SubagentSettingsEntry"
    },
    "SubagentSettingsEntryContextTier": {
      "type": "string",
      "enum": [
        "inherit",
        "default",
        "long_context"
      ],
      "description": "Context tier override for matching subagents",
      "title": "SubagentSettingsEntryContextTier",
      "x-enumDescriptions": {
        "inherit": "Inherit the parent session's effective context tier at dispatch time.",
        "default": "Use the model's default context window.",
        "long_context": "Pin the subagent to the long-context tier when supported."
      }
    },
    "TaskAgentInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "agent",
          "description": "Task kind"
        },
        "id": {
          "type": "string",
          "description": "Unique task identifier"
        },
        "toolCallId": {
          "type": "string",
          "description": "Tool call ID associated with this agent task"
        },
        "displayName": {
          "type": "string",
          "description": "Friendly, non-unique name intended for display"
        },
        "description": {
          "type": "string",
          "description": "Short description of the task"
        },
        "status": {
          "$ref": "#/definitions/TaskStatus",
          "description": "Current lifecycle status of the task"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the task was started"
        },
        "completedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the task finished"
        },
        "activeTimeMs": {
          "type": "integer",
          "minimum": 0,
          "format": "duration",
          "description": "Accumulated active execution time in milliseconds"
        },
        "activeStartedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the current active period began"
        },
        "error": {
          "type": "string",
          "description": "Error message when the task failed"
        },
        "agentType": {
          "type": "string",
          "description": "Type of agent running this task"
        },
        "prompt": {
          "type": "string",
          "description": "Most recent prompt delivered to the agent. Updated whenever the agent receives a follow-up message."
        },
        "result": {
          "type": "string",
          "description": "Result text from the task when available"
        },
        "model": {
          "type": "string",
          "description": "Requested model override for the task when specified"
        },
        "resolvedModel": {
          "type": "string",
          "description": "Runtime model resolved for the task when available"
        },
        "executionMode": {
          "$ref": "#/definitions/TaskExecutionMode",
          "description": "Whether task execution is synchronously awaited or managed in the background"
        },
        "canPromoteToBackground": {
          "type": "boolean",
          "description": "Whether the task is currently in the original sync wait and can be moved to background mode. False once it is already backgrounded, idle, finished, or no longer has a promotable sync waiter."
        },
        "latestResponse": {
          "type": "string",
          "description": "Most recent response text from the agent"
        },
        "idleSince": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the agent entered idle state"
        }
      },
      "required": [
        "type",
        "id",
        "toolCallId",
        "description",
        "status",
        "startedAt",
        "agentType",
        "prompt"
      ],
      "additionalProperties": false,
      "description": "Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response.",
      "title": "TaskAgentInfo"
    },
    "TaskAgentProgress": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "agent",
          "description": "Progress kind"
        },
        "recentActivity": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TaskProgressLine",
            "description": "Timestamped display line for task progress output or recent agent activity."
          },
          "description": "Recent tool execution events converted to display lines"
        },
        "latestIntent": {
          "type": "string",
          "description": "The most recent intent reported by the agent"
        }
      },
      "required": [
        "type",
        "recentActivity"
      ],
      "additionalProperties": false,
      "description": "Progress snapshot for an agent task, with recent activity lines and optional latest intent.",
      "title": "TaskAgentProgress"
    },
    "TaskCompleteData": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string",
          "default": "",
          "description": "Summary of the completed task, provided by the agent"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the task was accepted as complete. False when validation failed or completion was rejected or blocked by the reviewer"
        },
        "outcome": {
          "$ref": "#/definitions/TaskCompletionOutcome",
          "description": "Semantic completion decision. Absent on legacy events and invalid tool calls"
        },
        "reason": {
          "type": "string",
          "description": "Label-safe runtime rationale for the completion decision (e.g. a cancellation or pause/resume downgrade), when one applies. Reviewer-authored rationale is intentionally omitted here because this event has no IFC label channel; the reviewer's findings remain available through its own labeled sub-agent events"
        },
        "objectiveId": {
          "type": "integer",
          "description": "Active autopilot objective ID evaluated by the completion reviewer"
        }
      },
      "additionalProperties": false,
      "description": "Task completion notification with summary from the agent",
      "title": "TaskCompleteData"
    },
    "TaskCompletionDecision": {
      "type": "object",
      "properties": {
        "outcome": {
          "$ref": "#/definitions/TaskCompletionOutcome",
          "description": "Semantic result of evaluating the task completion request."
        },
        "reason": {
          "type": "string",
          "description": "Rationale for the completion decision, when one is available."
        },
        "reviewerDerived": {
          "type": "boolean",
          "description": "Whether the rationale was derived from completion-reviewer output."
        },
        "reviewerResultMeta": {
          "description": "Information-flow metadata captured from the completion reviewer.",
          "x-opaque-json": true
        },
        "objectiveId": {
          "type": "integer",
          "description": "Active autopilot objective evaluated by the completion reviewer."
        },
        "completionRejectionBudgetExhausted": {
          "type": "boolean",
          "description": "Whether completion was accepted after the reviewer-rejection budget was exhausted."
        },
        "completionEligibilityToken": {
          "type": "integer",
          "description": "Objective eligibility token captured when the decision was evaluated."
        }
      },
      "required": [
        "outcome"
      ],
      "additionalProperties": false
    },
    "TaskCompletionOutcome": {
      "type": "string",
      "enum": [
        "completed",
        "continue",
        "blocked"
      ],
      "description": "Semantic result of evaluating a task completion request",
      "title": "TaskCompletionOutcome",
      "x-enumDescriptions": {
        "completed": "The completion request was accepted and the objective is complete.",
        "continue": "The completion request was rejected because more work or validation remains.",
        "blocked": "Completion cannot proceed without intervention; the active objective is paused when one is identified."
      }
    },
    "TaskExecutionMode": {
      "type": "string",
      "enum": [
        "sync",
        "background"
      ],
      "description": "Whether task execution is synchronously awaited or managed in the background",
      "title": "TaskExecutionMode",
      "x-enumDescriptions": {
        "sync": "The task was started with synchronous waiting.",
        "background": "The task is managed in the background."
      }
    },
    "TaskInfo": {
      "anyOf": [
        {
          "$ref": "#/definitions/TaskAgentInfo",
          "description": "Tracked background agent task metadata, including IDs, status, timing, agent type, prompt, model, result, and latest response."
        },
        {
          "$ref": "#/definitions/TaskShellInfo",
          "description": "Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID."
        }
      ],
      "description": "Tracked task union returned by task APIs, containing either an agent task or a shell task.",
      "title": "TaskInfo"
    },
    "TaskList": {
      "type": "object",
      "properties": {
        "tasks": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TaskInfo",
            "description": "Tracked task union returned by task APIs, containing either an agent task or a shell task."
          },
          "description": "Currently tracked tasks"
        }
      },
      "required": [
        "tasks"
      ],
      "additionalProperties": false,
      "description": "Background tasks currently tracked by the session.",
      "title": "TaskList"
    },
    "TaskProgress": {
      "anyOf": [
        {
          "anyOf": [
            {
              "$ref": "#/definitions/TaskAgentProgress",
              "description": "Progress snapshot for an agent task, with recent activity lines and optional latest intent."
            },
            {
              "$ref": "#/definitions/TaskShellProgress",
              "description": "Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID."
            }
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked.",
      "title": "TaskProgress"
    },
    "TaskProgressLine": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "Display message, e.g., \"▸ bash\", \"✓ edit src/foo.ts\""
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when this event occurred"
        }
      },
      "required": [
        "message",
        "timestamp"
      ],
      "additionalProperties": false,
      "description": "Timestamped display line for task progress output or recent agent activity.",
      "title": "TaskProgressLine"
    },
    "TasksCancelRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Task identifier"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Identifier of the background task to cancel.",
      "title": "TasksCancelRequest",
      "stability": "experimental"
    },
    "TasksCancelResult": {
      "type": "object",
      "properties": {
        "cancelled": {
          "type": "boolean",
          "description": "Whether the task was successfully cancelled"
        }
      },
      "required": [
        "cancelled"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the background task was successfully cancelled.",
      "title": "TasksCancelResult"
    },
    "TasksGetCurrentPromotableResult": {
      "type": "object",
      "properties": {
        "task": {
          "$ref": "#/definitions/TaskInfo",
          "description": "The first sync-waiting task (agent first, then shell) that can currently be promoted to background mode. Omitted if no such task exists. The returned task is guaranteed to have executionMode='sync' and canPromoteToBackground=true at the time of the call."
        }
      },
      "additionalProperties": false,
      "description": "The first sync-waiting task that can currently be promoted to background mode.",
      "title": "TasksGetCurrentPromotableResult"
    },
    "TasksGetProgressRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Task identifier (agent ID or shell ID)"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Identifier of the background task to fetch progress for.",
      "title": "TasksGetProgressRequest",
      "stability": "experimental"
    },
    "TasksGetProgressResult": {
      "type": "object",
      "properties": {
        "progress": {
          "$ref": "#/definitions/TaskProgress",
          "description": "Progress information for the task, discriminated by type. Returns null when no task with this ID is currently tracked."
        }
      },
      "required": [
        "progress"
      ],
      "additionalProperties": false,
      "description": "Progress information for the task, or null when no task with that ID is tracked.",
      "title": "TasksGetProgressResult"
    },
    "TaskShellInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "shell",
          "description": "Task kind"
        },
        "id": {
          "type": "string",
          "description": "Unique task identifier"
        },
        "description": {
          "type": "string",
          "description": "Short description of the task"
        },
        "status": {
          "$ref": "#/definitions/TaskStatus",
          "description": "Current lifecycle status of the task"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the task was started"
        },
        "completedAt": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the task finished"
        },
        "command": {
          "type": "string",
          "description": "Command being executed"
        },
        "attachmentMode": {
          "$ref": "#/definitions/TaskShellInfoAttachmentMode",
          "description": "Whether the shell runs inside a managed PTY session or as an independent background process"
        },
        "executionMode": {
          "$ref": "#/definitions/TaskExecutionMode",
          "description": "Whether task execution is synchronously awaited or managed in the background"
        },
        "canPromoteToBackground": {
          "type": "boolean",
          "description": "Whether this shell task can be promoted to background mode"
        },
        "logPath": {
          "type": "string",
          "description": "Path to the detached shell log, when available"
        },
        "pid": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 4294967295,
          "description": "Process ID when available"
        }
      },
      "required": [
        "type",
        "id",
        "description",
        "status",
        "startedAt",
        "command",
        "attachmentMode"
      ],
      "additionalProperties": false,
      "description": "Tracked shell task metadata, including ID, command, status, timing, attachment/execution mode, log path, and PID.",
      "title": "TaskShellInfo"
    },
    "TaskShellInfoAttachmentMode": {
      "type": "string",
      "enum": [
        "attached",
        "detached"
      ],
      "description": "Whether the shell runs inside a managed PTY session or as an independent background process",
      "title": "TaskShellInfoAttachmentMode",
      "x-enumDescriptions": {
        "attached": "The shell runs in a managed PTY session.",
        "detached": "The shell runs as an independent background process."
      }
    },
    "TaskShellProgress": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "shell",
          "description": "Progress kind"
        },
        "recentOutput": {
          "type": "string",
          "description": "Recent stdout/stderr lines from the running shell command"
        },
        "pid": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 4294967295,
          "description": "Process ID when available"
        }
      },
      "required": [
        "type",
        "recentOutput"
      ],
      "additionalProperties": false,
      "description": "Progress snapshot for a shell task, with recent stdout/stderr output and optional process ID.",
      "title": "TaskShellProgress"
    },
    "TasksPromoteCurrentToBackgroundResult": {
      "type": "object",
      "properties": {
        "task": {
          "$ref": "#/definitions/TaskInfo",
          "description": "The promoted task as it now exists in background mode, omitted if no promotable task was waiting. Atomic operation: avoids the race window of getCurrentPromotable + promoteToBackground."
        }
      },
      "additionalProperties": false,
      "description": "The promoted task as it now exists in background mode, omitted if no promotable task was waiting.",
      "title": "TasksPromoteCurrentToBackgroundResult"
    },
    "TasksPromoteToBackgroundRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Task identifier"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Identifier of the task to promote to background mode.",
      "title": "TasksPromoteToBackgroundRequest",
      "stability": "experimental"
    },
    "TasksPromoteToBackgroundResult": {
      "type": "object",
      "properties": {
        "promoted": {
          "type": "boolean",
          "description": "Whether the task was successfully promoted to background mode"
        }
      },
      "required": [
        "promoted"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the task was successfully promoted to background mode.",
      "title": "TasksPromoteToBackgroundResult"
    },
    "TasksRefreshResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Refresh metadata for any detached background shells the runtime knows about. Use after a long pause to pick up exit/output state for shells running outside the agent loop.",
      "title": "TasksRefreshResult"
    },
    "TasksRemoveRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Task identifier"
        }
      },
      "required": [
        "id"
      ],
      "additionalProperties": false,
      "description": "Identifier of the completed or cancelled task to remove from tracking.",
      "title": "TasksRemoveRequest",
      "stability": "experimental"
    },
    "TasksRemoveResult": {
      "type": "object",
      "properties": {
        "removed": {
          "type": "boolean",
          "description": "Whether the task was removed. Returns false if the task does not exist or is still running/idle (cancel it first)."
        }
      },
      "required": [
        "removed"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the task was removed. False when the task does not exist or is still running/idle.",
      "title": "TasksRemoveResult"
    },
    "TasksSendMessageRequest": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Agent task identifier"
        },
        "message": {
          "type": "string",
          "description": "Message content to send to the agent"
        },
        "fromAgentId": {
          "type": "string",
          "description": "Agent ID of the sender, if sent on behalf of another agent"
        }
      },
      "required": [
        "id",
        "message"
      ],
      "additionalProperties": false,
      "description": "Identifier of the target agent task, message content, and optional sender agent ID.",
      "title": "TasksSendMessageRequest",
      "stability": "experimental"
    },
    "TasksSendMessageResult": {
      "type": "object",
      "properties": {
        "sent": {
          "type": "boolean",
          "description": "Whether the message was successfully delivered or steered"
        },
        "error": {
          "type": "string",
          "description": "Error message if delivery failed"
        }
      },
      "required": [
        "sent"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the message was delivered, with an error message when delivery failed.",
      "title": "TasksSendMessageResult"
    },
    "TasksStartAgentRequest": {
      "type": "object",
      "properties": {
        "agentType": {
          "type": "string",
          "description": "Type of agent to start (e.g., 'explore', 'task', 'general-purpose')"
        },
        "prompt": {
          "type": "string",
          "description": "Task prompt for the agent"
        },
        "name": {
          "type": "string",
          "description": "Friendly, non-unique name used when displaying the agent"
        },
        "description": {
          "type": "string",
          "description": "Short description of the task"
        },
        "model": {
          "type": "string",
          "description": "Optional model override"
        }
      },
      "required": [
        "agentType",
        "prompt",
        "name"
      ],
      "additionalProperties": false,
      "description": "Agent type, prompt, name, and optional description and model override for the new task.",
      "title": "TasksStartAgentRequest",
      "stability": "experimental"
    },
    "TasksStartAgentResult": {
      "type": "object",
      "properties": {
        "agentId": {
          "type": "string",
          "description": "Generated agent ID for the background task"
        }
      },
      "required": [
        "agentId"
      ],
      "additionalProperties": false,
      "description": "Identifier assigned to the newly started background agent task.",
      "title": "TasksStartAgentResult"
    },
    "TaskStatus": {
      "type": "string",
      "enum": [
        "running",
        "idle",
        "completed",
        "failed",
        "cancelled"
      ],
      "description": "Current lifecycle status of the task",
      "title": "TaskStatus",
      "x-enumDescriptions": {
        "running": "The task is actively executing.",
        "idle": "The task is waiting for additional input.",
        "completed": "The task finished successfully.",
        "failed": "The task finished with an error.",
        "cancelled": "The task was cancelled before completion."
      }
    },
    "TasksWaitForPendingResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Wait until all in-flight background tasks (agents + shells) and any follow-up turns scheduled by their completions have settled. Returns when the runtime is fully drained or after an internal timeout (default 10 minutes; configurable via COPILOT_TASK_WAIT_TIMEOUT_SECONDS).",
      "title": "TasksWaitForPendingResult"
    },
    "TelemetrySetFeatureOverridesRequest": {
      "type": "object",
      "properties": {
        "features": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Override key/value pairs to attach to subsequent telemetry events from this session. Replaces any previously-set overrides."
        }
      },
      "required": [
        "features"
      ],
      "additionalProperties": false,
      "description": "Feature override key/value pairs to attach to subsequent telemetry events from this session.",
      "title": "TelemetrySetFeatureOverridesRequest",
      "stability": "experimental"
    },
    "TokenAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "token",
          "description": "SDK-side token authentication; the host configured the token directly via the SDK."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "token": {
          "type": "string",
          "description": "The token value itself. Treat as a secret."
        },
        "registrationId": {
          "type": "string",
          "description": "Opaque native GitHub credential registration backing this token identity, when applicable."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "token"
      ],
      "additionalProperties": false,
      "description": "Authentication-info input variant for SDK-configured token authentication, carrying host and the secret token value.",
      "title": "TokenAuthInfo"
    },
    "TokenProviderAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "token-provider",
          "description": "SDK callback-backed GitHub token authentication."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "registrationId": {
          "type": "string",
          "description": "Opaque SDK callback registration identifier."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known."
        }
      },
      "required": [
        "type",
        "host",
        "registrationId"
      ],
      "additionalProperties": false,
      "description": "Authentication-info variant backed by an SDK GitHub token callback. It carries routing metadata but never a plaintext token.",
      "title": "TokenProviderAuthInfo"
    },
    "Tool": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Tool identifier (e.g., \"bash\", \"grep\", \"str_replace_editor\")"
        },
        "namespacedName": {
          "type": "string",
          "description": "Optional namespaced name for declarative filtering (e.g., \"playwright/navigate\" for MCP tools)"
        },
        "description": {
          "type": "string",
          "description": "Description of what the tool does"
        },
        "parameters": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "JSON Schema for the tool's input parameters"
        },
        "instructions": {
          "type": "string",
          "description": "Optional instructions for how to use this tool effectively"
        }
      },
      "required": [
        "name",
        "description"
      ],
      "additionalProperties": false,
      "description": "Built-in tool metadata with identifier, optional namespaced name, description, input-parameter schema, and usage instructions.",
      "title": "Tool"
    },
    "ToolList": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Tool",
            "description": "Built-in tool metadata with identifier, optional namespaced name, description, input-parameter schema, and usage instructions."
          },
          "description": "List of available built-in tools with metadata"
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "Built-in tools available for the requested model, with their parameters and instructions.",
      "title": "ToolList"
    },
    "ToolResult": {
      "anyOf": [
        {
          "type": "string",
          "description": "Simple string tool result"
        },
        {
          "$ref": "#/definitions/ToolResultExpanded",
          "description": "Expanded canonical tool result"
        }
      ],
      "description": "Canonical result returned by a session tool.",
      "title": "ToolResult",
      "x-opaque-json": true,
      "stability": "experimental"
    },
    "ToolResultExpanded": {
      "type": "object",
      "properties": {
        "textResultForLlm": {
          "type": "string",
          "description": "Text result returned to the model."
        },
        "resultType": {
          "$ref": "#/definitions/ToolResultType",
          "description": "Execution outcome classification."
        },
        "binaryResultsForLlm": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalToolTextResultForLlmBinaryResultsForLlm",
            "description": "Binary result returned by a tool for the model"
          },
          "description": "Base64-encoded binary results returned to the model."
        },
        "sessionLog": {
          "type": "string",
          "description": "Detailed log content available for session display."
        },
        "error": {
          "type": "string",
          "description": "Error message for an unsuccessful execution."
        },
        "toolTelemetry": {
          "description": "Tool-specific telemetry payload.",
          "x-opaque-json": true
        },
        "skipLargeOutputProcessing": {
          "type": "boolean",
          "description": "Whether large-output post-processing should be skipped."
        },
        "newMessages": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ToolResultNewMessage",
            "description": "A message injected by a tool result."
          },
          "description": "Messages to inject after the tool result."
        },
        "contents": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExternalToolTextResultForLlmContent",
            "description": "A content block within a tool result, which may be text, terminal output, image, audio, or a resource"
          },
          "description": "Structured content blocks returned to the model."
        },
        "toolReferences": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Deferred tool names made available by this result."
        },
        "citableSources": {
          "type": "array",
          "items": {
            "x-opaque-json": true
          },
          "description": "Sources returned by the tool that the model may cite."
        },
        "skillInvocation": {
          "description": "Skill invocation metadata produced by the tool.",
          "x-opaque-json": true
        },
        "postToolUseFailureHooksProcessed": {
          "type": "boolean",
          "description": "Whether post-tool-use failure hooks have already processed this result."
        },
        "uiResource": {
          "description": "Optional UI resource produced by the tool.",
          "x-opaque-json": true
        },
        "mcpMeta": {
          "type": "object",
          "additionalProperties": {
            "x-opaque-json": true
          },
          "description": "Metadata propagated with the tool result, including information-flow labels."
        },
        "structuredContent": {
          "description": "Structured result content in addition to the model-facing text.",
          "x-opaque-json": true
        },
        "taskCompletionDecision": {
          "$ref": "#/definitions/TaskCompletionDecision",
          "description": "Completion-review decision produced by the task-completion tool."
        }
      },
      "required": [
        "textResultForLlm",
        "resultType"
      ],
      "additionalProperties": false,
      "description": "Expanded canonical result returned by a session tool.",
      "stability": "experimental"
    },
    "ToolResultNewMessage": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Message content to inject after the tool result."
        },
        "source": {
          "type": "string",
          "description": "Source attributed to the injected message."
        }
      },
      "required": [
        "content",
        "source"
      ],
      "additionalProperties": false,
      "description": "A message injected by a tool result.",
      "stability": "experimental"
    },
    "ToolResultType": {
      "type": "string",
      "enum": [
        "success",
        "failure",
        "timeout",
        "rejected",
        "denied"
      ],
      "description": "Execution outcome classification.",
      "x-enumDescriptions": {
        "success": "The tool completed successfully.",
        "failure": "The tool failed.",
        "timeout": "The tool exceeded its execution timeout.",
        "rejected": "The tool request was rejected before execution.",
        "denied": "Permission policy denied the tool request."
      },
      "stability": "experimental"
    },
    "ToolsExecuteRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Name of the currently offered tool to execute."
        },
        "arguments": {
          "description": "Arguments supplied to the tool.",
          "x-opaque-json": true
        },
        "toolCallId": {
          "type": "string",
          "description": "Optional identifier used to correlate this invocation with its tool call."
        }
      },
      "required": [
        "name",
        "arguments"
      ],
      "additionalProperties": false,
      "description": "A tool name and arguments to execute through the session's native invocation pipeline.",
      "title": "ToolsExecuteRequest",
      "stability": "experimental"
    },
    "ToolsGetBuiltinDescriptorsRequest": {
      "type": "object",
      "properties": {
        "reduceUserIntervention": {
          "type": "boolean",
          "description": "Whether descriptors should favor fewer user-intervention prompts."
        },
        "includeAuthor": {
          "type": "boolean",
          "description": "Whether tool descriptors should include authoring metadata."
        },
        "skillEmbeddingEnabled": {
          "type": "boolean",
          "description": "Whether semantic skill lookup is available."
        },
        "shellConfig": {
          "$ref": "#/definitions/ToolsShellDescriptorConfig",
          "description": "Shell-specific names and description lines for shell tools."
        },
        "shellSupportsPowerShell7Syntax": {
          "type": "boolean",
          "description": "Whether the configured shell supports PowerShell 7 syntax."
        },
        "shellTimeoutMs": {
          "type": "number",
          "description": "Default shell timeout in milliseconds."
        },
        "backgroundTaskNotificationsEnabled": {
          "type": "boolean",
          "description": "Whether background task completion notifications are enabled."
        }
      },
      "additionalProperties": false,
      "description": "Options controlling how Rust-owned built-in tool descriptors are materialized.",
      "title": "ToolsGetBuiltinDescriptorsRequest",
      "stability": "experimental"
    },
    "ToolsGetBuiltinDescriptorsResult": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/BuiltinToolDescriptor",
            "description": "Rust-owned metadata and input schema for a built-in tool."
          },
          "description": "Built-in tool descriptors materialized for the session."
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "Rust-owned built-in tool descriptors for the session.",
      "title": "ToolsGetBuiltinDescriptorsResult",
      "stability": "experimental"
    },
    "ToolsGetCurrentMetadataResult": {
      "type": "object",
      "properties": {
        "tools": {
          "anyOf": [
            {
              "type": "array",
              "items": {
                "$ref": "#/definitions/CurrentToolMetadata",
                "description": "Lightweight metadata for a currently initialized session tool"
              }
            },
            {
              "type": "null"
            }
          ],
          "description": "Current tool metadata, or null when tools have not been initialized yet"
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "Current lightweight tool metadata snapshot for the session.",
      "title": "ToolsGetCurrentMetadataResult"
    },
    "ToolsInitializeAndValidateResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Resolve, build, and validate the runtime tool list for this session. Subagent sessions and consumer flows that need an initialized tool set before `send` invoke this. Default base-class implementation is a no-op for sessions that don't support tool validation.",
      "title": "ToolsInitializeAndValidateResult"
    },
    "ToolsListRequest": {
      "type": "object",
      "properties": {
        "model": {
          "type": "string",
          "description": "Optional model ID — when provided, the returned tool list reflects model-specific overrides"
        }
      },
      "additionalProperties": false,
      "description": "Optional model identifier whose tool overrides should be applied to the listing.",
      "title": "ToolsListRequest"
    },
    "ToolsSetRequest": {
      "type": "object",
      "properties": {
        "tools": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ProtocolExternalToolDefinition",
            "description": "Serializable definition of a caller-implemented tool whose execution is handled over the SDK connection."
          },
          "description": "Complete replacement list for the calling connection."
        }
      },
      "required": [
        "tools"
      ],
      "additionalProperties": false,
      "description": "Complete externally implemented tool list for the calling connection. An empty list removes every tool previously supplied by that connection.",
      "title": "ToolsSetRequest",
      "stability": "experimental"
    },
    "ToolsSetResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Empty result after replacing the calling connection's externally implemented tools.",
      "title": "ToolsSetResult",
      "stability": "experimental"
    },
    "ToolsShellDescriptorConfig": {
      "type": "object",
      "properties": {
        "shellType": {
          "type": "string",
          "description": "Stable shell type identifier."
        },
        "displayName": {
          "type": "string",
          "description": "Human-readable shell name."
        },
        "shellToolName": {
          "type": "string",
          "description": "Tool name used to start shell commands."
        },
        "readShellToolName": {
          "type": "string",
          "description": "Tool name used to read shell output."
        },
        "stopShellToolName": {
          "type": "string",
          "description": "Tool name used to stop shell commands."
        },
        "listShellsToolName": {
          "type": "string",
          "description": "Tool name used to list active shells."
        },
        "descriptionLines": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Additional model-facing shell description lines."
        }
      },
      "required": [
        "shellType",
        "displayName",
        "shellToolName",
        "readShellToolName",
        "stopShellToolName",
        "listShellsToolName",
        "descriptionLines"
      ],
      "additionalProperties": false,
      "description": "Shell-specific names and description lines used to materialize built-in shell tool descriptors.",
      "title": "ToolsShellDescriptorConfig"
    },
    "ToolsTaskCompleteEventDataRequest": {
      "type": "object",
      "properties": {
        "toolArgs": {
          "description": "Arguments supplied to the completed task_complete tool call.",
          "x-opaque-json": true
        },
        "finalResult": {
          "$ref": "#/definitions/ToolResultExpanded",
          "description": "Final expanded result returned by the task_complete tool."
        }
      },
      "required": [
        "toolArgs",
        "finalResult"
      ],
      "additionalProperties": false,
      "description": "Task-completion tool arguments and final result used to build a label-safe session event payload.",
      "title": "ToolsTaskCompleteEventDataRequest",
      "stability": "experimental"
    },
    "ToolsUpdateSubagentSettingsResult": {
      "type": "object",
      "properties": {},
      "additionalProperties": false,
      "description": "Empty result after applying subagent settings",
      "title": "ToolsUpdateSubagentSettingsResult"
    },
    "UIAutoModeSwitchResponse": {
      "type": "string",
      "enum": [
        "yes",
        "yes_always",
        "no"
      ],
      "description": "User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline).",
      "title": "UIAutoModeSwitchResponse",
      "x-enumDescriptions": {
        "yes": "Allow the automatic mode switch for this turn.",
        "yes_always": "Allow this mode switch and persist the preference.",
        "no": "Decline the automatic mode switch."
      }
    },
    "UIElicitationArrayAnyOfField": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "array",
          "description": "Type discriminator. Always \"array\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "minItems": {
          "type": "integer",
          "minimum": 0,
          "description": "Minimum number of items the user must select."
        },
        "maxItems": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of items the user may select."
        },
        "items": {
          "$ref": "#/definitions/UIElicitationArrayAnyOfFieldItems",
          "description": "Schema applied to each item in the array."
        },
        "default": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Default values selected when the form is first shown."
        }
      },
      "required": [
        "type",
        "items"
      ],
      "additionalProperties": false,
      "description": "Multi-select string field where each option pairs a value with a display label.",
      "title": "UIElicitationArrayAnyOfField"
    },
    "UIElicitationArrayAnyOfFieldItems": {
      "type": "object",
      "properties": {
        "anyOf": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UIElicitationArrayAnyOfFieldItemsAnyOf",
            "description": "Selectable option for a UI elicitation multi-select array item, with submitted value and display label."
          },
          "description": "Selectable options, each with a value and a display label."
        }
      },
      "required": [
        "anyOf"
      ],
      "additionalProperties": false,
      "description": "Schema applied to each item in the array.",
      "title": "UIElicitationArrayAnyOfFieldItems"
    },
    "UIElicitationArrayAnyOfFieldItemsAnyOf": {
      "type": "object",
      "properties": {
        "const": {
          "type": "string",
          "description": "Value submitted when this option is selected."
        },
        "title": {
          "type": "string",
          "description": "Display label for this option."
        }
      },
      "required": [
        "const",
        "title"
      ],
      "additionalProperties": false,
      "description": "Selectable option for a UI elicitation multi-select array item, with submitted value and display label.",
      "title": "UIElicitationArrayAnyOfFieldItemsAnyOf"
    },
    "UIElicitationArrayEnumField": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "array",
          "description": "Type discriminator. Always \"array\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "minItems": {
          "type": "integer",
          "minimum": 0,
          "description": "Minimum number of items the user must select."
        },
        "maxItems": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of items the user may select."
        },
        "items": {
          "$ref": "#/definitions/UIElicitationArrayEnumFieldItems",
          "description": "Schema applied to each item in the array."
        },
        "default": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Default values selected when the form is first shown."
        }
      },
      "required": [
        "type",
        "items"
      ],
      "additionalProperties": false,
      "description": "Multi-select string field whose allowed values are defined inline.",
      "title": "UIElicitationArrayEnumField"
    },
    "UIElicitationArrayEnumFieldItems": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "description": "Type discriminator. Always \"string\"."
        },
        "enum": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed string values for each selected item."
        }
      },
      "required": [
        "type",
        "enum"
      ],
      "additionalProperties": false,
      "description": "Schema applied to each item in the array.",
      "title": "UIElicitationArrayEnumFieldItems"
    },
    "UIElicitationFieldValue": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "number"
        },
        {
          "type": "boolean"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Submitted UI elicitation field value: string, number, boolean, or an array of strings.",
      "title": "UIElicitationFieldValue",
      "x-opaque-json": true
    },
    "UIElicitationRequest": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/McpElicitationFormMode",
          "description": "Elicitation mode. Omitted and form are equivalent for structured elicitation."
        },
        "message": {
          "type": "string",
          "description": "Message describing what information is needed from the user"
        },
        "requestedSchema": {
          "$ref": "#/definitions/UIElicitationSchema",
          "description": "JSON Schema describing the form fields to present to the user"
        },
        "_meta": {
          "type": "object",
          "properties": {},
          "additionalProperties": true,
          "description": "MCP request metadata."
        },
        "task": {
          "$ref": "#/definitions/McpTaskMetadata",
          "description": "MCP task metadata."
        }
      },
      "required": [
        "message",
        "requestedSchema"
      ],
      "additionalProperties": true,
      "description": "Prompt message and JSON schema describing the form fields to elicit from the user.",
      "title": "UIElicitationRequest",
      "stability": "experimental"
    },
    "UIElicitationResponse": {
      "type": "object",
      "properties": {
        "action": {
          "$ref": "#/definitions/UIElicitationResponseAction",
          "description": "The user's response: accept (submitted), decline (rejected), or cancel (dismissed)"
        },
        "content": {
          "$ref": "#/definitions/UIElicitationResponseContent",
          "description": "The form values submitted by the user (present when action is 'accept')"
        },
        "_meta": {
          "type": "object",
          "properties": {},
          "additionalProperties": true,
          "description": "MCP response metadata."
        }
      },
      "required": [
        "action"
      ],
      "additionalProperties": true,
      "description": "The elicitation response (accept with form values, decline, or cancel)",
      "title": "UIElicitationResponse"
    },
    "UIElicitationResponseAction": {
      "type": "string",
      "enum": [
        "accept",
        "decline",
        "cancel"
      ],
      "description": "The user's response: accept (submitted), decline (rejected), or cancel (dismissed)",
      "title": "UIElicitationResponseAction",
      "x-enumDescriptions": {
        "accept": "The user submitted the requested form values.",
        "decline": "The user explicitly declined to provide the requested input.",
        "cancel": "The user dismissed the elicitation request."
      }
    },
    "UIElicitationResponseContent": {
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/UIElicitationFieldValue",
        "description": "Submitted UI elicitation field value: string, number, boolean, or an array of strings."
      },
      "description": "The form values submitted by the user (present when action is 'accept')",
      "title": "UIElicitationResponseContent"
    },
    "UIElicitationResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "Whether the response was accepted. False if the request was already resolved by another client."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the elicitation response was accepted; false if it was already resolved by another client.",
      "title": "UIElicitationResult"
    },
    "UIElicitationSchema": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "object",
          "description": "Schema type indicator (always 'object')"
        },
        "properties": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UIElicitationSchemaProperty",
            "description": "Definition for a single elicitation form field."
          },
          "description": "Form field definitions, keyed by field name"
        },
        "required": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "List of required field names"
        }
      },
      "required": [
        "type",
        "properties"
      ],
      "additionalProperties": false,
      "description": "JSON Schema describing the form fields to present to the user",
      "title": "UIElicitationSchema"
    },
    "UIElicitationSchemaProperty": {
      "anyOf": [
        {
          "$ref": "#/definitions/UIElicitationStringEnumField",
          "description": "Single-select string field whose allowed values are defined inline."
        },
        {
          "$ref": "#/definitions/UIElicitationStringOneOfField",
          "description": "Single-select string field where each option pairs a value with a display label."
        },
        {
          "$ref": "#/definitions/UIElicitationArrayEnumField",
          "description": "Multi-select string field whose allowed values are defined inline."
        },
        {
          "$ref": "#/definitions/UIElicitationArrayAnyOfField",
          "description": "Multi-select string field where each option pairs a value with a display label."
        },
        {
          "$ref": "#/definitions/UIElicitationSchemaPropertyBoolean",
          "description": "Boolean field rendered as a yes/no toggle."
        },
        {
          "$ref": "#/definitions/UIElicitationSchemaPropertyString",
          "description": "Free-text string field with optional length and format constraints."
        },
        {
          "$ref": "#/definitions/UIElicitationSchemaPropertyNumber",
          "description": "Numeric field accepting either a number or an integer."
        }
      ],
      "description": "Definition for a single elicitation form field.",
      "title": "UIElicitationSchemaProperty",
      "x-opaque-json": true
    },
    "UIElicitationSchemaPropertyBoolean": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "boolean",
          "description": "Type discriminator. Always \"boolean\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "default": {
          "type": "boolean",
          "description": "Default value selected when the form is first shown."
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "description": "Boolean field rendered as a yes/no toggle.",
      "title": "UIElicitationSchemaPropertyBoolean"
    },
    "UIElicitationSchemaPropertyNumber": {
      "type": "object",
      "properties": {
        "type": {
          "$ref": "#/definitions/UIElicitationSchemaPropertyNumberType",
          "description": "Numeric type accepted by the field."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "minimum": {
          "type": "number",
          "description": "Minimum allowed value (inclusive)."
        },
        "maximum": {
          "type": "number",
          "description": "Maximum allowed value (inclusive)."
        },
        "default": {
          "type": "number",
          "description": "Default value populated in the input when the form is first shown."
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "description": "Numeric field accepting either a number or an integer.",
      "title": "UIElicitationSchemaPropertyNumber"
    },
    "UIElicitationSchemaPropertyNumberType": {
      "type": "string",
      "enum": [
        "number",
        "integer"
      ],
      "description": "Numeric type accepted by the field.",
      "title": "UIElicitationSchemaPropertyNumberType",
      "x-enumDescriptions": {
        "number": "Any JSON number.",
        "integer": "Integer JSON number."
      }
    },
    "UIElicitationSchemaPropertyString": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "description": "Type discriminator. Always \"string\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "minLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Minimum number of characters required."
        },
        "maxLength": {
          "type": "integer",
          "minimum": 0,
          "description": "Maximum number of characters allowed."
        },
        "format": {
          "$ref": "#/definitions/UIElicitationSchemaPropertyStringFormat",
          "description": "Optional format hint that constrains the accepted input."
        },
        "default": {
          "type": "string",
          "description": "Default value populated in the input when the form is first shown."
        }
      },
      "required": [
        "type"
      ],
      "additionalProperties": false,
      "description": "Free-text string field with optional length and format constraints.",
      "title": "UIElicitationSchemaPropertyString"
    },
    "UIElicitationSchemaPropertyStringFormat": {
      "type": "string",
      "enum": [
        "email",
        "uri",
        "date",
        "date-time"
      ],
      "description": "Optional format hint that constrains the accepted input.",
      "title": "UIElicitationSchemaPropertyStringFormat",
      "x-enumDescriptions": {
        "email": "Email address string format.",
        "uri": "URI string format.",
        "date": "Calendar date string format.",
        "date-time": "Date-time string format."
      }
    },
    "UIElicitationStringEnumField": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "description": "Type discriminator. Always \"string\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "enum": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed string values."
        },
        "enumNames": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Optional display labels for each enum value, in the same order as `enum`."
        },
        "default": {
          "type": "string",
          "description": "Default value selected when the form is first shown."
        }
      },
      "required": [
        "type",
        "enum"
      ],
      "additionalProperties": false,
      "description": "Single-select string field whose allowed values are defined inline.",
      "title": "UIElicitationStringEnumField"
    },
    "UIElicitationStringOneOfField": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "string",
          "description": "Type discriminator. Always \"string\"."
        },
        "title": {
          "type": "string",
          "description": "Human-readable label for the field."
        },
        "description": {
          "type": "string",
          "description": "Help text describing the field."
        },
        "oneOf": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/UIElicitationStringOneOfFieldOneOf",
            "description": "Selectable option for a UI elicitation single-select string field, with submitted value and display label."
          },
          "description": "Selectable options, each with a value and a display label."
        },
        "default": {
          "type": "string",
          "description": "Default value selected when the form is first shown."
        }
      },
      "required": [
        "type",
        "oneOf"
      ],
      "additionalProperties": false,
      "description": "Single-select string field where each option pairs a value with a display label.",
      "title": "UIElicitationStringOneOfField"
    },
    "UIElicitationStringOneOfFieldOneOf": {
      "type": "object",
      "properties": {
        "const": {
          "type": "string",
          "description": "Value submitted when this option is selected."
        },
        "title": {
          "type": "string",
          "description": "Display label for this option."
        }
      },
      "required": [
        "const",
        "title"
      ],
      "additionalProperties": false,
      "description": "Selectable option for a UI elicitation single-select string field, with submitted value and display label.",
      "title": "UIElicitationStringOneOfFieldOneOf"
    },
    "UIEphemeralQueryRequest": {
      "type": "object",
      "properties": {
        "question": {
          "type": "string",
          "description": "Question to answer from the current conversation context."
        },
        "onChunk": {
          "description": "In-process streaming callback `(text) => void` invoked with each token as the model emits it. Internal and excluded from the public SDK surface.",
          "visibility": "internal",
          "x-opaque-in-process": true
        },
        "abortSignal": {
          "description": "In-process `AbortSignal` forwarded to the model client to cancel an in-flight request. Internal and excluded from the public SDK surface.",
          "visibility": "internal",
          "x-opaque-in-process": true
        }
      },
      "required": [
        "question"
      ],
      "additionalProperties": false,
      "description": "Transient question to answer without adding it to conversation history.",
      "title": "UIEphemeralQueryRequest",
      "stability": "experimental"
    },
    "UIEphemeralQueryResult": {
      "type": "object",
      "properties": {
        "answer": {
          "type": "string",
          "description": "Answer returned by the model"
        }
      },
      "required": [
        "answer"
      ],
      "additionalProperties": false,
      "description": "Completed transient query. Ordered chunks and the terminal outcome are also delivered through `ui.ephemeral_query` session events while it runs.",
      "title": "UIEphemeralQueryResult"
    },
    "UIExitPlanModeAction": {
      "type": "string",
      "enum": [
        "exit_only",
        "interactive",
        "autopilot",
        "autopilot_fleet"
      ],
      "description": "The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'.",
      "title": "UIExitPlanModeAction",
      "x-enumDescriptions": {
        "exit_only": "Exit plan mode without starting implementation.",
        "interactive": "Exit plan mode and continue interactively.",
        "autopilot": "Exit plan mode and continue in autopilot mode.",
        "autopilot_fleet": "Exit plan mode and continue in autopilot mode with parallel subagent execution."
      }
    },
    "UIExitPlanModeResponse": {
      "type": "object",
      "properties": {
        "approved": {
          "type": "boolean",
          "description": "Whether the plan was approved."
        },
        "selectedAction": {
          "$ref": "#/definitions/UIExitPlanModeAction",
          "description": "The action the user selected. Defaults to 'autopilot' when autoApproveEdits is true, otherwise 'interactive'."
        },
        "autoApproveEdits": {
          "type": "boolean",
          "description": "Whether subsequent edits should be auto-approved without confirmation."
        },
        "feedback": {
          "type": "string",
          "description": "Feedback from the user when they declined the plan or requested changes."
        },
        "deferImplementation": {
          "type": "boolean",
          "description": "When true, the agent is instructed to end its turn without starting implementation so the client can restore the session model and auto-submit a fresh implementation turn on it. Set only when a distinct plan configuration (a different model, reasoning effort, or context tier) actually ran the planning turn."
        }
      },
      "required": [
        "approved"
      ],
      "additionalProperties": false,
      "description": "User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback.",
      "title": "UIExitPlanModeResponse"
    },
    "UIHandlePendingAutoModeSwitchRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the auto_mode_switch.requested event"
        },
        "response": {
          "$ref": "#/definitions/UIAutoModeSwitchResponse",
          "description": "User's choice for auto-mode switching: yes (allow this turn), yes_always (allow + persist as setting), or no (decline)."
        }
      },
      "required": [
        "requestId",
        "response"
      ],
      "additionalProperties": false,
      "description": "Request ID of a pending `auto_mode_switch.requested` event and the user's response.",
      "title": "UIHandlePendingAutoModeSwitchRequest",
      "stability": "experimental"
    },
    "UIHandlePendingElicitationRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the elicitation.requested event"
        },
        "result": {
          "$ref": "#/definitions/UIElicitationResponse",
          "description": "The elicitation response (accept with form values, decline, or cancel)"
        }
      },
      "required": [
        "requestId",
        "result"
      ],
      "additionalProperties": false,
      "description": "Pending elicitation request ID and the user's response (accept/decline/cancel + form values).",
      "title": "UIHandlePendingElicitationRequest",
      "stability": "experimental"
    },
    "UIHandlePendingExitPlanModeRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the exit_plan_mode.requested event"
        },
        "response": {
          "$ref": "#/definitions/UIExitPlanModeResponse",
          "description": "User response for a pending exit-plan-mode request, with approval state, selected action, auto-approve flag, and feedback."
        }
      },
      "required": [
        "requestId",
        "response"
      ],
      "additionalProperties": false,
      "description": "Request ID of a pending `exit_plan_mode.requested` event and the user's response.",
      "title": "UIHandlePendingExitPlanModeRequest",
      "stability": "experimental"
    },
    "UIHandlePendingResult": {
      "type": "object",
      "properties": {
        "success": {
          "type": "boolean",
          "description": "True if the request was still pending and was resolved by this call. False if the request ID was unknown, already resolved by another client (e.g. GitHub), expired, or otherwise no longer pending."
        }
      },
      "required": [
        "success"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the pending UI request was resolved by this call.",
      "title": "UIHandlePendingResult"
    },
    "UIHandlePendingSamplingRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the sampling.requested event"
        },
        "response": {
          "$ref": "#/definitions/UIHandlePendingSamplingResponse",
          "description": "Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result."
        }
      },
      "required": [
        "requestId"
      ],
      "additionalProperties": false,
      "description": "Request ID of a pending `sampling.requested` event and an optional sampling result payload (omit to reject).",
      "title": "UIHandlePendingSamplingRequest",
      "stability": "experimental"
    },
    "UIHandlePendingSamplingResponse": {
      "type": "object",
      "properties": {},
      "additionalProperties": true,
      "description": "Optional sampling result payload. Omit to reject/cancel the sampling request without providing a result.",
      "title": "UIHandlePendingSamplingResponse",
      "x-opaque-json": true
    },
    "UIHandlePendingSessionLimitsExhaustedRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the session_limits_exhausted.requested event"
        },
        "response": {
          "$ref": "#/definitions/UISessionLimitsExhaustedResponse",
          "description": "The selected session-limit action."
        }
      },
      "required": [
        "requestId",
        "response"
      ],
      "additionalProperties": false,
      "description": "Request ID of a pending `session_limits_exhausted.requested` event and the user's selected limit action.",
      "title": "UIHandlePendingSessionLimitsExhaustedRequest",
      "stability": "experimental"
    },
    "UIHandlePendingUserInputRequest": {
      "type": "object",
      "properties": {
        "requestId": {
          "type": "string",
          "description": "The unique request ID from the user_input.requested event"
        },
        "response": {
          "$ref": "#/definitions/UIUserInputResponse",
          "description": "User response for a pending user-input request, with answer text and whether it was typed freeform."
        }
      },
      "required": [
        "requestId",
        "response"
      ],
      "additionalProperties": false,
      "description": "Request ID of a pending `user_input.requested` event and the user's response.",
      "title": "UIHandlePendingUserInputRequest",
      "stability": "experimental"
    },
    "UIRegisterDirectAutoModeSwitchHandlerResult": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "description": "Opaque handle representing the registration. Pass this same handle to `unregisterDirectAutoModeSwitchHandler` when the in-process handler is no longer active. Multiple registrations are reference-counted; the server bridge will only dispatch auto-mode-switch requests when no handles are active."
        }
      },
      "required": [
        "handle"
      ],
      "additionalProperties": false,
      "description": "Register an in-process handler for `auto_mode_switch.requested` events. The caller still attaches the actual listener via the standard event-subscription mechanism; this registration solely tells the server bridge to skip its own dispatch (so a remote client doesn't race the in-process handler for the same requestId).",
      "title": "UIRegisterDirectAutoModeSwitchHandlerResult"
    },
    "UISessionLimitsExhaustedResponse": {
      "type": "object",
      "properties": {
        "action": {
          "$ref": "#/definitions/UISessionLimitsExhaustedResponseAction",
          "description": "Action selected by the user."
        },
        "additionalAiCredits": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "AI Credits to add to the current max when action is 'add'."
        },
        "maxAiCredits": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "New absolute max AI Credits when action is 'set'."
        }
      },
      "required": [
        "action"
      ],
      "additionalProperties": false,
      "description": "The user's selected action for an exhausted session limit.",
      "title": "UISessionLimitsExhaustedResponse"
    },
    "UISessionLimitsExhaustedResponseAction": {
      "type": "string",
      "enum": [
        "add",
        "set",
        "unset",
        "cancel"
      ],
      "description": "User action selected for an exhausted session limit.",
      "title": "UISessionLimitsExhaustedResponseAction",
      "x-enumDescriptions": {
        "add": "Increase the current max by an exact AI Credits amount.",
        "set": "Set a new absolute max AI Credits value.",
        "unset": "Remove the current session limit.",
        "cancel": "Leave the limit unchanged and cancel the blocked model request."
      }
    },
    "UIUnregisterDirectAutoModeSwitchHandlerRequest": {
      "type": "object",
      "properties": {
        "handle": {
          "type": "string",
          "description": "Handle previously returned by `registerDirectAutoModeSwitchHandler`"
        }
      },
      "required": [
        "handle"
      ],
      "additionalProperties": false,
      "description": "Opaque handle previously returned by `registerDirectAutoModeSwitchHandler` to release.",
      "title": "UIUnregisterDirectAutoModeSwitchHandlerRequest",
      "stability": "experimental"
    },
    "UIUnregisterDirectAutoModeSwitchHandlerResult": {
      "type": "object",
      "properties": {
        "unregistered": {
          "type": "boolean",
          "description": "True if the handle was active and decremented the counter; false if the handle was unknown."
        }
      },
      "required": [
        "unregistered"
      ],
      "additionalProperties": false,
      "description": "Indicates whether the handle was active and the registration count was decremented.",
      "title": "UIUnregisterDirectAutoModeSwitchHandlerResult"
    },
    "UIUserInputResponse": {
      "type": "object",
      "properties": {
        "answer": {
          "type": "string",
          "description": "The user's answer text"
        },
        "wasFreeform": {
          "type": "boolean",
          "description": "True if the user typed a freeform response, false if they selected a presented choice. Used by telemetry to differentiate between free text input and choice selection."
        }
      },
      "required": [
        "answer",
        "wasFreeform"
      ],
      "additionalProperties": false,
      "description": "User response for a pending user-input request, with answer text and whether it was typed freeform.",
      "title": "UIUserInputResponse"
    },
    "UpdateSubagentSettingsRequest": {
      "type": "object",
      "properties": {
        "subagents": {
          "$ref": "#/definitions/SubagentSettings",
          "description": "Subagent settings to apply, or null to clear the live session override"
        }
      },
      "required": [
        "subagents"
      ],
      "additionalProperties": false,
      "description": "Subagent settings to apply to the current session",
      "title": "UpdateSubagentSettingsRequest",
      "stability": "experimental"
    },
    "UsageGetMetricsResult": {
      "type": "object",
      "properties": {
        "totalPremiumRequestCost": {
          "type": "number",
          "description": "Total user-initiated premium request cost across all models (may be fractional due to multipliers)"
        },
        "totalUserRequests": {
          "type": "integer",
          "minimum": 0,
          "description": "Raw count of user-initiated API requests"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Session-wide accumulated nano-AI units cost"
        },
        "tokenDetails": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UsageMetricsTokenDetail",
            "description": "Session-wide token-detail entry containing the accumulated token count for one token type."
          },
          "description": "Session-wide per-token-type accumulated token counts"
        },
        "totalApiDurationMs": {
          "type": "integer",
          "minimum": 0,
          "format": "duration",
          "description": "Total time spent in model API calls (milliseconds)"
        },
        "sessionStartTime": {
          "type": "string",
          "format": "date-time",
          "description": "ISO 8601 timestamp when the session started"
        },
        "codeChanges": {
          "$ref": "#/definitions/UsageMetricsCodeChanges",
          "description": "Aggregated code change metrics"
        },
        "modelMetrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UsageMetricsModelMetric",
            "description": "Per-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details."
          },
          "description": "Per-model token and request metrics, keyed by model identifier"
        },
        "agentMetrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UsageMetricsAgentMetric",
            "description": "Usage attributed to one agent instance, including its identity, API duration, AI units, and per-model breakdown."
          },
          "description": "Per-agent usage metrics, keyed by agent instance identifier. The main conversation uses the stable key `main`."
        },
        "currentModel": {
          "type": "string",
          "description": "Currently active model identifier"
        },
        "lastCallInputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Input tokens from the most recent main-agent API call"
        },
        "lastCallOutputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Output tokens from the most recent main-agent API call"
        }
      },
      "required": [
        "totalPremiumRequestCost",
        "totalUserRequests",
        "totalApiDurationMs",
        "sessionStartTime",
        "codeChanges",
        "modelMetrics",
        "lastCallInputTokens",
        "lastCallOutputTokens"
      ],
      "additionalProperties": false,
      "description": "Accumulated session usage metrics, including premium request cost, token counts, model breakdown, and code-change totals.",
      "title": "UsageGetMetricsResult"
    },
    "UsageMetricsAgentMetric": {
      "type": "object",
      "properties": {
        "agentName": {
          "type": "string",
          "description": "Configured agent name, when this is a subagent"
        },
        "agentDisplayName": {
          "type": "string",
          "description": "Human-readable label for this subagent invocation, copied from the originating `subagent.started` event. For task-tool subagents this is the invocation's task description rather than the agent's configured display name, so group by `agentName` for stable per-agent labels."
        },
        "totalApiDurationMs": {
          "type": "integer",
          "minimum": 0,
          "format": "duration",
          "description": "Time spent in model API calls by this agent, in milliseconds"
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Accumulated nano-AI units cost for this agent"
        },
        "modelMetrics": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UsageMetricsModelMetric",
            "description": "Per-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details."
          },
          "description": "Per-model usage for this agent, keyed by model identifier"
        }
      },
      "required": [
        "totalApiDurationMs",
        "totalNanoAiu",
        "modelMetrics"
      ],
      "additionalProperties": false,
      "description": "Usage attributed to one agent instance, including its identity, API duration, AI units, and per-model breakdown.",
      "title": "UsageMetricsAgentMetric"
    },
    "UsageMetricsCodeChanges": {
      "type": "object",
      "properties": {
        "linesAdded": {
          "type": "integer",
          "minimum": 0,
          "description": "Total lines of code added"
        },
        "linesRemoved": {
          "type": "integer",
          "minimum": 0,
          "description": "Total lines of code removed"
        },
        "filesModifiedCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of distinct files modified"
        },
        "filesModified": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Distinct file paths modified during the session"
        }
      },
      "required": [
        "linesAdded",
        "linesRemoved",
        "filesModifiedCount",
        "filesModified"
      ],
      "additionalProperties": false,
      "description": "Aggregated code change metrics",
      "title": "UsageMetricsCodeChanges"
    },
    "UsageMetricsModelMetric": {
      "type": "object",
      "properties": {
        "requests": {
          "$ref": "#/definitions/UsageMetricsModelMetricRequests",
          "description": "Request count and cost metrics for this model"
        },
        "usage": {
          "$ref": "#/definitions/UsageMetricsModelMetricUsage",
          "description": "Token usage metrics for this model"
        },
        "cacheExpiresAt": {
          "type": "string",
          "format": "date-time",
          "description": "Latest known prompt-cache expiration for this model. A timestamp in the past indicates that the observed cache has expired."
        },
        "totalNanoAiu": {
          "type": "number",
          "minimum": 0,
          "description": "Accumulated nano-AI units cost for this model"
        },
        "tokenDetails": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UsageMetricsModelMetricTokenDetail",
            "description": "Per-model token-detail entry containing the accumulated token count for one token type."
          },
          "description": "Token count details per type"
        }
      },
      "required": [
        "requests",
        "usage"
      ],
      "additionalProperties": false,
      "description": "Per-model usage metrics, including request counts/costs, token usage, nano-AI units, and per-token-type details.",
      "title": "UsageMetricsModelMetric"
    },
    "UsageMetricsModelMetricRequests": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of API requests made with this model"
        },
        "cost": {
          "type": "number",
          "description": "User-initiated premium request cost (with multiplier applied)"
        }
      },
      "required": [
        "count",
        "cost"
      ],
      "additionalProperties": false,
      "description": "Request count and cost metrics for this model",
      "title": "UsageMetricsModelMetricRequests"
    },
    "UsageMetricsModelMetricTokenDetail": {
      "type": "object",
      "properties": {
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Accumulated token count for this token type"
        }
      },
      "required": [
        "tokenCount"
      ],
      "additionalProperties": false,
      "description": "Per-model token-detail entry containing the accumulated token count for one token type.",
      "title": "UsageMetricsModelMetricTokenDetail"
    },
    "UsageMetricsModelMetricUsage": {
      "type": "object",
      "properties": {
        "inputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total input tokens consumed"
        },
        "outputTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total output tokens produced"
        },
        "cacheReadTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens read from prompt cache"
        },
        "cacheWriteTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total tokens written to prompt cache"
        },
        "reasoningTokens": {
          "type": "integer",
          "minimum": 0,
          "description": "Total output tokens used for reasoning"
        }
      },
      "required": [
        "inputTokens",
        "outputTokens",
        "cacheReadTokens",
        "cacheWriteTokens"
      ],
      "additionalProperties": false,
      "description": "Token usage metrics for this model",
      "title": "UsageMetricsModelMetricUsage"
    },
    "UsageMetricsTokenDetail": {
      "type": "object",
      "properties": {
        "tokenCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Accumulated token count for this token type"
        }
      },
      "required": [
        "tokenCount"
      ],
      "additionalProperties": false,
      "description": "Session-wide token-detail entry containing the accumulated token count for one token type.",
      "title": "UsageMetricsTokenDetail"
    },
    "UserAuthInfo": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "user",
          "description": "OAuth user authentication. The token itself is held in the runtime's secret token store (keyed by host+login) and is NOT carried in this struct."
        },
        "host": {
          "type": "string",
          "description": "Authentication host."
        },
        "login": {
          "type": "string",
          "description": "OAuth user login."
        },
        "copilotUser": {
          "$ref": "#/definitions/CopilotUserResponse",
          "description": "Snapshot of the authenticated user's Copilot subscription info, if known. Mirrors the GitHub API `/copilot_internal/v2/token` user response shape — the runtime trusts this verbatim and does not re-fetch when set."
        }
      },
      "required": [
        "type",
        "host",
        "login"
      ],
      "additionalProperties": false,
      "description": "Authentication-info variant for OAuth user auth, with host and login; the token remains in the runtime secret store.",
      "title": "UserAuthInfo"
    },
    "UserRequestedShellCommandResult": {
      "type": "object",
      "properties": {
        "toolCallId": {
          "type": "string",
          "description": "Tool call id emitted for the shell execution"
        },
        "success": {
          "type": "boolean",
          "description": "Whether the command completed successfully"
        },
        "output": {
          "type": "string",
          "description": "Captured command output"
        },
        "exitCode": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "description": "Process exit code, when available"
        },
        "error": {
          "type": "string",
          "description": "Error output when the execution failed"
        }
      },
      "required": [
        "toolCallId",
        "success",
        "output"
      ],
      "additionalProperties": false,
      "description": "Result of a user-requested shell command.",
      "title": "UserRequestedShellCommandResult"
    },
    "UserSettingMetadata": {
      "type": "object",
      "properties": {
        "value": {
          "description": "The effective value: the user's value if set, otherwise the default.",
          "x-opaque-json": true
        },
        "default": {
          "description": "The centrally-known default for this setting (null when no default is registered).",
          "x-opaque-json": true
        },
        "isDefault": {
          "type": "boolean",
          "description": "True when the user has not set an explicit value for this setting (i.e. it is left at its default). Reflects whether the user has overridden the key, not whether the effective value happens to equal the default — a key explicitly set to a value identical to the default still reports false."
        }
      },
      "required": [
        "value",
        "default",
        "isDefault"
      ],
      "additionalProperties": false,
      "description": "A single user setting's effective value alongside its default, so consumers can render settings left at their default.",
      "title": "UserSettingMetadata"
    },
    "UserSettingsGetResult": {
      "type": "object",
      "properties": {
        "settings": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/UserSettingMetadata",
            "description": "A single user setting's effective value alongside its default, so consumers can render settings left at their default."
          },
          "description": "Every known user setting keyed by setting name, each with its effective value, default, and whether it is at the default."
        }
      },
      "required": [
        "settings"
      ],
      "additionalProperties": false,
      "description": "Per-key metadata for every known user setting (settings.json overlaid with the legacy config.json, config.json wins), including settings left at their default. Excludes repository- and enterprise-managed overrides.",
      "title": "UserSettingsGetResult"
    },
    "UserSettingsSetRequest": {
      "type": "object",
      "properties": {
        "settings": {
          "description": "Partial user settings to write, as a free-form object keyed by setting name",
          "x-opaque-json": true
        }
      },
      "required": [
        "settings"
      ],
      "additionalProperties": false,
      "description": "Partial user settings to write to settings.json. Each top-level key is written individually, replacing the existing value; a key whose value is null is removed.",
      "title": "UserSettingsSetRequest"
    },
    "UserSettingsSetResult": {
      "type": "object",
      "properties": {
        "shadowedKeys": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Top-level keys whose write landed in settings.json but is shadowed by a value still present in the legacy config.json (config.json wins on read). The write does not take effect until the legacy value is removed."
        }
      },
      "required": [
        "shadowedKeys"
      ],
      "additionalProperties": false,
      "description": "Outcome of writing user settings.",
      "title": "UserSettingsSetResult"
    },
    "UserToolSessionApproval": {
      "anyOf": [
        {
          "$ref": "#/definitions/UserToolSessionApprovalCommands",
          "description": "Session-scoped tool-approval rule for specific shell command identifiers."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalRead",
          "description": "Session-scoped tool-approval rule for read-only filesystem operations."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalWrite",
          "description": "Session-scoped tool-approval rule for filesystem write operations."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalMcp",
          "description": "Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when `toolName` is null."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalMemory",
          "description": "Session-scoped tool-approval rule for writes to long-term memory."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalCustomTool",
          "description": "Session-scoped tool-approval rule for a custom tool, keyed by tool name."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalExtensionManagement",
          "description": "Session-scoped tool-approval rule for extension-management operations, optionally narrowed by operation."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalFactory",
          "description": "Session-scoped factory approval, optionally narrowed by approval key."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalExtensionPermissionAccess",
          "description": "Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name."
        },
        {
          "$ref": "#/definitions/UserToolSessionApprovalExtensionEnvAccess",
          "description": "Session-scoped tool-approval rule for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names."
        }
      ],
      "description": "The approval to add as a session-scoped rule",
      "title": "UserToolSessionApproval"
    },
    "UserToolSessionApprovalCommands": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "commands",
          "description": "Command approval kind"
        },
        "commandIdentifiers": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Command identifiers approved by the user"
        }
      },
      "required": [
        "kind",
        "commandIdentifiers"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for specific shell command identifiers.",
      "title": "UserToolSessionApprovalCommands"
    },
    "UserToolSessionApprovalCustomTool": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "custom-tool",
          "description": "Custom tool approval kind"
        },
        "toolName": {
          "type": "string",
          "description": "Custom tool name"
        }
      },
      "required": [
        "kind",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for a custom tool, keyed by tool name.",
      "title": "UserToolSessionApprovalCustomTool"
    },
    "UserToolSessionApprovalExtensionEnvAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-env-access",
          "description": "Extension environment access approval kind"
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name"
        },
        "environmentVariables": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "description": "Names of the sensitive environment variables this approval covers. Values are never persisted."
        }
      },
      "required": [
        "kind",
        "extensionName",
        "environmentVariables"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for an extension's access to sensitive environment variables, keyed by extension name and the exact set of variable names.",
      "title": "UserToolSessionApprovalExtensionEnvAccess"
    },
    "UserToolSessionApprovalExtensionManagement": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-management",
          "description": "Extension management approval kind"
        },
        "operation": {
          "type": "string",
          "description": "Optional operation identifier"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for extension-management operations, optionally narrowed by operation.",
      "title": "UserToolSessionApprovalExtensionManagement"
    },
    "UserToolSessionApprovalExtensionPermissionAccess": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "extension-permission-access",
          "description": "Extension permission access approval kind"
        },
        "extensionName": {
          "type": "string",
          "description": "Extension name"
        }
      },
      "required": [
        "kind",
        "extensionName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for an extension's permission-gated capability access, keyed by extension name.",
      "title": "UserToolSessionApprovalExtensionPermissionAccess"
    },
    "UserToolSessionApprovalFactory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "factory",
          "description": "Factory approval kind"
        },
        "approvalKey": {
          "type": "string",
          "description": "Optional factory operation name or canonical approval key"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped factory approval, optionally narrowed by approval key.",
      "title": "UserToolSessionApprovalFactory"
    },
    "UserToolSessionApprovalMcp": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "mcp",
          "description": "MCP tool approval kind"
        },
        "serverName": {
          "type": "string",
          "description": "MCP server name"
        },
        "toolName": {
          "type": [
            "string",
            "null"
          ],
          "description": "Optional MCP tool name, or null for all tools on the server"
        }
      },
      "required": [
        "kind",
        "serverName",
        "toolName"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for an MCP server tool, or all tools on the server when `toolName` is null.",
      "title": "UserToolSessionApprovalMcp"
    },
    "UserToolSessionApprovalMemory": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "memory",
          "description": "Memory approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for writes to long-term memory.",
      "title": "UserToolSessionApprovalMemory"
    },
    "UserToolSessionApprovalRead": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "read",
          "description": "Read approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for read-only filesystem operations.",
      "title": "UserToolSessionApprovalRead"
    },
    "UserToolSessionApprovalWrite": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "write",
          "description": "Write approval kind"
        }
      },
      "required": [
        "kind"
      ],
      "additionalProperties": false,
      "description": "Session-scoped tool-approval rule for filesystem write operations.",
      "title": "UserToolSessionApprovalWrite"
    },
    "Verbosity": {
      "type": "string",
      "enum": [
        "low",
        "medium",
        "high"
      ],
      "description": "Output verbosity level for supported models",
      "title": "Verbosity",
      "x-enumDescriptions": {
        "low": "Request a terse response.",
        "medium": "Request a medium amount of response detail.",
        "high": "Request a more detailed response."
      }
    },
    "VisibilityGetResult": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "boolean",
          "description": "Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the session cannot be shared and `status`/`shareUrl` are absent."
        },
        "status": {
          "$ref": "#/definitions/SessionVisibilityStatus",
          "description": "Current sharing status. Absent when the session is not synced or the status could not be retrieved (e.g. the user is not authenticated)."
        },
        "shareUrl": {
          "type": "string",
          "format": "uri",
          "description": "Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved."
        }
      },
      "required": [
        "synced"
      ],
      "additionalProperties": false,
      "description": "Current sharing status and shareable GitHub URL for a session.",
      "title": "VisibilityGetResult"
    },
    "VisibilitySetRequest": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/SessionVisibilityStatus",
          "description": "Sharing status to apply. \"repo\" makes the session visible to repository readers; \"unshared\" restricts it to the creator and collaborators."
        }
      },
      "required": [
        "status"
      ],
      "additionalProperties": false,
      "description": "Desired sharing status for the session.",
      "title": "VisibilitySetRequest",
      "stability": "experimental"
    },
    "VisibilitySetResult": {
      "type": "object",
      "properties": {
        "synced": {
          "type": "boolean",
          "description": "Whether the session has been synced to Mission Control (i.e. has a GitHub task). When false, the visibility change could not be applied and `status`/`shareUrl` are absent."
        },
        "status": {
          "$ref": "#/definitions/SessionVisibilityStatus",
          "description": "Effective sharing status after the update. May differ from the requested status for task types that are already visible to repository readers by default. Absent when the update could not be applied (e.g. the session is not synced or the user is not authenticated)."
        },
        "shareUrl": {
          "type": "string",
          "format": "uri",
          "description": "Shareable GitHub URL for the session. Present when the session is synced and the URL can be resolved."
        }
      },
      "required": [
        "synced"
      ],
      "additionalProperties": false,
      "description": "Effective sharing status and shareable GitHub URL after updating session visibility.",
      "title": "VisibilitySetResult"
    },
    "WorkspaceDiffFileChange": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Path to the changed file, relative to the workspace root when the file lives under it. A file changed outside the workspace root keeps a `../`-relative path, or an absolute path when no relative path exists (for example a different Windows drive)."
        },
        "diff": {
          "type": "string",
          "description": "Unified diff content for the file. Empty when the diff was truncated."
        },
        "changeType": {
          "$ref": "#/definitions/WorkspaceDiffFileChangeType",
          "description": "Type of change represented by this file diff."
        },
        "oldPath": {
          "type": "string",
          "description": "Original file path for renamed files."
        },
        "isTruncated": {
          "type": "boolean",
          "description": "Whether the diff content was omitted because it exceeded the per-file size limit."
        }
      },
      "required": [
        "path",
        "diff",
        "changeType"
      ],
      "additionalProperties": false,
      "description": "A single changed file and its unified diff.",
      "title": "WorkspaceDiffFileChange"
    },
    "WorkspaceDiffFileChangeType": {
      "type": "string",
      "enum": [
        "added",
        "modified",
        "deleted",
        "renamed"
      ],
      "description": "Type of change represented by this file diff.",
      "title": "WorkspaceDiffFileChangeType",
      "x-enumDescriptions": {
        "added": "The file was added.",
        "modified": "The file was modified.",
        "deleted": "The file was deleted.",
        "renamed": "The file was renamed."
      }
    },
    "WorkspaceDiffMode": {
      "type": "string",
      "enum": [
        "unstaged",
        "branch",
        "session"
      ],
      "description": "Diff mode requested by the client.",
      "title": "WorkspaceDiffMode",
      "x-enumDescriptions": {
        "unstaged": "Return staged, unstaged, and untracked working tree changes.",
        "branch": "Return changes compared with the default branch.",
        "session": "Return the cumulative diff of files Copilot changed this session (used in non-git workspaces)."
      }
    },
    "WorkspaceDiffResult": {
      "type": "object",
      "properties": {
        "requestedMode": {
          "$ref": "#/definitions/WorkspaceDiffMode",
          "description": "Diff mode requested by the client."
        },
        "mode": {
          "$ref": "#/definitions/WorkspaceDiffMode",
          "description": "Effective mode used for the returned changes."
        },
        "changes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/WorkspaceDiffFileChange",
            "description": "A single changed file and its unified diff."
          },
          "description": "Changed files and their unified diffs."
        },
        "baseBranch": {
          "type": "string",
          "description": "Default branch used for a branch diff, when branch mode was requested."
        },
        "isFallback": {
          "type": "boolean",
          "description": "Whether the requested diff fell back to unstaged changes, either because branch diff failed or session diff was unavailable."
        },
        "unavailableReason": {
          "$ref": "#/definitions/HistoryRewindUnavailableReason",
          "description": "Why the session diff could not be produced, when applicable. Set only when `session` mode was requested and `isFallback` is true, so a client can tell the permanent `file-change-tracking-disabled` apart from the transient `session-busy`, which the same request answers once the session settles. Never set for `unstaged` or `branch` mode, and never `unsupported-remote-session`: a remote session's captures live on its own host, so a `session`-mode diff is rejected for one rather than answered with a controller-side fallback."
        }
      },
      "required": [
        "requestedMode",
        "mode",
        "changes",
        "isFallback"
      ],
      "additionalProperties": false,
      "description": "Workspace diff result for the requested mode.",
      "title": "WorkspaceDiffResult"
    },
    "WorkspacesAddSummaryRequest": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "Summary title shown in checkpoint listings."
        },
        "content": {
          "type": "string",
          "description": "Markdown summary content to persist."
        }
      },
      "required": [
        "title",
        "content"
      ],
      "additionalProperties": false,
      "description": "Compaction summary checkpoint to persist.",
      "title": "WorkspacesAddSummaryRequest",
      "stability": "experimental"
    },
    "WorkspacesAddSummaryResult": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "object",
          "properties": {},
          "description": "Metadata for the persisted summary."
        },
        "workspace": {
          "type": "object",
          "properties": {},
          "description": "Refreshed metadata for the containing workspace."
        }
      },
      "additionalProperties": true,
      "description": "Persisted summary metadata and refreshed workspace metadata.",
      "title": "WorkspacesAddSummaryResult"
    },
    "WorkspacesAutopilotObjectiveExistsResult": {
      "type": "object",
      "properties": {
        "exists": {
          "type": "boolean",
          "description": "True when the objective file exists."
        }
      },
      "required": [
        "exists"
      ],
      "additionalProperties": false,
      "description": "Whether the autopilot objective file exists.",
      "title": "WorkspacesAutopilotObjectiveExistsResult",
      "stability": "experimental"
    },
    "WorkspacesCheckpoints": {
      "type": "object",
      "properties": {
        "number": {
          "type": "integer",
          "minimum": 0,
          "description": "Checkpoint number assigned by the workspace manager"
        },
        "title": {
          "type": "string",
          "description": "Human-readable checkpoint title"
        },
        "filename": {
          "type": "string",
          "description": "Filename of the checkpoint within the workspace checkpoints directory"
        }
      },
      "required": [
        "number",
        "title",
        "filename"
      ],
      "additionalProperties": false,
      "description": "Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename.",
      "title": "WorkspacesCheckpoints"
    },
    "WorkspacesCreateFileRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Relative path within the workspace files directory"
        },
        "content": {
          "type": "string",
          "description": "File content to write as a UTF-8 string"
        }
      },
      "required": [
        "path",
        "content"
      ],
      "additionalProperties": false,
      "description": "Relative path and UTF-8 content for the workspace file to create or overwrite.",
      "title": "WorkspacesCreateFileRequest",
      "stability": "experimental"
    },
    "WorkspacesDeleteAutopilotObjectiveResult": {
      "type": "object",
      "properties": {
        "deleted": {
          "type": "boolean",
          "description": "True when a file was deleted."
        }
      },
      "required": [
        "deleted"
      ],
      "additionalProperties": false,
      "description": "Result of deleting the autopilot objective file.",
      "title": "WorkspacesDeleteAutopilotObjectiveResult",
      "stability": "experimental"
    },
    "WorkspacesDiffRequest": {
      "type": "object",
      "properties": {
        "mode": {
          "$ref": "#/definitions/WorkspaceDiffMode",
          "description": "Diff mode requested by the client."
        },
        "ignoreWhitespace": {
          "type": "boolean",
          "description": "When true, ignore whitespace-only changes (git `--ignore-all-space`). Defaults to false."
        }
      },
      "required": [
        "mode"
      ],
      "additionalProperties": false,
      "description": "Parameters for computing a workspace diff.",
      "title": "WorkspacesDiffRequest",
      "stability": "experimental"
    },
    "WorkspacesEnsureRequest": {
      "type": "object",
      "properties": {
        "context": {
          "description": "Opaque workspace context supplied by the session host.",
          "x-opaque-json": true
        }
      },
      "additionalProperties": false,
      "description": "Optional session context used when creating a local workspace.",
      "title": "WorkspacesEnsureRequest",
      "stability": "experimental"
    },
    "WorkspacesGetWorkspaceResult": {
      "type": "object",
      "properties": {
        "workspace": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1,
                  "description": "Stable workspace identifier."
                },
                "cwd": {
                  "type": "string",
                  "description": "Current working directory associated with the workspace."
                },
                "git_root": {
                  "type": "string",
                  "description": "Git repository root associated with the workspace."
                },
                "repository": {
                  "type": "string",
                  "description": "Repository identifier associated with the workspace."
                },
                "host_type": {
                  "$ref": "#/definitions/WorkspacesWorkspaceDetailsHostType",
                  "description": "Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration."
                },
                "branch": {
                  "type": "string",
                  "description": "Current Git branch."
                },
                "name": {
                  "type": "string",
                  "description": "Workspace display name."
                },
                "client_name": {
                  "type": "string",
                  "description": "Name of the client that created the workspace."
                },
                "user_named": {
                  "type": "boolean",
                  "description": "Whether the workspace name was explicitly chosen by the user."
                },
                "summary_count": {
                  "type": "integer",
                  "minimum": 0,
                  "default": 0,
                  "description": "Number of persisted summaries in the workspace."
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp when the workspace was created."
                },
                "updated_at": {
                  "type": "string",
                  "format": "date-time",
                  "description": "Timestamp when the workspace was last updated."
                },
                "remote_steerable": {
                  "type": "boolean",
                  "description": "Whether the workspace session can be steered remotely."
                },
                "mc_task_id": {
                  "type": "string",
                  "description": "Mission Control task identifier associated with the workspace."
                },
                "mc_session_id": {
                  "type": "string",
                  "description": "Mission Control session identifier associated with the workspace."
                },
                "mc_last_event_id": {
                  "type": "string",
                  "description": "Most recent Mission Control event identifier observed for the workspace."
                },
                "chronicle_sync_dismissed": {
                  "type": "boolean",
                  "description": "Whether the per-session Chronicle upgrade prompt was dismissed for the workspace."
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "description": "Current workspace metadata, or null if not available"
        },
        "path": {
          "type": "string",
          "description": "Absolute filesystem path to the workspace directory. Omitted when the session has no workspace (e.g. remote sessions)."
        }
      },
      "required": [
        "workspace"
      ],
      "additionalProperties": false,
      "description": "Current workspace metadata for the session, including its absolute filesystem path when available.",
      "title": "WorkspacesGetWorkspaceResult"
    },
    "WorkspacesListCheckpointsResult": {
      "type": "object",
      "properties": {
        "checkpoints": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/WorkspacesCheckpoints",
            "description": "Workspace checkpoint metadata with assigned number, human-readable title, and checkpoint filename."
          },
          "description": "Workspace checkpoints in chronological order. Empty when workspace is not enabled."
        }
      },
      "required": [
        "checkpoints"
      ],
      "additionalProperties": false,
      "description": "Workspace checkpoints in chronological order; empty when the workspace is not enabled.",
      "title": "WorkspacesListCheckpointsResult"
    },
    "WorkspacesListFilesResult": {
      "type": "object",
      "properties": {
        "files": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Relative file paths in the workspace files directory"
        }
      },
      "required": [
        "files"
      ],
      "additionalProperties": false,
      "description": "Relative paths of files stored in the session workspace files directory.",
      "title": "WorkspacesListFilesResult"
    },
    "WorkspacesReadAutopilotObjectiveResult": {
      "type": "object",
      "properties": {
        "content": {
          "type": [
            "string",
            "null"
          ],
          "description": "Autopilot objective file content, or null when missing."
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Autopilot objective file content, or null when missing.",
      "title": "WorkspacesReadAutopilotObjectiveResult",
      "stability": "experimental"
    },
    "WorkspacesReadCheckpointRequest": {
      "type": "object",
      "properties": {
        "number": {
          "type": "integer",
          "minimum": 0,
          "description": "Checkpoint number to read"
        }
      },
      "required": [
        "number"
      ],
      "additionalProperties": false,
      "description": "Checkpoint number to read.",
      "title": "WorkspacesReadCheckpointRequest",
      "stability": "experimental"
    },
    "WorkspacesReadCheckpointResult": {
      "type": "object",
      "properties": {
        "content": {
          "type": [
            "string",
            "null"
          ],
          "description": "Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Checkpoint content as a UTF-8 string, or null when the checkpoint or workspace is missing.",
      "title": "WorkspacesReadCheckpointResult"
    },
    "WorkspacesReadFileRequest": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "Relative path within the workspace files directory"
        }
      },
      "required": [
        "path"
      ],
      "additionalProperties": false,
      "description": "Relative path of the workspace file to read.",
      "title": "WorkspacesReadFileRequest",
      "stability": "experimental"
    },
    "WorkspacesReadFileResult": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "File content as a UTF-8 string"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Contents of the requested workspace file as a UTF-8 string.",
      "title": "WorkspacesReadFileResult"
    },
    "WorkspacesSaveLargePasteRequest": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Pasted content to save as a UTF-8 file"
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Pasted content to save as a UTF-8 file in the session workspace.",
      "title": "WorkspacesSaveLargePasteRequest",
      "stability": "experimental"
    },
    "WorkspacesSaveLargePasteResult": {
      "type": "object",
      "properties": {
        "saved": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "filePath": {
                  "type": "string",
                  "description": "Absolute filesystem path to the saved paste file"
                },
                "filename": {
                  "type": "string",
                  "description": "Filename within the workspace files directory"
                },
                "sizeBytes": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "Size of the saved file in bytes"
                }
              },
              "required": [
                "filePath",
                "filename",
                "sizeBytes"
              ],
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ],
          "description": "Saved-paste descriptor, or null when the workspace is unavailable (e.g. CCA runtime, non-infinite sessions, remote sessions)"
        }
      },
      "required": [
        "saved"
      ],
      "additionalProperties": false,
      "description": "Descriptor for the saved paste file, or null when the workspace is unavailable.",
      "title": "WorkspacesSaveLargePasteResult"
    },
    "WorkspacesTruncateSummariesRequest": {
      "type": "object",
      "properties": {
        "keepCount": {
          "type": "integer",
          "minimum": 0,
          "description": "Number of newest summaries to keep."
        }
      },
      "required": [
        "keepCount"
      ],
      "additionalProperties": false,
      "description": "Rollback point for local workspace summaries.",
      "title": "WorkspacesTruncateSummariesRequest",
      "stability": "experimental"
    },
    "WorkspaceSummary": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "minLength": 1,
              "description": "Workspace identifier (1:1 with sessionId)"
            },
            "cwd": {
              "type": "string",
              "description": "Current working directory at session start"
            },
            "git_root": {
              "type": "string",
              "description": "Resolved git root for cwd, if any"
            },
            "repository": {
              "type": "string",
              "description": "Repository identifier in 'owner/repo' or 'org/project/repo' format, if any"
            },
            "host_type": {
              "$ref": "#/definitions/WorkspaceSummaryHostType",
              "description": "Repository host type, if known"
            },
            "branch": {
              "type": "string",
              "description": "Branch checked out at session start, if any"
            },
            "name": {
              "type": "string",
              "description": "Display name for the session, if set"
            },
            "user_named": {
              "type": "boolean",
              "description": "Whether the display name was explicitly set by the user"
            },
            "created_at": {
              "type": "string",
              "format": "date-time",
              "description": "ISO 8601 timestamp when the workspace was created"
            },
            "updated_at": {
              "type": "string",
              "format": "date-time",
              "description": "ISO 8601 timestamp when the workspace was last updated"
            }
          },
          "required": [
            "id"
          ],
          "additionalProperties": false,
          "description": "Public-facing projection of workspace metadata for SDK / TUI consumers"
        },
        {
          "type": "null"
        }
      ],
      "description": "Public-facing workspace metadata for this session, or null if the session has no associated workspace. Excludes runtime-internal fields (GitHub IDs, summary count, internal flags).",
      "title": "WorkspaceSummary"
    },
    "WorkspaceSummaryHostType": {
      "type": "string",
      "enum": [
        "github",
        "ado"
      ],
      "description": "Repository host type, if known",
      "title": "WorkspaceSummaryHostType",
      "x-enumDescriptions": {
        "github": "Workspace summary repository is hosted on GitHub.",
        "ado": "Workspace summary repository is hosted on Azure DevOps."
      }
    },
    "WorkspacesUpdateMetadataRequest": {
      "type": "object",
      "properties": {
        "context": {
          "description": "Opaque workspace context supplied by the session host.",
          "x-opaque-json": true
        },
        "name": {
          "type": "string",
          "description": "Optional workspace display name override."
        }
      },
      "additionalProperties": false,
      "description": "Workspace metadata fields to update.",
      "title": "WorkspacesUpdateMetadataRequest",
      "stability": "experimental"
    },
    "WorkspacesWorkspaceDetailsHostType": {
      "type": "string",
      "enum": [
        "github",
        "ado"
      ],
      "description": "Allowed values for the `WorkspacesWorkspaceDetailsHostType` enumeration.",
      "title": "WorkspacesWorkspaceDetailsHostType",
      "x-enumDescriptions": {
        "github": "Workspace repository is hosted on GitHub.",
        "ado": "Workspace repository is hosted on Azure DevOps."
      }
    },
    "WorkspacesWriteAutopilotObjectiveRequest": {
      "type": "object",
      "properties": {
        "content": {
          "type": "string",
          "description": "Autopilot objective file content."
        }
      },
      "required": [
        "content"
      ],
      "additionalProperties": false,
      "description": "Autopilot objective file content to persist.",
      "title": "WorkspacesWriteAutopilotObjectiveRequest",
      "stability": "experimental"
    },
    "WorkspacesWriteAutopilotObjectiveResult": {
      "type": "object",
      "properties": {
        "operation": {
          "type": "string",
          "description": "Filesystem operation performed."
        }
      },
      "required": [
        "operation"
      ],
      "additionalProperties": false,
      "description": "Result of writing the autopilot objective file.",
      "title": "WorkspacesWriteAutopilotObjectiveResult",
      "stability": "experimental"
    }
  }
}
