diff --git a/src/types/manifest.ts b/src/types/manifest.ts index 04d1298..9781a29 100644 --- a/src/types/manifest.ts +++ b/src/types/manifest.ts @@ -13,40 +13,34 @@ export interface PluginSchema extends Omit { type: 'object'; } +export interface LobeChatPluginApi { + description: string; + name: string; + parameters: PluginSchema; + /** + * Endpoint URL + * @desc The endpoint URL of the plugin + * @nameCN 服务端接口 + * @descCN 插件服务端的接口地址 URL + */ + url: string; +} + /** * Plugin manifest * @desc Represents the manifest of a plugin * @nameCN 插件清单 * @descCN 描述一个插件的构成要素 */ -export interface LobeChatPlugin { +export interface LobeChatPluginManifest { + api: LobeChatPluginApi[]; /** * Plugin name * @desc The name of the plugin * @nameCN 插件名称 * @descCN 插件的名称,需要和提交到 LobeChat Plugins 仓库的插件名称一致 */ - name: string; - /** - * Plugin schema - * @desc The schema of the plugin - * @nameCN 插件模式 - * @descCN 插件的模式 - */ - schema: { - description: string; - name: string; - parameters: PluginSchema; - }; - server: { - /** - * Endpoint URL - * @desc The endpoint URL of the plugin - * @nameCN 服务端接口 - * @descCN 插件服务端的接口地址 URL - */ - url: string; - }; + identifier: string; /** * plugin ui on user side * @desc The type of rendering for the plugin diff --git a/src/types/market.ts b/src/types/market.ts index 96524f8..5e0b2a4 100644 --- a/src/types/market.ts +++ b/src/types/market.ts @@ -18,7 +18,7 @@ export interface LobeChatPluginsMarketIndex { * @nameCN 版本 * @descCN 插件的版本 */ - version: 1; + schemaVersion: 1; } /** @@ -28,6 +28,7 @@ export interface LobeChatPluginsMarketIndex { * @descCN 插件项接口 */ export interface LobeChatPluginMeta { + author: string; /** * createAt * @desc Creation date of the plugin @@ -42,6 +43,11 @@ export interface LobeChatPluginMeta { * @descCN 插件的主页 */ homepage: string; + /** + * plugin identifier + * @nameCN 插件的名称 + */ + identifier: string; /** * manifest url of this plugin * @desc Manifest of the plugin @@ -55,17 +61,12 @@ export interface LobeChatPluginMeta { * @descCN 包含图片与标签等 */ meta: Meta; - /** - * plugin name - * @nameCN 插件的名称 - */ - name: string; /** * Manifest schema version * @desc The version of the plugin manifest schema * @nameCN 插件清单的版本 */ - schemaVersion: 'v1'; + schemaVersion: number; } /** @@ -96,4 +97,5 @@ export interface Meta { * @descCN 插件的标签 */ tags?: string[]; + title: string; }