diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json index e219f42551..6080dde8af 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.schemas.json @@ -12108,6 +12108,14 @@ "title": "PluginListParams", "type": "object" }, + "PluginListRemoteRoute": { + "enum": [ + "global", + "workspace-directory", + "shared-with-me" + ], + "type": "string" + }, "PluginListResponse": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -12130,6 +12138,13 @@ "$ref": "#/definitions/v2/PluginMarketplaceEntry" }, "type": "array" + }, + "remoteRoutes": { + "default": [], + "items": { + "$ref": "#/definitions/v2/PluginListRemoteRoute" + }, + "type": "array" } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json index fb1a8d2505..f1e864b6f0 100644 --- a/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json +++ b/codex-rs/app-server-protocol/schema/json/codex_app_server_protocol.v2.schemas.json @@ -8657,6 +8657,14 @@ "title": "PluginListParams", "type": "object" }, + "PluginListRemoteRoute": { + "enum": [ + "global", + "workspace-directory", + "shared-with-me" + ], + "type": "string" + }, "PluginListResponse": { "$schema": "http://json-schema.org/draft-07/schema#", "properties": { @@ -8679,6 +8687,13 @@ "$ref": "#/definitions/PluginMarketplaceEntry" }, "type": "array" + }, + "remoteRoutes": { + "default": [], + "items": { + "$ref": "#/definitions/PluginListRemoteRoute" + }, + "type": "array" } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/json/v2/PluginListResponse.json b/codex-rs/app-server-protocol/schema/json/v2/PluginListResponse.json index d756f61a68..061557889b 100644 --- a/codex-rs/app-server-protocol/schema/json/v2/PluginListResponse.json +++ b/codex-rs/app-server-protocol/schema/json/v2/PluginListResponse.json @@ -193,6 +193,14 @@ ], "type": "object" }, + "PluginListRemoteRoute": { + "enum": [ + "global", + "workspace-directory", + "shared-with-me" + ], + "type": "string" + }, "PluginMarketplaceEntry": { "properties": { "interface": { @@ -522,6 +530,13 @@ "$ref": "#/definitions/PluginMarketplaceEntry" }, "type": "array" + }, + "remoteRoutes": { + "default": [], + "items": { + "$ref": "#/definitions/PluginListRemoteRoute" + }, + "type": "array" } }, "required": [ diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginListRemoteRoute.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListRemoteRoute.ts new file mode 100644 index 0000000000..3a5b109ff2 --- /dev/null +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListRemoteRoute.ts @@ -0,0 +1,5 @@ +// 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. + +export type PluginListRemoteRoute = "global" | "workspace-directory" | "shared-with-me"; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/PluginListResponse.ts b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListResponse.ts index d50200c905..2600d7bd79 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/PluginListResponse.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/PluginListResponse.ts @@ -2,6 +2,7 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. import type { MarketplaceLoadErrorInfo } from "./MarketplaceLoadErrorInfo"; +import type { PluginListRemoteRoute } from "./PluginListRemoteRoute"; import type { PluginMarketplaceEntry } from "./PluginMarketplaceEntry"; -export type PluginListResponse = { marketplaces: Array, marketplaceLoadErrors: Array, featuredPluginIds: Array, }; +export type PluginListResponse = { marketplaces: Array, marketplaceLoadErrors: Array, featuredPluginIds: Array, remoteRoutes: Array, }; diff --git a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts index dc400a6f8e..2171e13430 100644 --- a/codex-rs/app-server-protocol/schema/typescript/v2/index.ts +++ b/codex-rs/app-server-protocol/schema/typescript/v2/index.ts @@ -270,6 +270,7 @@ export type { PluginInstalledResponse } from "./PluginInstalledResponse"; export type { PluginInterface } from "./PluginInterface"; export type { PluginListMarketplaceKind } from "./PluginListMarketplaceKind"; export type { PluginListParams } from "./PluginListParams"; +export type { PluginListRemoteRoute } from "./PluginListRemoteRoute"; export type { PluginListResponse } from "./PluginListResponse"; export type { PluginMarketplaceEntry } from "./PluginMarketplaceEntry"; export type { PluginReadParams } from "./PluginReadParams"; diff --git a/codex-rs/app-server-protocol/src/protocol/v2/plugin.rs b/codex-rs/app-server-protocol/src/protocol/v2/plugin.rs index 33c2670077..00253b8b0d 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/plugin.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/plugin.rs @@ -152,6 +152,20 @@ pub enum PluginListMarketplaceKind { SharedWithMe, } +#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)] +#[ts(export_to = "v2/")] +pub enum PluginListRemoteRoute { + #[serde(rename = "global")] + #[ts(rename = "global")] + Global, + #[serde(rename = "workspace-directory")] + #[ts(rename = "workspace-directory")] + WorkspaceDirectory, + #[serde(rename = "shared-with-me")] + #[ts(rename = "shared-with-me")] + SharedWithMe, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] #[serde(rename_all = "camelCase")] #[ts(export_to = "v2/")] @@ -161,6 +175,8 @@ pub struct PluginListResponse { pub marketplace_load_errors: Vec, #[serde(default)] pub featured_plugin_ids: Vec, + #[serde(default)] + pub remote_routes: Vec, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)] diff --git a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs index 0e7161d5e8..a7e97eadf6 100644 --- a/codex-rs/app-server-protocol/src/protocol/v2/tests.rs +++ b/codex-rs/app-server-protocol/src/protocol/v2/tests.rs @@ -2695,6 +2695,29 @@ fn plugin_marketplace_entry_serializes_remote_only_path_as_null() { ); } +#[test] +fn plugin_list_response_serializes_remote_routes() { + assert_eq!( + serde_json::to_value(PluginListResponse { + marketplaces: Vec::new(), + marketplace_load_errors: Vec::new(), + featured_plugin_ids: Vec::new(), + remote_routes: vec![ + PluginListRemoteRoute::Global, + PluginListRemoteRoute::WorkspaceDirectory, + PluginListRemoteRoute::SharedWithMe, + ], + }) + .unwrap(), + json!({ + "marketplaces": [], + "marketplaceLoadErrors": [], + "featuredPluginIds": [], + "remoteRoutes": ["global", "workspace-directory", "shared-with-me"], + }), + ); +} + #[test] fn plugin_interface_serializes_local_paths_and_remote_urls_separately() { let composer_icon = if cfg!(windows) { diff --git a/codex-rs/app-server/README.md b/codex-rs/app-server/README.md index 9073282b4e..5a7c13f99a 100644 --- a/codex-rs/app-server/README.md +++ b/codex-rs/app-server/README.md @@ -197,7 +197,7 @@ Example with notification opt-out: - `marketplace/add` — add a remote plugin marketplace from an HTTP(S) Git URL, SSH Git URL, or GitHub `owner/repo` shorthand, then persist it into the user marketplace config. Returns the installed root path plus whether the marketplace was already present. - `marketplace/remove` — remove a configured marketplace by name from the user marketplace config, and delete its installed marketplace root when one exists. - `marketplace/upgrade` — upgrade all configured Git plugin marketplaces, or one named marketplace when `marketplaceName` is provided. Returns selected marketplace names, upgraded roots, and per-marketplace errors. -- `plugin/list` — list discovered plugin marketplaces and plugin state, including effective marketplace install/auth policy metadata, plugin `availability` (`AVAILABLE` by default or `DISABLED_BY_ADMIN` for remote plugins blocked upstream), fail-open `marketplaceLoadErrors` entries for marketplace files that could not be parsed or loaded, and best-effort `featuredPluginIds` for the official curated marketplace. `interface.category` uses the marketplace category when present; otherwise it falls back to the plugin manifest category (**under development; do not call from production clients yet**). +- `plugin/list` — list discovered plugin marketplaces and plugin state, including effective marketplace install/auth policy metadata, plugin `availability` (`AVAILABLE` by default or `DISABLED_BY_ADMIN` for remote plugins blocked upstream), fail-open `marketplaceLoadErrors` entries for marketplace files that could not be parsed or loaded, best-effort `featuredPluginIds` for the official curated marketplace, and `remoteRoutes` for the remote catalog routes that successfully participated in the response. `interface.category` uses the marketplace category when present; otherwise it falls back to the plugin manifest category (**under development; do not call from production clients yet**). - `plugin/installed` — list installed plugin rows plus any explicitly requested local install-suggestion plugin names, without fetching the broader remote catalog. Mention surfaces can use this narrower view when they need plugin mention payloads rather than plugin-page discovery data (**under development; do not call from production clients yet**). - `plugin/read` — read one plugin by `marketplacePath` plus `pluginName`, returning marketplace info, a list-style `summary`, manifest descriptions/interface metadata, and bundled skills/hooks/apps/MCP server names. Returned plugin skills include their current `enabled` state after local config filtering; bundled hooks are returned as lightweight declaration summaries keyed for correlation with `hooks/list`. Plugin app summaries also include `needsAuth` when the server can determine connector accessibility (**under development; do not call from production clients yet**). - `plugin/skill/read` — read remote plugin skill markdown on demand by `remoteMarketplaceName`, `remotePluginId`, and `skillName`. This lets clients preview uninstalled remote plugin skills without downloading the plugin bundle. diff --git a/codex-rs/app-server/src/request_processors.rs b/codex-rs/app-server/src/request_processors.rs index 3e84c397f8..616fe095ab 100644 --- a/codex-rs/app-server/src/request_processors.rs +++ b/codex-rs/app-server/src/request_processors.rs @@ -111,6 +111,7 @@ use codex_app_server_protocol::PluginInstalledResponse; use codex_app_server_protocol::PluginInterface; use codex_app_server_protocol::PluginListMarketplaceKind; use codex_app_server_protocol::PluginListParams; +use codex_app_server_protocol::PluginListRemoteRoute; use codex_app_server_protocol::PluginListResponse; use codex_app_server_protocol::PluginMarketplaceEntry; use codex_app_server_protocol::PluginReadParams; diff --git a/codex-rs/app-server/src/request_processors/plugins.rs b/codex-rs/app-server/src/request_processors/plugins.rs index 199ddf1191..c2e82c4d62 100644 --- a/codex-rs/app-server/src/request_processors/plugins.rs +++ b/codex-rs/app-server/src/request_processors/plugins.rs @@ -481,6 +481,7 @@ impl PluginRequestProcessor { marketplaces: Vec::new(), marketplace_load_errors: Vec::new(), featured_plugin_ids: Vec::new(), + remote_routes: Vec::new(), }; if !config.features.enabled(Feature::Plugins) { return Ok(empty_response()); @@ -576,6 +577,7 @@ impl PluginRequestProcessor { { remote_sources.push(RemoteMarketplaceSource::SharedWithMe); } + let mut remote_routes = Vec::new(); if !remote_sources.is_empty() { let remote_plugin_service_config = RemotePluginServiceConfig { chatgpt_base_url: config.chatgpt_base_url.clone(), @@ -588,6 +590,18 @@ impl PluginRequestProcessor { .await { Ok(remote_marketplaces) => { + remote_routes = remote_sources + .iter() + .map(|source| match source { + RemoteMarketplaceSource::Global => PluginListRemoteRoute::Global, + RemoteMarketplaceSource::WorkspaceDirectory => { + PluginListRemoteRoute::WorkspaceDirectory + } + RemoteMarketplaceSource::SharedWithMe => { + PluginListRemoteRoute::SharedWithMe + } + }) + .collect(); for remote_marketplace in remote_marketplaces .into_iter() .map(remote_marketplace_to_info) @@ -655,6 +669,7 @@ impl PluginRequestProcessor { marketplaces: data, marketplace_load_errors, featured_plugin_ids, + remote_routes, }) } diff --git a/codex-rs/app-server/tests/suite/v2/plugin_list.rs b/codex-rs/app-server/tests/suite/v2/plugin_list.rs index d439a4585b..9cf1f9843c 100644 --- a/codex-rs/app-server/tests/suite/v2/plugin_list.rs +++ b/codex-rs/app-server/tests/suite/v2/plugin_list.rs @@ -13,6 +13,7 @@ use codex_app_server_protocol::PluginInstalledParams; use codex_app_server_protocol::PluginInstalledResponse; use codex_app_server_protocol::PluginListMarketplaceKind; use codex_app_server_protocol::PluginListParams; +use codex_app_server_protocol::PluginListRemoteRoute; use codex_app_server_protocol::PluginListResponse; use codex_app_server_protocol::PluginMarketplaceEntry; use codex_app_server_protocol::PluginShareDiscoverability; @@ -443,6 +444,7 @@ async fn plugin_list_returns_empty_when_workspace_codex_plugins_disabled() -> Re marketplaces: Vec::new(), marketplace_load_errors: Vec::new(), featured_plugin_ids: Vec::new(), + remote_routes: Vec::new(), } ); Ok(()) @@ -1710,6 +1712,7 @@ async fn plugin_list_includes_remote_marketplaces_when_remote_plugin_enabled() - ) .await??; let response: PluginListResponse = to_response(response)?; + assert_eq!(response.remote_routes, vec![PluginListRemoteRoute::Global]); let remote_marketplace = response .marketplaces @@ -2031,6 +2034,10 @@ async fn plugin_list_fetches_workspace_directory_kind_without_remote_plugin_flag .await??; let response: PluginListResponse = to_response(response)?; + assert_eq!( + response.remote_routes, + vec![PluginListRemoteRoute::WorkspaceDirectory] + ); assert_eq!(response.marketplaces.len(), 1); let marketplace = &response.marketplaces[0]; assert_eq!(marketplace.name, "workspace-directory"); @@ -2148,6 +2155,10 @@ async fn plugin_list_fetches_shared_with_me_kind() -> Result<()> { .await??; let response: PluginListResponse = to_response(response)?; + assert_eq!( + response.remote_routes, + vec![PluginListRemoteRoute::SharedWithMe] + ); assert_eq!(response.marketplaces.len(), 2); let marketplace = response .marketplaces @@ -2311,6 +2322,7 @@ plugin_sharing = false marketplaces: Vec::new(), marketplace_load_errors: Vec::new(), featured_plugin_ids: Vec::new(), + remote_routes: Vec::new(), } ); wait_for_remote_plugin_request_count( diff --git a/codex-rs/cli/src/marketplace_cmd.rs b/codex-rs/cli/src/marketplace_cmd.rs index 2ec948eacb..4625c8457a 100644 --- a/codex-rs/cli/src/marketplace_cmd.rs +++ b/codex-rs/cli/src/marketplace_cmd.rs @@ -166,6 +166,7 @@ async fn run_list(overrides: Vec<(String, toml::Value)>) -> Result<()> { } let default_install_root = marketplace_install_root(config.codex_home.as_path()); + println!("NAME\tSOURCE\tPATH"); for (marketplace_name, marketplace) in configured_marketplaces { if !marketplace.is_table() { eprintln!("Ignoring invalid marketplace `{marketplace_name}`: expected table."); @@ -182,7 +183,11 @@ async fn run_list(overrides: Vec<(String, toml::Value)>) -> Result<()> { ) .map(|root| root.display().to_string()) .unwrap_or_else(|| "".to_string()); - println!("{marketplace_name}\t{root}"); + let source = marketplace + .get("source") + .and_then(toml::Value::as_str) + .unwrap_or("-"); + println!("{marketplace_name}\t{source}\t{root}"); } Ok(()) diff --git a/codex-rs/cli/tests/plugin_cli.rs b/codex-rs/cli/tests/plugin_cli.rs index 9829e4df07..f5156f76c6 100644 --- a/codex-rs/cli/tests/plugin_cli.rs +++ b/codex-rs/cli/tests/plugin_cli.rs @@ -126,6 +126,7 @@ async fn marketplace_list_shows_configured_marketplace_names() -> Result<()> { .args(["plugin", "marketplace", "list"]) .assert() .success() + .stdout(contains("NAME\tSOURCE\tPATH")) .stdout(contains("debug")) .stdout(contains(source.path().display().to_string())); diff --git a/codex-rs/tui/src/app/background_requests.rs b/codex-rs/tui/src/app/background_requests.rs index dcf1f672be..9e312b5efc 100644 --- a/codex-rs/tui/src/app/background_requests.rs +++ b/codex-rs/tui/src/app/background_requests.rs @@ -1017,6 +1017,7 @@ mod tests { ], marketplace_load_errors: Vec::new(), featured_plugin_ids: Vec::new(), + remote_routes: Vec::new(), }; hide_cli_only_plugin_marketplaces(&mut response); diff --git a/codex-rs/tui/src/chatwidget/tests/helpers.rs b/codex-rs/tui/src/chatwidget/tests/helpers.rs index 3bd0030465..72d1e7fea1 100644 --- a/codex-rs/tui/src/chatwidget/tests/helpers.rs +++ b/codex-rs/tui/src/chatwidget/tests/helpers.rs @@ -1365,6 +1365,7 @@ pub(super) fn plugins_test_response( marketplaces, marketplace_load_errors: Vec::new(), featured_plugin_ids: Vec::new(), + remote_routes: Vec::new(), } }