mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
feat: Expose plugin versions and gate plugin sharing (#22397)
- Adds localVersion to plugin summaries and remoteVersion to share
context, including generated API schemas.
- Hydrates local and remote plugin versions from manifests and remote
release metadata.
- Adds default-on plugin_sharing gate for shared-with-me listing and
plugin/share/save, with disabled-path errors
and focused coverage.
This commit is contained in:
@@ -540,6 +540,9 @@ pub struct PluginSummary {
|
||||
pub id: String,
|
||||
/// Backend remote plugin identifier when available.
|
||||
pub remote_plugin_id: Option<String>,
|
||||
/// Version of the locally materialized plugin package when available.
|
||||
#[serde(default)]
|
||||
pub local_version: Option<String>,
|
||||
pub name: String,
|
||||
/// Remote sharing context associated with this plugin when available.
|
||||
pub share_context: Option<PluginShareContext>,
|
||||
@@ -561,6 +564,9 @@ pub struct PluginSummary {
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct PluginShareContext {
|
||||
pub remote_plugin_id: String,
|
||||
/// Version of the remote shared plugin release when available.
|
||||
#[serde(default)]
|
||||
pub remote_version: Option<String>,
|
||||
pub discoverability: Option<PluginShareDiscoverability>,
|
||||
pub share_url: Option<String>,
|
||||
pub creator_account_user_id: Option<String>,
|
||||
|
||||
@@ -3007,6 +3007,7 @@ fn plugin_share_list_response_serializes_share_items() {
|
||||
remote_plugin_id: Some(
|
||||
"plugins~Plugin_00000000000000000000000000000000".to_string(),
|
||||
),
|
||||
local_version: None,
|
||||
name: "gmail".to_string(),
|
||||
share_context: None,
|
||||
source: PluginSource::Remote,
|
||||
@@ -3027,6 +3028,7 @@ fn plugin_share_list_response_serializes_share_items() {
|
||||
"plugin": {
|
||||
"id": "gmail@chatgpt-global",
|
||||
"remotePluginId": "plugins~Plugin_00000000000000000000000000000000",
|
||||
"localVersion": null,
|
||||
"name": "gmail",
|
||||
"shareContext": null,
|
||||
"source": { "type": "remote" },
|
||||
@@ -3059,6 +3061,7 @@ fn plugin_summary_defaults_missing_availability_to_available() {
|
||||
.unwrap();
|
||||
|
||||
assert_eq!(summary.availability, PluginAvailability::Available);
|
||||
assert_eq!(summary.local_version, None);
|
||||
assert_eq!(summary.share_context, None);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user