mirror of
https://github.com/openai/codex.git
synced 2026-04-30 17:36:40 +00:00
An experimental flow for env var skill dependencies. Skills can now declare required env vars in SKILL.md; if missing, the CLI prompts the user to get the value, and Core will store it in memory (eventually to a local persistent store) <img width="790" height="169" alt="image" src="https://github.com/user-attachments/assets/cd928918-9403-43cb-a7e7-b8d59bcccd9a" />
56 lines
1.7 KiB
Rust
56 lines
1.7 KiB
Rust
use std::collections::HashMap;
|
|
|
|
use schemars::JsonSchema;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
use ts_rs::TS;
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputQuestionOption {
|
|
pub label: String,
|
|
pub description: String,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputQuestion {
|
|
pub id: String,
|
|
pub header: String,
|
|
pub question: String,
|
|
#[serde(rename = "isOther", default)]
|
|
#[schemars(rename = "isOther")]
|
|
#[ts(rename = "isOther")]
|
|
pub is_other: bool,
|
|
#[serde(rename = "isSecret", default)]
|
|
#[schemars(rename = "isSecret")]
|
|
#[ts(rename = "isSecret")]
|
|
pub is_secret: bool,
|
|
#[serde(skip_serializing_if = "Option::is_none")]
|
|
pub options: Option<Vec<RequestUserInputQuestionOption>>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputArgs {
|
|
pub questions: Vec<RequestUserInputQuestion>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputAnswer {
|
|
pub answers: Vec<String>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputResponse {
|
|
pub answers: HashMap<String, RequestUserInputAnswer>,
|
|
}
|
|
|
|
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, JsonSchema, TS)]
|
|
pub struct RequestUserInputEvent {
|
|
/// Responses API call id for the associated tool call, if available.
|
|
pub call_id: String,
|
|
/// Turn ID that this request belongs to.
|
|
/// Uses `#[serde(default)]` for backwards compatibility.
|
|
#[serde(default)]
|
|
pub turn_id: String,
|
|
pub questions: Vec<RequestUserInputQuestion>,
|
|
}
|