@timmy_hu/plugin-middleware 1.0.0 → 1.0.2

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "插件中间件",
3
3
  "code": "plugin-middleware",
4
- "version": "1.0.0",
5
- "description": "自动发现所有中间件类型插件,支持动态按需加载、卸载和状态查询,为智能体编排提供灵活的中间件管理能力。",
4
+ "version": "1.0.2",
5
+ "description": "自动发现 XpertAI 平台上所有已安装的中间件类型插件,展示加载状态,支持从 npm 安装新插件、搜索、统计。通过 /api/auth/login 登录获取 token。",
6
6
  "createdBy": "fpi",
7
7
  "platform": "http://10.161.48.53:3300",
8
8
  "category": "middleware",
@@ -1,118 +1,137 @@
1
1
  {
2
2
  "tools": [
3
+ {
4
+ "name": "check_login_status",
5
+ "description": "检查当前平台登录状态",
6
+ "input": {},
7
+ "expectedOutput": {
8
+ "success": true,
9
+ "loggedIn": true,
10
+ "email": "hu_cao@fpi-inc.com",
11
+ "platformUrl": "http://10.161.48.53:3300",
12
+ "organizationId": "a8313602-e2e2-4597-bf6d-f9b5e39b3b15",
13
+ "tokenExpiry": "2026-07-07T11:00:00.000Z",
14
+ "cachedPlugins": 36,
15
+ "cachedMiddleware": 14,
16
+ "message": "登录状态正常,token 有效"
17
+ }
18
+ },
3
19
  {
4
20
  "name": "list_middleware_plugins",
5
- "description": "列出所有已发现的中间件类型插件",
6
- "input": {
7
- "filter": "all"
8
- },
21
+ "description": "列出所有已安装的中间件类型插件",
22
+ "input": { "filter": "all" },
9
23
  "expectedOutput": {
10
24
  "success": true,
11
- "total": 3,
25
+ "total": 14,
26
+ "totalAllPlugins": 36,
27
+ "totalMiddleware": 14,
28
+ "filter": "all",
12
29
  "plugins": [
13
30
  {
14
- "code": "weather-query",
15
- "name": "天气查询",
31
+ "name": "echarts-generator",
32
+ "packageName": "@timmy_hu/echarts-generator",
33
+ "displayName": "ECharts图表生成器",
16
34
  "version": "1.0.0",
17
- "description": "查询城市天气信息",
18
- "status": "loaded",
19
- "loadedAt": "2026-07-07T10:00:00.000Z"
35
+ "description": "根据输入的一组或多组数据生成ECharts图表配置",
36
+ "category": "middleware",
37
+ "loadStatus": "loaded",
38
+ "loadError": null,
39
+ "configurationStatus": "valid",
40
+ "canUninstall": true,
41
+ "effectiveInCurrentScope": true
20
42
  },
21
43
  {
22
- "code": "pg-query-tool",
23
- "name": "PostgreSQL 查询工具",
24
- "version": "1.0.0",
25
- "description": "执行 PostgreSQL 数据库查询",
26
- "status": "available",
27
- "loadedAt": null
44
+ "name": "@xpert-ai/plugin-web-tools",
45
+ "packageName": "@xpert-ai/plugin-web-tools",
46
+ "displayName": "@xpert-ai/plugin-web-tools",
47
+ "version": "0.0.3",
48
+ "description": "A middleware that provides web fetch and web search tools for agents.",
49
+ "category": "middleware",
50
+ "loadStatus": "loaded",
51
+ "loadError": null
28
52
  }
29
53
  ]
30
54
  }
31
55
  },
32
56
  {
33
- "name": "load_middleware_plugin",
34
- "description": "动态加载指定的中间件插件",
35
- "input": {
36
- "pluginCode": "pg-query-tool"
37
- },
57
+ "name": "get_middleware_plugin_detail",
58
+ "description": "查询指定中间件插件的详细信息",
59
+ "input": { "pluginNameOrPackage": "echarts-generator" },
38
60
  "expectedOutput": {
39
61
  "success": true,
40
- "message": "插件 pg-query-tool 加载成功",
41
62
  "plugin": {
42
- "code": "pg-query-tool",
43
- "name": "PostgreSQL 查询工具",
63
+ "name": "echarts-generator",
64
+ "packageName": "@timmy_hu/echarts-generator",
65
+ "displayName": "ECharts图表生成器",
44
66
  "version": "1.0.0",
45
- "loadedAt": "2026-07-07T10:05:00.000Z",
46
- "status": "loaded"
67
+ "description": "根据输入的一组或多组数据生成ECharts图表配置",
68
+ "loadStatus": "loaded",
69
+ "configurationStatus": "valid",
70
+ "components": []
47
71
  }
48
72
  }
49
73
  },
50
74
  {
51
- "name": "unload_middleware_plugin",
52
- "description": "卸载已加载的中间件插件",
53
- "input": {
54
- "pluginCode": "pg-query-tool"
55
- },
75
+ "name": "install_middleware_plugin",
76
+ "description": "从 npm 安装新的中间件插件",
77
+ "input": { "packageName": "@timmy_hu/bulk-email-sender", "version": "1.0.1" },
56
78
  "expectedOutput": {
57
79
  "success": true,
58
- "message": "插件 pg-query-tool 已卸载",
59
- "plugin": {
60
- "code": "pg-query-tool",
61
- "name": "PostgreSQL 查询工具",
62
- "unloadedAt": "2026-07-07T10:10:00.000Z",
63
- "status": "unloaded"
80
+ "message": "插件 @timmy_hu/bulk-email-sender 安装成功",
81
+ "installed": {
82
+ "name": "@timmy_hu/bulk-email-sender",
83
+ "packageName": "@timmy_hu/bulk-email-sender",
84
+ "version": "1.0.1",
85
+ "organizationId": "a8313602-e2e2-4597-bf6d-f9b5e39b3b15"
64
86
  }
65
87
  }
66
88
  },
67
89
  {
68
- "name": "get_middleware_plugin_status",
69
- "description": "查询指定中间件插件的详细状态",
70
- "input": {
71
- "pluginCode": "weather-query"
72
- },
90
+ "name": "search_middleware_plugins",
91
+ "description": "按关键词搜索中间件插件",
92
+ "input": { "keyword": "email" },
73
93
  "expectedOutput": {
74
94
  "success": true,
75
- "plugin": {
76
- "code": "weather-query",
77
- "name": "天气查询",
78
- "version": "1.0.0",
79
- "description": "查询城市天气信息",
80
- "category": "middleware",
81
- "status": "loaded",
82
- "loadedAt": "2026-07-07T10:00:00.000Z",
83
- "tools": [],
84
- "configRequired": []
85
- }
95
+ "keyword": "email",
96
+ "total": 1,
97
+ "plugins": [
98
+ {
99
+ "name": "@timmy_hu/bulk-email-sender",
100
+ "displayName": "批量邮件发送",
101
+ "version": "1.0.1",
102
+ "description": "为 XpertAI 智能体提供基于 SMTP 协议的批量邮件发送能力",
103
+ "loadStatus": "loaded"
104
+ }
105
+ ]
86
106
  }
87
107
  },
88
108
  {
89
- "name": "refresh_plugin_cache",
90
- "description": "刷新插件发现缓存",
109
+ "name": "get_plugin_statistics",
110
+ "description": "获取插件统计信息",
91
111
  "input": {},
92
112
  "expectedOutput": {
93
113
  "success": true,
94
- "message": "缓存已刷新,发现 5 个中间件插件",
95
- "total": 5,
96
- "refreshedAt": "2026-07-07T10:15:00.000Z"
114
+ "statistics": {
115
+ "totalPlugins": 36,
116
+ "totalMiddleware": 14,
117
+ "byCategory": { "middleware": 14, "model": 10, "integration": 4, "database": 2, "tools": 2, "set": 3, "vector-store": 1 },
118
+ "middlewareByLoadStatus": { "loaded": 14 },
119
+ "updatableCount": 0,
120
+ "configErrorCount": 0,
121
+ "loadErrorCount": 0
122
+ }
97
123
  }
98
124
  },
99
125
  {
100
- "name": "batch_load_middleware_plugins",
101
- "description": "批量加载多个中间件插件",
102
- "input": {
103
- "pluginCodes": ["weather-query", "pg-query-tool", "email-sender"]
104
- },
126
+ "name": "refresh_plugin_list",
127
+ "description": "刷新插件列表缓存",
128
+ "input": {},
105
129
  "expectedOutput": {
106
130
  "success": true,
107
- "total": 3,
108
- "loaded": 2,
109
- "alreadyLoaded": 1,
110
- "failed": 0,
111
- "results": [
112
- { "code": "weather-query", "status": "already_loaded", "success": true },
113
- { "code": "pg-query-tool", "name": "PostgreSQL 查询工具", "version": "1.0.0", "status": "loaded", "success": true },
114
- { "code": "email-sender", "name": "邮件发送", "version": "1.0.0", "status": "loaded", "success": true }
115
- ]
131
+ "message": "插件列表已刷新,共发现 36 个插件,其中 14 个中间件类型",
132
+ "totalPlugins": 36,
133
+ "totalMiddleware": 14,
134
+ "refreshedAt": "2026-07-07T10:15:00.000Z"
116
135
  }
117
136
  }
118
137
  ]