Skip to content

Commit 2016ec9

Browse files
committed
refactor(plugins): rename recommendationProvider to userRecommendationProvider across codebase
Align the recommendation capability name with the established convention where user-scoped plugin capabilities use the "user" prefix (matching userReadSync), while system-level capabilities like metadataProvider do not. Updates Rust backend, TypeScript SDK, plugin examples, frontend components, tests, documentation, and regenerated OpenAPI types.
1 parent 52d54ab commit 2016ec9

18 files changed

Lines changed: 31 additions & 31 deletions

File tree

docs/api/openapi.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31999,14 +31999,14 @@
3199931999
"description": "Plugin capabilities for display (user plugin context)",
3200032000
"required": [
3200132001
"readSync",
32002-
"recommendationProvider"
32002+
"userRecommendationProvider"
3200332003
],
3200432004
"properties": {
3200532005
"readSync": {
3200632006
"type": "boolean",
3200732007
"description": "Can sync reading progress"
3200832008
},
32009-
"recommendationProvider": {
32009+
"userRecommendationProvider": {
3201032010
"type": "boolean",
3201132011
"description": "Can provide recommendations"
3201232012
}

docs/dev/plugins/sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ interface PluginManifest {
191191
interface PluginCapabilities {
192192
seriesMetadataProvider?: boolean;
193193
syncProvider?: boolean;
194-
recommendationProvider?: boolean;
194+
userRecommendationProvider?: boolean;
195195
}
196196

197197
interface CredentialField {

docs/dev/plugins/writing-plugins.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ interface PluginManifest {
178178
capabilities: {
179179
metadataProvider?: MetadataContentType[]; // Content types: ["series"] or ["series", "book"]
180180
syncProvider?: boolean; // Can sync reading progress (future)
181-
recommendationProvider?: boolean; // Can provide recommendations (future)
181+
userRecommendationProvider?: boolean; // Can provide recommendations (future)
182182
};
183183

184184
// Optional

plugins/recommendations-anilist/src/manifest.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const manifest = {
1111
homepage: "https://github.com/AshDevFr/codex",
1212
protocolVersion: "1.0",
1313
capabilities: {
14-
recommendationProvider: true,
14+
userRecommendationProvider: true,
1515
},
1616
requiredCredentials: [
1717
{
@@ -37,5 +37,5 @@ export const manifest = {
3737
],
3838
},
3939
} as const satisfies PluginManifest & {
40-
capabilities: { recommendationProvider: true };
40+
capabilities: { userRecommendationProvider: true };
4141
};

plugins/sdk-typescript/src/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,9 +566,9 @@ export function createSyncPlugin(options: SyncPluginOptions): void {
566566
* Options for creating a recommendation provider plugin
567567
*/
568568
export interface RecommendationPluginOptions {
569-
/** Plugin manifest - must have capabilities.recommendationProvider: true */
569+
/** Plugin manifest - must have capabilities.userRecommendationProvider: true */
570570
manifest: PluginManifest & {
571-
capabilities: { recommendationProvider: true };
571+
capabilities: { userRecommendationProvider: true };
572572
};
573573
/** RecommendationProvider implementation */
574574
provider: RecommendationProvider;

plugins/sdk-typescript/src/types/capabilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export interface SyncProvider {
223223
* Plugins implementing this capability generate personalized suggestions
224224
* based on a user's library and reading history.
225225
*
226-
* Declare this capability in the plugin manifest with `recommendationProvider: true`.
226+
* Declare this capability in the plugin manifest with `userRecommendationProvider: true`.
227227
*/
228228
export interface RecommendationProvider {
229229
/** Get personalized recommendations */

plugins/sdk-typescript/src/types/manifest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export interface PluginCapabilities {
4545
*/
4646
externalIdSource?: string;
4747
/** Can provide recommendations */
48-
recommendationProvider?: boolean;
48+
userRecommendationProvider?: boolean;
4949
}
5050

5151
/**

src/api/routes/v1/dto/user_plugins.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub struct UserPluginCapabilitiesDto {
9696
/// Can sync reading progress
9797
pub read_sync: bool,
9898
/// Can provide recommendations
99-
pub recommendation_provider: bool,
99+
pub user_recommendation_provider: bool,
100100
}
101101

102102
/// Request to update user plugin configuration

src/api/routes/v1/handlers/recommendations.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async fn find_recommendation_plugin(
5252
.manifest
5353
.as_ref()
5454
.and_then(|m| serde_json::from_value::<PluginManifest>(m.clone()).ok())
55-
.map(|m| m.capabilities.recommendation_provider)
55+
.map(|m| m.capabilities.user_recommendation_provider)
5656
.unwrap_or(false);
5757

5858
if is_rec_provider {

src/api/routes/v1/handlers/user_plugins.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,9 @@ pub async fn list_user_plugins(
181181
.as_ref()
182182
.map(|m| m.capabilities.user_read_sync)
183183
.unwrap_or(false),
184-
recommendation_provider: manifest
184+
user_recommendation_provider: manifest
185185
.as_ref()
186-
.map(|m| m.capabilities.recommendation_provider)
186+
.map(|m| m.capabilities.user_recommendation_provider)
187187
.unwrap_or(false),
188188
},
189189
}

0 commit comments

Comments
 (0)