mirror of
https://github.com/openai/codex.git
synced 2026-11-08 20:40:33 +00:00
Expose declared onboarding skills in plugin details (#46544)
## What changed Add an optional `onboardingSkill` summary to `plugin/read` responses and update the generated schemas, TypeScript types, and Python models. - Resolve local declarations from `extensions["com.openai"].onboardingSkill`, accepting relative paths with or without `./`. Require the resolved path to stay within the plugin root and match a loaded skill. - Match remote release metadata's `onboarding_skill_name` against the plugin's skills. - Return the summary only when the plugin and matching visible skill are enabled; remote plugins must also be available. Otherwise, return `null`. ## Testing Add parameterized local and remote `plugin/read` tests covering matching, missing, and unmatched declarations, disabled plugins and skills, and unavailable remote plugins. GitOrigin-RevId: 88cabdfddbecba5efba756617da0cb1ff064bdf7
This commit is contained in:
@@ -18,6 +18,7 @@ pub struct PluginManifest<Resource> {
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct PluginManifestPaths<Resource> {
|
||||
pub skills: Vec<Resource>,
|
||||
pub onboarding_skill: Option<Resource>,
|
||||
pub mcp_servers: Option<PluginManifestMcpServers<Resource>>,
|
||||
pub apps: Option<Resource>,
|
||||
pub hooks: Option<PluginManifestHooks<Resource>>,
|
||||
@@ -105,6 +106,7 @@ impl<Resource> PluginManifest<Resource> {
|
||||
} = self;
|
||||
let PluginManifestPaths {
|
||||
skills,
|
||||
onboarding_skill,
|
||||
mcp_servers,
|
||||
apps,
|
||||
hooks,
|
||||
@@ -181,6 +183,7 @@ impl<Resource> PluginManifest<Resource> {
|
||||
.into_iter()
|
||||
.map(&mut map)
|
||||
.collect::<Result<Vec<_>, _>>()?,
|
||||
onboarding_skill: onboarding_skill.map(&mut map).transpose()?,
|
||||
mcp_servers,
|
||||
apps: apps.map(&mut map).transpose()?,
|
||||
hooks,
|
||||
|
||||
@@ -43,6 +43,7 @@ fn environment_descriptor_binds_every_manifest_resource() {
|
||||
description: None,
|
||||
keywords: Vec::new(),
|
||||
paths: PluginManifestPaths {
|
||||
onboarding_skill: None,
|
||||
skills: vec![path_uri(&skills)],
|
||||
mcp_servers: Some(PluginManifestMcpServers::Path(path_uri(&mcp_servers))),
|
||||
apps: Some(path_uri(&apps)),
|
||||
@@ -77,6 +78,7 @@ fn environment_descriptor_binds_every_manifest_resource() {
|
||||
description: None,
|
||||
keywords: Vec::new(),
|
||||
paths: PluginManifestPaths {
|
||||
onboarding_skill: None,
|
||||
skills: vec![resource("executor-1", &skills)],
|
||||
mcp_servers: Some(PluginManifestMcpServers::Path(resource(
|
||||
"executor-1",
|
||||
@@ -109,6 +111,7 @@ fn environment_descriptor_rejects_resources_outside_package_root() {
|
||||
description: None,
|
||||
keywords: Vec::new(),
|
||||
paths: PluginManifestPaths {
|
||||
onboarding_skill: None,
|
||||
skills: Vec::new(),
|
||||
mcp_servers: Some(PluginManifestMcpServers::Path(path_uri(&outside))),
|
||||
apps: None,
|
||||
|
||||
Reference in New Issue
Block a user