@fastgpt-plugin/cli 0.2.1 → 0.2.2-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import plugin from './index';
|
|
4
|
+
|
|
5
|
+
describe('plugin template', () => {
|
|
6
|
+
it('exports a valid FastGPT plugin manifest', () => {
|
|
7
|
+
const manifest = plugin.getUserToolManifest();
|
|
8
|
+
|
|
9
|
+
expect(manifest.pluginId).toBeTruthy();
|
|
10
|
+
expect(manifest.version).toMatch(/^\d+\.\d+\.\d+$/);
|
|
11
|
+
expect(manifest.name).toBeDefined();
|
|
12
|
+
expect(manifest.description).toBeDefined();
|
|
13
|
+
});
|
|
14
|
+
});
|
|
@@ -10,7 +10,8 @@ const handler = createToolHandler({
|
|
|
10
10
|
inputSchema: z.object({
|
|
11
11
|
delay: z.number().meta({
|
|
12
12
|
title: 'Delay',
|
|
13
|
-
description: 'Delay duration in milliseconds'
|
|
13
|
+
description: 'Delay duration in milliseconds',
|
|
14
|
+
isToolParams: true
|
|
14
15
|
} satisfies InputSchemaMetaType)
|
|
15
16
|
}),
|
|
16
17
|
outputSchema: z.object({}).meta({} satisfies OutputSchemaMetaType),
|
|
@@ -33,7 +33,8 @@ const secretSchema = z.object({
|
|
|
33
33
|
const mysqlHandler = createToolHandler({
|
|
34
34
|
inputSchema: z.object({
|
|
35
35
|
query: z.string().meta({
|
|
36
|
-
title: 'SQL Query'
|
|
36
|
+
title: 'SQL Query',
|
|
37
|
+
isToolParams: true
|
|
37
38
|
} satisfies InputSchemaMetaType)
|
|
38
39
|
}),
|
|
39
40
|
outputSchema: z.object({
|
|
@@ -62,7 +63,8 @@ const mysqlHandler = createToolHandler({
|
|
|
62
63
|
const pgsqlHandler = createToolHandler({
|
|
63
64
|
inputSchema: z.object({
|
|
64
65
|
query: z.string().meta({
|
|
65
|
-
title: 'SQL Query'
|
|
66
|
+
title: 'SQL Query',
|
|
67
|
+
isToolParams: true
|
|
66
68
|
} satisfies InputSchemaMetaType)
|
|
67
69
|
}),
|
|
68
70
|
outputSchema: z.object({
|