mirror of
https://github.com/openai/codex.git
synced 2026-11-10 21:00:47 +00:00
## What changed - Add the experimental `plugin/search` request with search term, scope, working-directory, cursor, and limit parameters. - Define paginated results that include each plugin's marketplace name and optional local marketplace path. - Route the request through app server while returning method-not-found until the search implementation is available. ## Testing - Add an app-server test that verifies `plugin/search` returns JSON-RPC error `-32601` with the expected not-implemented message. GitOrigin-RevId: 755400468331f0887f7da7d933195c347aadf6d0
48 lines
1.4 KiB
Rust
48 lines
1.4 KiB
Rust
use super::PluginSummary;
|
|
use crate::JsonSchema;
|
|
use crate::TS;
|
|
use codex_utils_absolute_path::AbsolutePathBuf;
|
|
use serde::Deserialize;
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct PluginSearchParams {
|
|
pub search_term: String,
|
|
#[ts(optional = nullable)]
|
|
pub scope: Option<PluginSearchScope>,
|
|
#[ts(optional = nullable)]
|
|
pub cwds: Option<Vec<AbsolutePathBuf>>,
|
|
#[ts(optional = nullable)]
|
|
pub cursor: Option<String>,
|
|
#[ts(optional = nullable)]
|
|
pub limit: Option<u32>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(rename_all = "camelCase", export_to = "v2/")]
|
|
pub enum PluginSearchScope {
|
|
Global,
|
|
Workspace,
|
|
Personal,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct PluginSearchResult {
|
|
pub plugin: PluginSummary,
|
|
pub marketplace_name: String,
|
|
pub marketplace_path: Option<AbsolutePathBuf>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export_to = "v2/")]
|
|
pub struct PluginSearchResponse {
|
|
pub data: Vec<PluginSearchResult>,
|
|
pub next_cursor: Option<String>,
|
|
}
|