From 180e7135649b5f01c94c7c21ac14cf5009ae3ed0 Mon Sep 17 00:00:00 2001 From: arvinxx Date: Thu, 24 Aug 2023 23:02:35 +0800 Subject: [PATCH] :sparkles: feat: add setting config --- src/manifest.ts | 10 ++++++---- src/types/manifest.ts | 1 + 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/manifest.ts b/src/manifest.ts index 543d8e4..3dbabbd 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -1,12 +1,13 @@ import { z } from 'zod'; +const JSONSchema = z.object({ + properties: z.object({}), + type: z.enum(['object']), +}); export const pluginApiSchema = z.object({ description: z.string(), name: z.string(), - parameters: z.object({ - properties: z.object({}), - type: z.enum(['object']), - }), + parameters: JSONSchema, url: z.string().url(), }); @@ -15,6 +16,7 @@ export const pluginManifestSchema = z.object({ identifier: z.string(), openapi: z.string().optional(), + settings: JSONSchema.optional(), ui: z .object({ url: z.string().optional(), diff --git a/src/types/manifest.ts b/src/types/manifest.ts index 486d80a..2d4dfcc 100644 --- a/src/types/manifest.ts +++ b/src/types/manifest.ts @@ -42,6 +42,7 @@ export interface LobeChatPluginManifest { */ identifier: string; openapi?: string; + settings?: PluginSchema; /** * plugin ui on user side * @desc The type of rendering for the plugin