diff --git a/nodejs/src/generated/rpc.ts b/nodejs/src/generated/rpc.ts index 0174e476b..55fd1ca4b 100644 --- a/nodejs/src/generated/rpc.ts +++ b/nodejs/src/generated/rpc.ts @@ -2265,7 +2265,9 @@ export type ModelPickerCategory = /** Versatile model category suitable for a broad range of tasks. */ | "versatile" /** Powerful model category optimized for complex tasks. */ - | "powerful"; + | "powerful" + /** Experimental model category for models that require an explicit experimental opt-in. */ + | "experimental"; /** * Relative cost tier for token-based billing users * @@ -2282,6 +2284,14 @@ export type ModelPickerPriceCategory = | "high" /** Highest relative token cost tier. */ | "very_high"; +/** + * How a server-level model list was resolved. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelsListResolutionMode". + */ +/** @experimental */ +export type ModelsListResolutionMode = /** The runtime applied the supplied pre-session context. */ "pre-session"; /** * Optional listing options. * @@ -2299,6 +2309,15 @@ export type ModelListRequest = */ skipCache?: boolean; }; + +/** @experimental */ +export type ModelsListSessionKind = "top-level"; + +/** @experimental */ +export type ModelsListExecutionEnvironment = "local"; + +/** @experimental */ +export type ModelsListModelBackend = "copilot"; /** * Provider type. Defaults to "openai" for generic OpenAI-compatible APIs. * @@ -12194,6 +12213,21 @@ export interface ModelList { * List of available models with full metadata */ models: Model[]; + resolution?: ModelsListResolution; +} +/** + * Acknowledges how the runtime resolved a server-level model list. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelsListResolution". + */ +/** @experimental */ +export interface ModelsListResolution { + mode: ModelsListResolutionMode; + /** + * Version of the applied pre-session context contract. + */ + contextVersion: number; } /** @experimental */ @@ -12266,6 +12300,35 @@ export interface ModelsListRequest { * GitHub token accepted for compatibility with existing SDK clients. When provided, resolves this token instead of using the current account. */ gitHubToken?: string; + sessionContext?: ModelsListPreSessionContext; +} +/** + * Ordinary session inputs used to resolve a selectable model snapshot before session creation. Version 1 is limited to local, top-level, Copilot-backed sessions. + * + * This interface was referenced by `_RpcSchemaRoot`'s JSON-Schema + * via the `definition` "ModelsListPreSessionContext". + */ +/** @experimental */ +export interface ModelsListPreSessionContext { + /** + * Pre-session context contract version. Version 1 is the only supported value. + */ + version: number; + sessionKind: ModelsListSessionKind; + executionEnvironment: ModelsListExecutionEnvironment; + modelBackend: ModelsListModelBackend; + /** + * Working directory used to evaluate repository model policy. + */ + workingDirectory: string; + /** + * Whether the subsequent top-level session will enable experimental mode. + */ + enableExperimentalMode: boolean; + /** + * Existing ExP assignment response supplied using the same ordinary session input as `session.create`. The runtime interprets assignments; callers must not submit resolved feature or kill-switch claims. + */ + expAssignments?: JsonValue; } /** @experimental */ @@ -22442,7 +22505,7 @@ export function createServerRpc(connection: MessageConnection) { /** * Lists Copilot models available to the authenticated user. * - * @param params Optional opaque account selection or compatibility GitHub token used to list models. + * @param params Optional account selection and pre-session context used to list models. * * @returns List of Copilot models available to the resolved user, including capabilities and billing metadata. */ diff --git a/rust/src/generated/api_types.rs b/rust/src/generated/api_types.rs index 0583c0922..aa8e06e6e 100644 --- a/rust/src/generated/api_types.rs +++ b/rust/src/generated/api_types.rs @@ -10077,6 +10077,23 @@ pub struct ModelCapabilitiesOverride { pub supports: Option, } +/// Acknowledges how the runtime resolved a server-level model list. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelsListResolution { + /// Version of the applied pre-session context contract. + pub context_version: i32, + /// Resolution mode applied by the runtime. + pub mode: ModelsListResolutionMode, +} + /// List of Copilot models available to the resolved user, including capabilities and billing metadata. /// ///
@@ -10090,6 +10107,9 @@ pub struct ModelCapabilitiesOverride { pub struct ModelList { /// List of available models with full metadata pub models: Vec, + /// Present only when the runtime applied a pre-session resolution context. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, } /// Optional listing options. @@ -10178,7 +10198,35 @@ pub struct ModelSetReasoningEffortResult { pub reasoning_effort: String, } -/// Optional opaque account selection or compatibility GitHub token used to list models. +/// Ordinary session inputs used to resolve a selectable model snapshot before session creation. Version 1 is limited to local, top-level, Copilot-backed sessions. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ModelsListPreSessionContext { + /// Whether the subsequent top-level session will enable experimental mode. + pub enable_experimental_mode: bool, + /// Execution environment being planned. Version 1 accepts only `local`. + pub execution_environment: ModelsListExecutionEnvironment, + /// Existing ExP assignment response supplied using the same ordinary session input as `session.create`. The runtime interprets assignments; callers must not submit resolved feature or kill-switch claims. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_assignments: Option, + /// Model backend being planned. Version 1 accepts only `copilot`. + pub model_backend: ModelsListModelBackend, + /// Session kind being planned. Version 1 accepts only `top-level`. + pub session_kind: ModelsListSessionKind, + /// Pre-session context contract version. Version 1 is the only supported value. + pub version: i32, + /// Working directory used to evaluate repository model policy. + pub working_directory: String, +} + +/// Optional account selection and pre-session context used to list models. /// ///
/// @@ -10195,6 +10243,9 @@ pub struct ModelsListRequest { /// Opaque account identifier returned by `account.getAllUsers`. When omitted, the current account is used. #[serde(skip_serializing_if = "Option::is_none")] pub selection_id: Option, + /// Optional versioned context for resolving the model picker before creating a session. + #[serde(skip_serializing_if = "Option::is_none")] + pub session_context: Option, } /// @@ -21082,6 +21133,9 @@ pub struct WorkspacesWriteAutopilotObjectiveResult { pub struct ModelsListResult { /// List of available models with full metadata pub models: Vec, + /// Present only when the runtime applied a pre-session resolution context. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, } /// The running runtime's complete catalog of well-known built-in model IDs, including supported models and additional IDs with built-in metadata. @@ -30406,6 +30460,9 @@ pub enum ModelPickerCategory { /// Powerful model category optimized for complex tasks. #[serde(rename = "powerful")] Powerful, + /// Experimental model category for models that require an explicit experimental opt-in. + #[serde(rename = "experimental")] + Experimental, /// Unknown variant for forward compatibility. #[default] #[serde(other)] @@ -30465,6 +30522,76 @@ pub enum ModelPolicyState { Unknown, } +/// How a server-level model list was resolved. +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelsListResolutionMode { + /// The runtime applied the supplied pre-session context. + #[serde(rename = "pre-session")] + PreSession, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelsListExecutionEnvironment { + #[serde(rename = "local")] + Local, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelsListModelBackend { + #[serde(rename = "copilot")] + Copilot, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + +/// +///
+/// +/// **Experimental.** This type is part of an experimental wire-protocol surface +/// and may change or be removed in future SDK or CLI releases. +/// +///
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)] +pub enum ModelsListSessionKind { + #[serde(rename = "top-level")] + TopLevel, + /// Unknown variant for forward compatibility. + #[default] + #[serde(other)] + Unknown, +} + /// Provider transport. Defaults to "http". /// ///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs index c955637e3..9b396084d 100644 --- a/rust/src/generated/rpc.rs +++ b/rust/src/generated/rpc.rs @@ -1144,7 +1144,7 @@ impl<'a> ClientRpcModels<'a> { /// /// # Parameters /// - /// * `params` - Optional opaque account selection or compatibility GitHub token used to list models. + /// * `params` - Optional account selection and pre-session context used to list models. /// /// # Returns ///