aKode fase 2b-1: rimossi plugin remoti e share, bundle download, UI usage/crediti/banner/workspace ChatGPT; fix argomenti MCP (inviati vuoti dopo e4209e2) e overlay TUI; test analytics-upload rimossi; test sicurezza MCP adattati
Some checks failed
blocking-ci / Bazel (push) Has been cancelled
blocking-ci / Blob size policy (push) Has been cancelled
blocking-ci / cargo-deny (push) Has been cancelled
blocking-ci / Codespell (push) Has been cancelled
blocking-ci / repo-checks (push) Has been cancelled
blocking-ci / rust-ci (push) Has been cancelled
blocking-ci / sdk (push) Has been cancelled
blocking-ci / CI required (push) Has been cancelled
postmerge-ci / rust-ci-full (push) Has been cancelled
postmerge-ci / v8-canary (push) Has been cancelled
postmerge-ci / Postmerge CI results (push) Has been cancelled
Some checks failed
blocking-ci / Bazel (push) Has been cancelled
blocking-ci / Blob size policy (push) Has been cancelled
blocking-ci / cargo-deny (push) Has been cancelled
blocking-ci / Codespell (push) Has been cancelled
blocking-ci / repo-checks (push) Has been cancelled
blocking-ci / rust-ci (push) Has been cancelled
blocking-ci / sdk (push) Has been cancelled
blocking-ci / CI required (push) Has been cancelled
postmerge-ci / rust-ci-full (push) Has been cancelled
postmerge-ci / v8-canary (push) Has been cancelled
postmerge-ci / Postmerge CI results (push) Has been cancelled
This commit is contained in:
@@ -202,24 +202,6 @@ late proofs after the approval is canceled or resolved. Only one native worker
|
||||
runs per app-server; if an OS call remains active after cancellation or timeout,
|
||||
subsequent local operations return `failed/providerError` until that worker exits.
|
||||
|
||||
# Hosted Codex Apps MCP protocol
|
||||
|
||||
The host-owned HTTP `codex_apps` server uses Legacy by default in app-server and
|
||||
standalone Codex. To discover the 2026-07-28 protocol, set
|
||||
`codex_apps_mcp_2026_07_28 = true` under `[features]`, or send a true runtime
|
||||
override via `experimentalFeature/enablement/set`. Discovery falls back to Legacy
|
||||
when the server does not support it. Explicit config takes precedence.
|
||||
The dedicated setting does not apply to third-party HTTP or local `codex_app`
|
||||
stdio servers. The existing `mcp_2026_07_28` flag still governs eligible other
|
||||
servers, regardless of whether their names or URLs resemble hosted Apps.
|
||||
App-server does not persist this selection.
|
||||
|
||||
## Hosted resource reads
|
||||
|
||||
`mcpServer/resource/read` accepts `target: {connectorId, linkId}` for direct hosted app reads without tool discovery. A string `linkId` selects that account; `null` explicitly requests no-auth access subject to backend policy. Do not infer no-auth access from unknown or synthetic links.
|
||||
|
||||
`originCallId` with `threadId` takes precedence and retains the originating app/account scope. Requests without `target` retain discovery; `connectorId` continues to restrict reads to that connector. Direct targets require backend support for app/account resource reads.
|
||||
|
||||
# Project trust
|
||||
|
||||
`thread/start` does not persist project trust for a directory where configuration
|
||||
|
||||
@@ -127,22 +127,14 @@ use codex_app_server_protocol::PluginMarketplaceEntry;
|
||||
use codex_app_server_protocol::PluginReadParams;
|
||||
use codex_app_server_protocol::PluginReadResponse;
|
||||
use codex_app_server_protocol::PluginShareCheckoutParams;
|
||||
use codex_app_server_protocol::PluginShareCheckoutResponse;
|
||||
use codex_app_server_protocol::PluginShareContext;
|
||||
use codex_app_server_protocol::PluginShareDeleteParams;
|
||||
use codex_app_server_protocol::PluginShareDeleteResponse;
|
||||
use codex_app_server_protocol::PluginShareDiscoverability;
|
||||
use codex_app_server_protocol::PluginShareListItem;
|
||||
use codex_app_server_protocol::PluginShareListParams;
|
||||
use codex_app_server_protocol::PluginShareListResponse;
|
||||
use codex_app_server_protocol::PluginSharePrincipal;
|
||||
use codex_app_server_protocol::PluginSharePrincipalType;
|
||||
use codex_app_server_protocol::PluginShareSaveParams;
|
||||
use codex_app_server_protocol::PluginShareSaveResponse;
|
||||
use codex_app_server_protocol::PluginShareTarget;
|
||||
use codex_app_server_protocol::PluginShareUpdateDiscoverability;
|
||||
use codex_app_server_protocol::PluginShareUpdateTargetsParams;
|
||||
use codex_app_server_protocol::PluginShareUpdateTargetsResponse;
|
||||
use codex_app_server_protocol::PluginSkillReadParams;
|
||||
use codex_app_server_protocol::PluginSkillReadResponse;
|
||||
use codex_app_server_protocol::PluginSource;
|
||||
@@ -352,7 +344,6 @@ use codex_core_plugins::remote::RemotePluginCatalogError;
|
||||
use codex_core_plugins::remote::RemotePluginDetail as RemoteCatalogPluginDetail;
|
||||
use codex_core_plugins::remote::RemotePluginServiceConfig;
|
||||
use codex_core_plugins::remote::RemotePluginShareContext as RemoteCatalogPluginShareContext;
|
||||
use codex_core_plugins::remote::RemotePluginShareSummary as RemoteCatalogPluginShareSummary;
|
||||
use codex_core_plugins::remote::RemotePluginSummary as RemoteCatalogPluginSummary;
|
||||
use codex_exec_server::EnvironmentManager;
|
||||
use codex_exec_server::EnvironmentObservedStatus;
|
||||
|
||||
@@ -1202,4 +1202,3 @@ pub(crate) async fn clear_account_configuration(
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ use crate::error_code::method_not_found;
|
||||
use codex_analytics::PluginInstallSource;
|
||||
use codex_app_server_protocol::PluginAvailability;
|
||||
use codex_app_server_protocol::PluginSharePrincipalRole;
|
||||
use codex_app_server_protocol::PluginShareTargetRole;
|
||||
use codex_config::types::McpServerConfig;
|
||||
use codex_config::types::PluginsConfigToml;
|
||||
use codex_core_plugins::OPENAI_CURATED_MARKETPLACE_NAME;
|
||||
@@ -29,7 +28,6 @@ use codex_core_plugins::remote::RemotePluginCatalogCacheMode;
|
||||
use codex_core_plugins::remote::RemotePluginScope;
|
||||
use codex_core_plugins::remote::is_valid_remote_plugin_id;
|
||||
use codex_core_plugins::remote::validate_remote_plugin_id;
|
||||
use codex_core_plugins::remote_bundle::RemotePluginBundleInstallError;
|
||||
use codex_mcp::McpOAuthLoginSupport;
|
||||
use codex_mcp::McpRuntimeContext;
|
||||
use codex_mcp::oauth_login_support;
|
||||
@@ -286,65 +284,6 @@ fn installed_plugin_names(plugins: &[PluginSummary]) -> HashSet<String> {
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn remote_plugin_share_discoverability(
|
||||
discoverability: PluginShareDiscoverability,
|
||||
) -> codex_core_plugins::remote::RemotePluginShareDiscoverability {
|
||||
match discoverability {
|
||||
PluginShareDiscoverability::Listed => {
|
||||
codex_core_plugins::remote::RemotePluginShareDiscoverability::Listed
|
||||
}
|
||||
PluginShareDiscoverability::Unlisted => {
|
||||
codex_core_plugins::remote::RemotePluginShareDiscoverability::Unlisted
|
||||
}
|
||||
PluginShareDiscoverability::Private => {
|
||||
codex_core_plugins::remote::RemotePluginShareDiscoverability::Private
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_plugin_share_update_discoverability(
|
||||
discoverability: PluginShareUpdateDiscoverability,
|
||||
) -> codex_core_plugins::remote::RemotePluginShareUpdateDiscoverability {
|
||||
match discoverability {
|
||||
PluginShareUpdateDiscoverability::Listed => {
|
||||
codex_core_plugins::remote::RemotePluginShareUpdateDiscoverability::Listed
|
||||
}
|
||||
PluginShareUpdateDiscoverability::Unlisted => {
|
||||
codex_core_plugins::remote::RemotePluginShareUpdateDiscoverability::Unlisted
|
||||
}
|
||||
PluginShareUpdateDiscoverability::Private => {
|
||||
codex_core_plugins::remote::RemotePluginShareUpdateDiscoverability::Private
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn validate_client_plugin_share_targets(
|
||||
targets: &[PluginShareTarget],
|
||||
) -> Result<(), JSONRPCErrorError> {
|
||||
if targets
|
||||
.iter()
|
||||
.any(|target| target.principal_type == PluginSharePrincipalType::Workspace)
|
||||
{
|
||||
return Err(invalid_request(
|
||||
"shareTargets cannot include workspace principals; use discoverability UNLISTED for workspace link access",
|
||||
));
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn remote_plugin_share_target_role(
|
||||
role: PluginShareTargetRole,
|
||||
) -> codex_core_plugins::remote::RemotePluginShareTargetRole {
|
||||
match role {
|
||||
PluginShareTargetRole::Reader => {
|
||||
codex_core_plugins::remote::RemotePluginShareTargetRole::Reader
|
||||
}
|
||||
PluginShareTargetRole::Editor => {
|
||||
codex_core_plugins::remote::RemotePluginShareTargetRole::Editor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn plugin_share_principal_role_from_remote(
|
||||
role: codex_core_plugins::remote::RemotePluginSharePrincipalRole,
|
||||
) -> PluginSharePrincipalRole {
|
||||
@@ -361,31 +300,6 @@ fn plugin_share_principal_role_from_remote(
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_plugin_share_targets(
|
||||
targets: Vec<PluginShareTarget>,
|
||||
) -> Vec<codex_core_plugins::remote::RemotePluginShareTarget> {
|
||||
targets
|
||||
.into_iter()
|
||||
.map(
|
||||
|target| codex_core_plugins::remote::RemotePluginShareTarget {
|
||||
principal_type: match target.principal_type {
|
||||
PluginSharePrincipalType::User => {
|
||||
codex_core_plugins::remote::RemotePluginSharePrincipalType::User
|
||||
}
|
||||
PluginSharePrincipalType::Group => {
|
||||
codex_core_plugins::remote::RemotePluginSharePrincipalType::Group
|
||||
}
|
||||
PluginSharePrincipalType::Workspace => {
|
||||
codex_core_plugins::remote::RemotePluginSharePrincipalType::Workspace
|
||||
}
|
||||
},
|
||||
principal_id: target.principal_id,
|
||||
role: remote_plugin_share_target_role(target.role),
|
||||
},
|
||||
)
|
||||
.collect()
|
||||
}
|
||||
|
||||
fn plugin_share_principal_from_remote(
|
||||
principal: codex_core_plugins::remote::RemotePluginSharePrincipal,
|
||||
) -> PluginSharePrincipal {
|
||||
@@ -466,47 +380,37 @@ impl PluginRequestProcessor {
|
||||
|
||||
pub(crate) async fn plugin_share_save(
|
||||
&self,
|
||||
params: PluginShareSaveParams,
|
||||
_params: PluginShareSaveParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
self.plugin_share_save_response(params)
|
||||
.await
|
||||
.map(|response| Some(response.into()))
|
||||
Err(plugin_sharing_unavailable())
|
||||
}
|
||||
|
||||
pub(crate) async fn plugin_share_update_targets(
|
||||
&self,
|
||||
params: PluginShareUpdateTargetsParams,
|
||||
_params: PluginShareUpdateTargetsParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
self.plugin_share_update_targets_response(params)
|
||||
.await
|
||||
.map(|response| Some(response.into()))
|
||||
Err(plugin_sharing_unavailable())
|
||||
}
|
||||
|
||||
pub(crate) async fn plugin_share_list(
|
||||
&self,
|
||||
params: PluginShareListParams,
|
||||
_params: PluginShareListParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
self.plugin_share_list_response(params)
|
||||
.await
|
||||
.map(|response| Some(response.into()))
|
||||
Err(plugin_sharing_unavailable())
|
||||
}
|
||||
|
||||
pub(crate) async fn plugin_share_checkout(
|
||||
&self,
|
||||
params: PluginShareCheckoutParams,
|
||||
_params: PluginShareCheckoutParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
self.plugin_share_checkout_response(params)
|
||||
.await
|
||||
.map(|response| Some(response.into()))
|
||||
Err(plugin_sharing_unavailable())
|
||||
}
|
||||
|
||||
pub(crate) async fn plugin_share_delete(
|
||||
&self,
|
||||
params: PluginShareDeleteParams,
|
||||
_params: PluginShareDeleteParams,
|
||||
) -> Result<Option<ClientResponsePayload>, JSONRPCErrorError> {
|
||||
self.plugin_share_delete_response(params)
|
||||
.await
|
||||
.map(|response| Some(response.into()))
|
||||
Err(plugin_sharing_unavailable())
|
||||
}
|
||||
|
||||
pub(crate) async fn plugin_install(
|
||||
@@ -1290,225 +1194,6 @@ impl PluginRequestProcessor {
|
||||
})
|
||||
}
|
||||
|
||||
async fn plugin_share_save_response(
|
||||
&self,
|
||||
params: PluginShareSaveParams,
|
||||
) -> Result<PluginShareSaveResponse, JSONRPCErrorError> {
|
||||
let (config, auth) = self.load_plugin_share_config_and_auth().await?;
|
||||
if !config.features.enabled(Feature::PluginSharing) {
|
||||
return Err(invalid_request("plugin sharing is disabled"));
|
||||
}
|
||||
let PluginShareSaveParams {
|
||||
plugin_path,
|
||||
remote_plugin_id,
|
||||
discoverability,
|
||||
share_targets,
|
||||
} = params;
|
||||
if let Some(remote_plugin_id) = remote_plugin_id.as_ref()
|
||||
&& (remote_plugin_id.is_empty() || !is_valid_remote_plugin_id(remote_plugin_id))
|
||||
{
|
||||
return Err(invalid_request("invalid remote plugin id"));
|
||||
}
|
||||
if remote_plugin_id.is_some() && (discoverability.is_some() || share_targets.is_some()) {
|
||||
return Err(invalid_request(
|
||||
"discoverability and shareTargets are only supported when creating a plugin share; use plugin/share/updateTargets to update share settings",
|
||||
));
|
||||
}
|
||||
if discoverability == Some(PluginShareDiscoverability::Listed) {
|
||||
return Err(invalid_request(
|
||||
"discoverability LISTED is not supported for plugin/share/save; use UNLISTED or PRIVATE",
|
||||
));
|
||||
}
|
||||
if let Some(share_targets) = share_targets.as_ref() {
|
||||
validate_client_plugin_share_targets(share_targets)?;
|
||||
}
|
||||
|
||||
let remote_plugin_service_config =
|
||||
remote_plugin_service_config(&self.thread_manager, &config)?;
|
||||
let access_policy = codex_core_plugins::remote::RemotePluginShareAccessPolicy {
|
||||
discoverability: discoverability.map(remote_plugin_share_discoverability),
|
||||
share_targets: share_targets.map(remote_plugin_share_targets),
|
||||
};
|
||||
let result = codex_core_plugins::remote::save_remote_plugin_share(
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
config.codex_home.as_path(),
|
||||
&plugin_path,
|
||||
remote_plugin_id.as_deref(),
|
||||
access_policy,
|
||||
)
|
||||
.await
|
||||
.map_err(|err| remote_plugin_catalog_error_to_jsonrpc(err, "save remote plugin share"))?;
|
||||
codex_core_plugins::remote::invalidate_cached_remote_plugin_catalog_scopes(
|
||||
config.codex_home.as_path(),
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
&[RemotePluginScope::User, RemotePluginScope::Workspace],
|
||||
);
|
||||
let remote_plugin_id = result.remote_plugin_id;
|
||||
self.clear_plugin_related_caches();
|
||||
Ok(PluginShareSaveResponse {
|
||||
remote_plugin_id,
|
||||
share_url: result.share_url.unwrap_or_default(),
|
||||
can_publish_to_workspace: result.can_publish_to_workspace,
|
||||
})
|
||||
}
|
||||
|
||||
async fn plugin_share_update_targets_response(
|
||||
&self,
|
||||
params: PluginShareUpdateTargetsParams,
|
||||
) -> Result<PluginShareUpdateTargetsResponse, JSONRPCErrorError> {
|
||||
let (config, auth) = self.load_plugin_share_config_and_auth().await?;
|
||||
if !config.features.enabled(Feature::PluginSharing) {
|
||||
return Err(invalid_request("plugin sharing is disabled"));
|
||||
}
|
||||
let PluginShareUpdateTargetsParams {
|
||||
remote_plugin_id,
|
||||
discoverability,
|
||||
share_targets,
|
||||
} = params;
|
||||
if remote_plugin_id.is_empty() || !is_valid_remote_plugin_id(&remote_plugin_id) {
|
||||
return Err(invalid_request("invalid remote plugin id"));
|
||||
}
|
||||
validate_client_plugin_share_targets(&share_targets)?;
|
||||
|
||||
let remote_plugin_service_config =
|
||||
remote_plugin_service_config(&self.thread_manager, &config)?;
|
||||
let result = codex_core_plugins::remote::update_remote_plugin_share_targets(
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
&remote_plugin_id,
|
||||
remote_plugin_share_targets(share_targets),
|
||||
remote_plugin_share_update_discoverability(discoverability),
|
||||
)
|
||||
.await
|
||||
.map_err(|err| {
|
||||
remote_plugin_catalog_error_to_jsonrpc(err, "update remote plugin share targets")
|
||||
})?;
|
||||
codex_core_plugins::remote::invalidate_cached_remote_plugin_catalog_scopes(
|
||||
config.codex_home.as_path(),
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
&[RemotePluginScope::User, RemotePluginScope::Workspace],
|
||||
);
|
||||
self.clear_plugin_related_caches();
|
||||
Ok(PluginShareUpdateTargetsResponse {
|
||||
principals: result
|
||||
.principals
|
||||
.into_iter()
|
||||
.map(plugin_share_principal_from_remote)
|
||||
.collect(),
|
||||
discoverability: remote_plugin_share_discoverability_to_info(result.discoverability),
|
||||
})
|
||||
}
|
||||
|
||||
async fn plugin_share_list_response(
|
||||
&self,
|
||||
_params: PluginShareListParams,
|
||||
) -> Result<PluginShareListResponse, JSONRPCErrorError> {
|
||||
let (config, auth) = self.load_plugin_share_config_and_auth().await?;
|
||||
let remote_plugin_service_config =
|
||||
remote_plugin_service_config(&self.thread_manager, &config)?;
|
||||
let plugin_policy = &config.plugins;
|
||||
let data = codex_core_plugins::remote::list_remote_plugin_shares(
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
config.codex_home.as_path(),
|
||||
)
|
||||
.await
|
||||
.map_err(|err| remote_plugin_catalog_error_to_jsonrpc(err, "list remote plugin shares"))?
|
||||
.into_iter()
|
||||
.map(|summary| {
|
||||
let RemoteCatalogPluginShareSummary {
|
||||
summary,
|
||||
local_plugin_path,
|
||||
} = summary;
|
||||
let plugin = remote_plugin_summary_to_info(summary, plugin_policy);
|
||||
PluginShareListItem {
|
||||
plugin,
|
||||
local_plugin_path,
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
Ok(PluginShareListResponse { data })
|
||||
}
|
||||
|
||||
async fn plugin_share_checkout_response(
|
||||
&self,
|
||||
params: PluginShareCheckoutParams,
|
||||
) -> Result<PluginShareCheckoutResponse, JSONRPCErrorError> {
|
||||
let (config, auth) = self.load_plugin_share_config_and_auth().await?;
|
||||
if !config.features.enabled(Feature::PluginSharing) {
|
||||
return Err(invalid_request("plugin sharing is disabled"));
|
||||
}
|
||||
let PluginShareCheckoutParams { remote_plugin_id } = params;
|
||||
if remote_plugin_id.is_empty() || !is_valid_remote_plugin_id(&remote_plugin_id) {
|
||||
return Err(invalid_request("invalid remote plugin id"));
|
||||
}
|
||||
|
||||
let remote_plugin_service_config =
|
||||
remote_plugin_service_config(&self.thread_manager, &config)?;
|
||||
let result = codex_core_plugins::remote::checkout_remote_plugin_share(
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
config.codex_home.as_path(),
|
||||
&remote_plugin_id,
|
||||
)
|
||||
.await
|
||||
.map_err(|err| remote_plugin_catalog_error_to_jsonrpc(err, "checkout plugin share"))?;
|
||||
self.clear_plugin_related_caches();
|
||||
Ok(PluginShareCheckoutResponse {
|
||||
remote_plugin_id: result.remote_plugin_id,
|
||||
plugin_id: result.plugin_id,
|
||||
plugin_name: result.plugin_name,
|
||||
plugin_path: result.plugin_path,
|
||||
marketplace_name: result.marketplace_name,
|
||||
marketplace_path: result.marketplace_path,
|
||||
remote_version: result.remote_version,
|
||||
})
|
||||
}
|
||||
|
||||
async fn plugin_share_delete_response(
|
||||
&self,
|
||||
params: PluginShareDeleteParams,
|
||||
) -> Result<PluginShareDeleteResponse, JSONRPCErrorError> {
|
||||
let (config, auth) = self.load_plugin_share_config_and_auth().await?;
|
||||
let PluginShareDeleteParams { remote_plugin_id } = params;
|
||||
if remote_plugin_id.is_empty() || !is_valid_remote_plugin_id(&remote_plugin_id) {
|
||||
return Err(invalid_request("invalid remote plugin id"));
|
||||
}
|
||||
|
||||
let remote_plugin_service_config =
|
||||
remote_plugin_service_config(&self.thread_manager, &config)?;
|
||||
codex_core_plugins::remote::delete_remote_plugin_share(
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
config.codex_home.as_path(),
|
||||
&remote_plugin_id,
|
||||
)
|
||||
.await
|
||||
.map_err(|err| remote_plugin_catalog_error_to_jsonrpc(err, "delete remote plugin share"))?;
|
||||
codex_core_plugins::remote::invalidate_cached_remote_plugin_catalog_scopes(
|
||||
config.codex_home.as_path(),
|
||||
&remote_plugin_service_config,
|
||||
auth.as_ref(),
|
||||
&[RemotePluginScope::User, RemotePluginScope::Workspace],
|
||||
);
|
||||
self.clear_plugin_related_caches();
|
||||
Ok(PluginShareDeleteResponse {})
|
||||
}
|
||||
|
||||
async fn load_plugin_share_config_and_auth(
|
||||
&self,
|
||||
) -> Result<(Config, Option<CodexAuth>), JSONRPCErrorError> {
|
||||
let config = self.load_latest_config(/*fallback_cwd*/ None).await?;
|
||||
if !config.features.enabled(Feature::Plugins) {
|
||||
return Err(invalid_request("plugin sharing is not enabled"));
|
||||
}
|
||||
let auth = self.auth_manager.auth().await;
|
||||
Ok((config, auth))
|
||||
}
|
||||
|
||||
async fn plugin_install_response(
|
||||
&self,
|
||||
params: PluginInstallParams,
|
||||
@@ -1660,10 +1345,6 @@ impl PluginRequestProcessor {
|
||||
remote_plugin_catalog_error_type(source),
|
||||
source.sub_error_type(),
|
||||
)),
|
||||
RemotePluginOperationErrorKind::Bundle(source) => Some((
|
||||
remote_plugin_bundle_install_error_type(source),
|
||||
source.sub_error_type(),
|
||||
)),
|
||||
RemotePluginOperationErrorKind::DisabledByAdmin(_) => Some((
|
||||
"remote_plugin_not_available",
|
||||
Some("disabled_by_admin".to_string()),
|
||||
@@ -2328,56 +2009,12 @@ fn remote_plugin_catalog_error_type(err: &RemotePluginCatalogError) -> &'static
|
||||
"remote_catalog_unexpected_enabled_state"
|
||||
}
|
||||
RemotePluginCatalogError::InvalidPluginPath { .. } => "remote_catalog_invalid_plugin_path",
|
||||
RemotePluginCatalogError::PluginShareCheckoutNotAvailable { .. } => {
|
||||
"remote_catalog_plugin_share_checkout_not_available"
|
||||
}
|
||||
RemotePluginCatalogError::Archive { .. } => "remote_catalog_archive",
|
||||
RemotePluginCatalogError::ArchiveJoin(_) => "remote_catalog_archive_join",
|
||||
RemotePluginCatalogError::ArchiveTooLarge { .. } => "remote_catalog_archive_too_large",
|
||||
RemotePluginCatalogError::MissingUploadEtag => "remote_catalog_missing_upload_etag",
|
||||
RemotePluginCatalogError::UnexpectedResponse(_) => "remote_catalog_unexpected_response",
|
||||
RemotePluginCatalogError::InstalledPluginsFetchTimeout => "remote_catalog_timeout",
|
||||
RemotePluginCatalogError::CacheRemove(_) => "remote_catalog_cache_remove",
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_plugin_bundle_install_error_type(err: &RemotePluginBundleInstallError) -> &'static str {
|
||||
match err {
|
||||
RemotePluginBundleInstallError::Unavailable => "remote_bundle_unavailable",
|
||||
RemotePluginBundleInstallError::MissingReleaseVersion { .. } => {
|
||||
"remote_bundle_missing_release_version"
|
||||
}
|
||||
RemotePluginBundleInstallError::InvalidReleaseVersion { .. } => {
|
||||
"remote_bundle_invalid_release_version"
|
||||
}
|
||||
RemotePluginBundleInstallError::MissingBundleDownloadUrl { .. } => {
|
||||
"remote_bundle_missing_download_url"
|
||||
}
|
||||
RemotePluginBundleInstallError::InvalidBundleDownloadUrl { .. } => {
|
||||
"remote_bundle_invalid_download_url"
|
||||
}
|
||||
RemotePluginBundleInstallError::UnsupportedBundleDownloadUrlScheme { .. } => {
|
||||
"remote_bundle_unsupported_download_url_scheme"
|
||||
}
|
||||
RemotePluginBundleInstallError::InvalidPluginId { .. } => "remote_bundle_invalid_plugin_id",
|
||||
RemotePluginBundleInstallError::DownloadRequest { .. } => "remote_bundle_download_request",
|
||||
RemotePluginBundleInstallError::DownloadStatus { .. } => "remote_bundle_download_status",
|
||||
RemotePluginBundleInstallError::DownloadBody { .. } => "remote_bundle_download_body",
|
||||
RemotePluginBundleInstallError::DownloadTooLarge { .. } => {
|
||||
"remote_bundle_download_too_large"
|
||||
}
|
||||
RemotePluginBundleInstallError::UnsupportedBundleDownloadFinalUrl { .. } => {
|
||||
"remote_bundle_unsupported_download_final_url"
|
||||
}
|
||||
RemotePluginBundleInstallError::ExtractedBundleTooLarge { .. } => {
|
||||
"remote_bundle_extracted_too_large"
|
||||
}
|
||||
RemotePluginBundleInstallError::Io { .. } => "remote_bundle_io",
|
||||
RemotePluginBundleInstallError::InvalidBundle(_) => "remote_bundle_invalid_bundle",
|
||||
RemotePluginBundleInstallError::Store(_) => "remote_bundle_store",
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_plugin_catalog_error_to_jsonrpc(
|
||||
err: RemotePluginCatalogError,
|
||||
context: &str,
|
||||
@@ -2392,8 +2029,6 @@ fn remote_plugin_catalog_error_to_jsonrpc(
|
||||
invalid_request(message)
|
||||
}
|
||||
RemotePluginCatalogError::InvalidPluginPath { .. }
|
||||
| RemotePluginCatalogError::PluginShareCheckoutNotAvailable { .. }
|
||||
| RemotePluginCatalogError::ArchiveTooLarge { .. }
|
||||
| RemotePluginCatalogError::UnknownMarketplace { .. } => invalid_request(message),
|
||||
RemotePluginCatalogError::AuthToken(_)
|
||||
| RemotePluginCatalogError::Request { .. }
|
||||
@@ -2404,29 +2039,17 @@ fn remote_plugin_catalog_error_to_jsonrpc(
|
||||
| RemotePluginCatalogError::UnexpectedPluginId { .. }
|
||||
| RemotePluginCatalogError::UnexpectedSkillName { .. }
|
||||
| RemotePluginCatalogError::UnexpectedEnabledState { .. }
|
||||
| RemotePluginCatalogError::Archive { .. }
|
||||
| RemotePluginCatalogError::ArchiveJoin(_)
|
||||
| RemotePluginCatalogError::MissingUploadEtag
|
||||
| RemotePluginCatalogError::UnexpectedResponse(_)
|
||||
| RemotePluginCatalogError::InstalledPluginsFetchTimeout
|
||||
| RemotePluginCatalogError::CacheRemove(_) => internal_error(message),
|
||||
}
|
||||
}
|
||||
|
||||
fn remote_plugin_bundle_install_error_to_jsonrpc(
|
||||
err: codex_core_plugins::remote_bundle::RemotePluginBundleInstallError,
|
||||
) -> JSONRPCErrorError {
|
||||
internal_error(format!("install remote plugin bundle: {err}"))
|
||||
}
|
||||
|
||||
fn remote_plugin_operation_error_to_jsonrpc(err: RemotePluginOperationError) -> JSONRPCErrorError {
|
||||
match *err.kind {
|
||||
RemotePluginOperationErrorKind::Catalog { context, source } => {
|
||||
remote_plugin_catalog_error_to_jsonrpc(source, context)
|
||||
}
|
||||
RemotePluginOperationErrorKind::Bundle(source) => {
|
||||
remote_plugin_bundle_install_error_to_jsonrpc(source)
|
||||
}
|
||||
RemotePluginOperationErrorKind::Sync { context, source } => {
|
||||
internal_error(format!("{context}: {source}"))
|
||||
}
|
||||
@@ -2436,3 +2059,8 @@ fn remote_plugin_operation_error_to_jsonrpc(err: RemotePluginOperationError) ->
|
||||
RemotePluginOperationErrorKind::Internal(message) => internal_error(message),
|
||||
}
|
||||
}
|
||||
|
||||
/// aKode never shares plugins through the ChatGPT backend.
|
||||
fn plugin_sharing_unavailable() -> JSONRPCErrorError {
|
||||
method_not_found("plugin sharing is not available in aKode".to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user