mirror of
https://github.com/openai/codex.git
synced 2026-04-26 07:35:29 +00:00
feat: add APIs to list and download public remote skills (#10448)
Add API to list / download from remote public skills
This commit is contained in:
@@ -269,6 +269,15 @@ pub enum Op {
|
||||
force_reload: bool,
|
||||
},
|
||||
|
||||
/// Request the list of remote skills available via ChatGPT sharing.
|
||||
ListRemoteSkills,
|
||||
|
||||
/// Download a remote skill by id into the local skills cache.
|
||||
DownloadRemoteSkill {
|
||||
hazelnut_id: String,
|
||||
is_preload: bool,
|
||||
},
|
||||
|
||||
/// Request the agent to summarize the current conversation context.
|
||||
/// The agent will use its existing context (either conversation history or previous response id)
|
||||
/// to generate a summary which will be returned as an AgentMessage event.
|
||||
@@ -822,6 +831,12 @@ pub enum EventMsg {
|
||||
/// List of skills available to the agent.
|
||||
ListSkillsResponse(ListSkillsResponseEvent),
|
||||
|
||||
/// List of remote skills available to the agent.
|
||||
ListRemoteSkillsResponse(ListRemoteSkillsResponseEvent),
|
||||
|
||||
/// Remote skill downloaded to local cache.
|
||||
RemoteSkillDownloaded(RemoteSkillDownloadedEvent),
|
||||
|
||||
/// Notification that skill data may have been updated and clients may want to reload.
|
||||
SkillsUpdateAvailable,
|
||||
|
||||
@@ -2127,6 +2142,27 @@ pub struct ListSkillsResponseEvent {
|
||||
pub skills: Vec<SkillsListEntry>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct RemoteSkillSummary {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
}
|
||||
|
||||
/// Response payload for `Op::ListRemoteSkills`.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct ListRemoteSkillsResponseEvent {
|
||||
pub skills: Vec<RemoteSkillSummary>,
|
||||
}
|
||||
|
||||
/// Response payload for `Op::DownloadRemoteSkill`.
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, JsonSchema, TS)]
|
||||
pub struct RemoteSkillDownloadedEvent {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub path: PathBuf,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, JsonSchema, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(rename_all = "snake_case")]
|
||||
|
||||
Reference in New Issue
Block a user