Add onboarding option picker tool

This commit is contained in:
rafaelj
2026-05-21 14:44:57 -04:00
parent df3e2c3265
commit 90006cb729
33 changed files with 894 additions and 3 deletions
@@ -1664,6 +1664,71 @@
"ThreadId": {
"type": "string"
},
"ToolOptionPickerOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_option_picker.",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"label": {
"type": "string"
}
},
"required": [
"label"
],
"type": "object"
},
"ToolOptionPickerParams": {
"description": "EXPERIMENTAL. Params sent with a request_option_picker event.",
"properties": {
"allowMultiple": {
"type": "boolean"
},
"itemId": {
"type": "string"
},
"options": {
"items": {
"$ref": "#/definitions/ToolOptionPickerOption"
},
"type": "array"
},
"question": {
"type": "string"
},
"skipLabel": {
"type": [
"string",
"null"
]
},
"submitLabel": {
"type": [
"string",
"null"
]
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"allowMultiple",
"itemId",
"options",
"question",
"threadId",
"turnId"
],
"type": "object"
},
"ToolRequestUserInputOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_user_input.",
"properties": {
@@ -1822,6 +1887,31 @@
"title": "Item/tool/requestUserInputRequest",
"type": "object"
},
{
"description": "EXPERIMENTAL - Request compact option selection from the user for a tool call.",
"properties": {
"id": {
"$ref": "#/definitions/RequestId"
},
"method": {
"enum": [
"item/tool/requestOptionPicker"
],
"title": "Item/tool/requestOptionPickerRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ToolOptionPickerParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Item/tool/requestOptionPickerRequest",
"type": "object"
},
{
"description": "Request input for an MCP server elicitation.",
"properties": {
@@ -0,0 +1,69 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ToolOptionPickerOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_option_picker.",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"label": {
"type": "string"
}
},
"required": [
"label"
],
"type": "object"
}
},
"description": "EXPERIMENTAL. Params sent with a request_option_picker event.",
"properties": {
"allowMultiple": {
"type": "boolean"
},
"itemId": {
"type": "string"
},
"options": {
"items": {
"$ref": "#/definitions/ToolOptionPickerOption"
},
"type": "array"
},
"question": {
"type": "string"
},
"skipLabel": {
"type": [
"string",
"null"
]
},
"submitLabel": {
"type": [
"string",
"null"
]
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"allowMultiple",
"itemId",
"options",
"question",
"threadId",
"turnId"
],
"title": "ToolOptionPickerParams",
"type": "object"
}
@@ -0,0 +1,38 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"ToolOptionPickerAction": {
"description": "EXPERIMENTAL. Action selected for request_option_picker.",
"enum": [
"submit",
"skip",
"dismiss"
],
"type": "string"
}
},
"description": "EXPERIMENTAL. Captures a user's response to request_option_picker.",
"properties": {
"action": {
"$ref": "#/definitions/ToolOptionPickerAction"
},
"freeformAnswer": {
"type": [
"string",
"null"
]
},
"selectedOptions": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"action",
"selectedOptions"
],
"title": "ToolOptionPickerResponse",
"type": "object"
}
@@ -5296,6 +5296,31 @@
"title": "Item/tool/requestUserInputRequest",
"type": "object"
},
{
"description": "EXPERIMENTAL - Request compact option selection from the user for a tool call.",
"properties": {
"id": {
"$ref": "#/definitions/v2/RequestId"
},
"method": {
"enum": [
"item/tool/requestOptionPicker"
],
"title": "Item/tool/requestOptionPickerRequestMethod",
"type": "string"
},
"params": {
"$ref": "#/definitions/ToolOptionPickerParams"
}
},
"required": [
"id",
"method",
"params"
],
"title": "Item/tool/requestOptionPickerRequest",
"type": "object"
},
{
"description": "Request input for an MCP server elicitation.",
"properties": {
@@ -5473,6 +5498,109 @@
],
"title": "ServerRequest"
},
"ToolOptionPickerAction": {
"description": "EXPERIMENTAL. Action selected for request_option_picker.",
"enum": [
"submit",
"skip",
"dismiss"
],
"type": "string"
},
"ToolOptionPickerOption": {
"description": "EXPERIMENTAL. Defines a single selectable option for request_option_picker.",
"properties": {
"description": {
"type": [
"string",
"null"
]
},
"label": {
"type": "string"
}
},
"required": [
"label"
],
"type": "object"
},
"ToolOptionPickerParams": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "EXPERIMENTAL. Params sent with a request_option_picker event.",
"properties": {
"allowMultiple": {
"type": "boolean"
},
"itemId": {
"type": "string"
},
"options": {
"items": {
"$ref": "#/definitions/ToolOptionPickerOption"
},
"type": "array"
},
"question": {
"type": "string"
},
"skipLabel": {
"type": [
"string",
"null"
]
},
"submitLabel": {
"type": [
"string",
"null"
]
},
"threadId": {
"type": "string"
},
"turnId": {
"type": "string"
}
},
"required": [
"allowMultiple",
"itemId",
"options",
"question",
"threadId",
"turnId"
],
"title": "ToolOptionPickerParams",
"type": "object"
},
"ToolOptionPickerResponse": {
"$schema": "http://json-schema.org/draft-07/schema#",
"description": "EXPERIMENTAL. Captures a user's response to request_option_picker.",
"properties": {
"action": {
"$ref": "#/definitions/ToolOptionPickerAction"
},
"freeformAnswer": {
"type": [
"string",
"null"
]
},
"selectedOptions": {
"items": {
"type": "string"
},
"type": "array"
}
},
"required": [
"action",
"selectedOptions"
],
"title": "ToolOptionPickerResponse",
"type": "object"
},
"ToolRequestUserInputAnswer": {
"description": "EXPERIMENTAL. Captures a user's answer to a request_user_input question.",
"properties": {
@@ -11,9 +11,10 @@ import type { DynamicToolCallParams } from "./v2/DynamicToolCallParams";
import type { FileChangeRequestApprovalParams } from "./v2/FileChangeRequestApprovalParams";
import type { McpServerElicitationRequestParams } from "./v2/McpServerElicitationRequestParams";
import type { PermissionsRequestApprovalParams } from "./v2/PermissionsRequestApprovalParams";
import type { ToolOptionPickerParams } from "./v2/ToolOptionPickerParams";
import type { ToolRequestUserInputParams } from "./v2/ToolRequestUserInputParams";
/**
* Request initiated from the server and sent to the client.
*/
export type ServerRequest = { "method": "item/commandExecution/requestApproval", id: RequestId, params: CommandExecutionRequestApprovalParams, } | { "method": "item/fileChange/requestApproval", id: RequestId, params: FileChangeRequestApprovalParams, } | { "method": "item/tool/requestUserInput", id: RequestId, params: ToolRequestUserInputParams, } | { "method": "mcpServer/elicitation/request", id: RequestId, params: McpServerElicitationRequestParams, } | { "method": "item/permissions/requestApproval", id: RequestId, params: PermissionsRequestApprovalParams, } | { "method": "item/tool/call", id: RequestId, params: DynamicToolCallParams, } | { "method": "account/chatgptAuthTokens/refresh", id: RequestId, params: ChatgptAuthTokensRefreshParams, } | { "method": "attestation/generate", id: RequestId, params: AttestationGenerateParams, } | { "method": "applyPatchApproval", id: RequestId, params: ApplyPatchApprovalParams, } | { "method": "execCommandApproval", id: RequestId, params: ExecCommandApprovalParams, };
export type ServerRequest = { "method": "item/commandExecution/requestApproval", id: RequestId, params: CommandExecutionRequestApprovalParams, } | { "method": "item/fileChange/requestApproval", id: RequestId, params: FileChangeRequestApprovalParams, } | { "method": "item/tool/requestUserInput", id: RequestId, params: ToolRequestUserInputParams, } | { "method": "item/tool/requestOptionPicker", id: RequestId, params: ToolOptionPickerParams, } | { "method": "mcpServer/elicitation/request", id: RequestId, params: McpServerElicitationRequestParams, } | { "method": "item/permissions/requestApproval", id: RequestId, params: PermissionsRequestApprovalParams, } | { "method": "item/tool/call", id: RequestId, params: DynamicToolCallParams, } | { "method": "account/chatgptAuthTokens/refresh", id: RequestId, params: ChatgptAuthTokensRefreshParams, } | { "method": "attestation/generate", id: RequestId, params: AttestationGenerateParams, } | { "method": "applyPatchApproval", id: RequestId, params: ApplyPatchApprovalParams, } | { "method": "execCommandApproval", id: RequestId, params: ExecCommandApprovalParams, };
@@ -0,0 +1,8 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* EXPERIMENTAL. Action selected for request_option_picker.
*/
export type ToolOptionPickerAction = "submit" | "skip" | "dismiss";
@@ -0,0 +1,8 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
/**
* EXPERIMENTAL. Defines a single selectable option for request_option_picker.
*/
export type ToolOptionPickerOption = { label: string, description: string | null, };
@@ -0,0 +1,9 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ToolOptionPickerOption } from "./ToolOptionPickerOption";
/**
* EXPERIMENTAL. Params sent with a request_option_picker event.
*/
export type ToolOptionPickerParams = { threadId: string, turnId: string, itemId: string, question: string, options: Array<ToolOptionPickerOption>, allowMultiple: boolean, submitLabel: string | null, skipLabel: string | null, };
@@ -0,0 +1,9 @@
// GENERATED CODE! DO NOT MODIFY BY HAND!
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ToolOptionPickerAction } from "./ToolOptionPickerAction";
/**
* EXPERIMENTAL. Captures a user's response to request_option_picker.
*/
export type ToolOptionPickerResponse = { action: ToolOptionPickerAction, selectedOptions: Array<string>, freeformAnswer: string | null, };
@@ -425,6 +425,10 @@ export type { ThreadUnsubscribeParams } from "./ThreadUnsubscribeParams";
export type { ThreadUnsubscribeResponse } from "./ThreadUnsubscribeResponse";
export type { ThreadUnsubscribeStatus } from "./ThreadUnsubscribeStatus";
export type { TokenUsageBreakdown } from "./TokenUsageBreakdown";
export type { ToolOptionPickerAction } from "./ToolOptionPickerAction";
export type { ToolOptionPickerOption } from "./ToolOptionPickerOption";
export type { ToolOptionPickerParams } from "./ToolOptionPickerParams";
export type { ToolOptionPickerResponse } from "./ToolOptionPickerResponse";
export type { ToolRequestUserInputAnswer } from "./ToolRequestUserInputAnswer";
export type { ToolRequestUserInputOption } from "./ToolRequestUserInputOption";
export type { ToolRequestUserInputParams } from "./ToolRequestUserInputParams";
@@ -1334,6 +1334,12 @@ server_request_definitions! {
response: v2::ToolRequestUserInputResponse,
},
/// EXPERIMENTAL - Request compact option selection from the user for a tool call.
ToolOptionPicker => "item/tool/requestOptionPicker" {
params: v2::ToolOptionPickerParams,
response: v2::ToolOptionPickerResponse,
},
/// Request input for an MCP server elicitation.
McpServerElicitationRequest => "mcpServer/elicitation/request" {
params: v2::McpServerElicitationRequestParams,
@@ -1447,3 +1447,47 @@ pub struct ToolRequestUserInputAnswer {
pub struct ToolRequestUserInputResponse {
pub answers: HashMap<String, ToolRequestUserInputAnswer>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// EXPERIMENTAL. Defines a single selectable option for request_option_picker.
pub struct ToolOptionPickerOption {
pub label: String,
pub description: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// EXPERIMENTAL. Params sent with a request_option_picker event.
pub struct ToolOptionPickerParams {
pub thread_id: String,
pub turn_id: String,
pub item_id: String,
pub question: String,
pub options: Vec<ToolOptionPickerOption>,
pub allow_multiple: bool,
pub submit_label: Option<String>,
pub skip_label: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "snake_case")]
#[ts(export_to = "v2/")]
/// EXPERIMENTAL. Action selected for request_option_picker.
pub enum ToolOptionPickerAction {
Submit,
Skip,
Dismiss,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
/// EXPERIMENTAL. Captures a user's response to request_option_picker.
pub struct ToolOptionPickerResponse {
pub action: ToolOptionPickerAction,
pub selected_options: Vec<String>,
pub freeform_answer: Option<String>,
}