foliko 1.0.68 → 1.0.69
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/.claude/settings.local.json +148 -145
- package/examples/basic.js +110 -110
- package/examples/mcp-example.js +53 -53
- package/examples/skill-example.js +49 -49
- package/examples/test-mcp.js +79 -79
- package/examples/test-reload.js +61 -61
- package/news-20260329-1774794949179.html +39 -0
- package/news-20260329-1774794970785.html +39 -0
- package/news-20260329-1774797491928.html +39 -0
- package/package.json +1 -1
- package/plugins/ambient-agent-plugin.js +333 -22
- package/plugins/email.js +106 -20
- package/plugins/file-system-plugin.js +76 -30
- package/plugins/python-executor-plugin.js +41 -8
- package/plugins/scheduler-plugin.js +6 -10
- package/plugins/web-plugin.js +8 -6
- package/skills/ambient-agent/SKILL.md +84 -14
- package/skills/workflow-guide/SKILL.md +214 -2
- package/skills/workflow-troubleshooting/DEBUGGING.md +182 -0
- package/skills/workflow-troubleshooting/SKILL.md +314 -0
- package/src/capabilities/workflow-engine.js +367 -22
- package/src/core/agent-chat.js +106 -14
- package/src/core/framework.js +81 -1
- package/src/executors/executor-base.js +58 -58
- package/test-server.js +0 -25
- package/test.txt +0 -3
package/examples/mcp-example.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP 执行器示例
|
|
3
|
-
* 展示如何连接 MCP 服务器
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const { Framework } = require('../src')
|
|
7
|
-
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
8
|
-
|
|
9
|
-
async function main() {
|
|
10
|
-
console.log('=== MCP Executor Example ===\n')
|
|
11
|
-
|
|
12
|
-
// 创建框架
|
|
13
|
-
const framework = new Framework({ debug: true })
|
|
14
|
-
|
|
15
|
-
// 创建 MCP 执行器插件
|
|
16
|
-
const mcpPlugin = new MCPExecutorPlugin({
|
|
17
|
-
servers: [
|
|
18
|
-
// 示例:添加一个 MCP 服务器
|
|
19
|
-
// {
|
|
20
|
-
// name: 'example',
|
|
21
|
-
// command: 'uvx',
|
|
22
|
-
// args: ['example-mcp-server'],
|
|
23
|
-
// env: {}
|
|
24
|
-
// }
|
|
25
|
-
]
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// 加载插件
|
|
29
|
-
await framework.loadPlugin(mcpPlugin)
|
|
30
|
-
|
|
31
|
-
// 列出服务器
|
|
32
|
-
console.log('\n--- MCP Servers ---')
|
|
33
|
-
const servers = mcpPlugin.getServers()
|
|
34
|
-
console.log('Servers:', servers)
|
|
35
|
-
|
|
36
|
-
// 列出所有 MCP 工具
|
|
37
|
-
console.log('\n--- MCP Tools ---')
|
|
38
|
-
const tools = framework.getTools().filter(t => t.name.startsWith('mcp_'))
|
|
39
|
-
console.log('MCP tools:', tools.map(t => t.name))
|
|
40
|
-
|
|
41
|
-
// 如果有配置的服务器,可以这样调用:
|
|
42
|
-
// const result = await framework.executeTool('mcp_call', {
|
|
43
|
-
// server: 'example',
|
|
44
|
-
// tool: 'tool_name',
|
|
45
|
-
// args: { /* tool arguments */ }
|
|
46
|
-
// })
|
|
47
|
-
|
|
48
|
-
// 清理
|
|
49
|
-
await framework.destroy()
|
|
50
|
-
console.log('\n[Done]')
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
main().catch(console.error)
|
|
1
|
+
/**
|
|
2
|
+
* MCP 执行器示例
|
|
3
|
+
* 展示如何连接 MCP 服务器
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { Framework } = require('../src')
|
|
7
|
+
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
8
|
+
|
|
9
|
+
async function main() {
|
|
10
|
+
console.log('=== MCP Executor Example ===\n')
|
|
11
|
+
|
|
12
|
+
// 创建框架
|
|
13
|
+
const framework = new Framework({ debug: true })
|
|
14
|
+
|
|
15
|
+
// 创建 MCP 执行器插件
|
|
16
|
+
const mcpPlugin = new MCPExecutorPlugin({
|
|
17
|
+
servers: [
|
|
18
|
+
// 示例:添加一个 MCP 服务器
|
|
19
|
+
// {
|
|
20
|
+
// name: 'example',
|
|
21
|
+
// command: 'uvx',
|
|
22
|
+
// args: ['example-mcp-server'],
|
|
23
|
+
// env: {}
|
|
24
|
+
// }
|
|
25
|
+
]
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// 加载插件
|
|
29
|
+
await framework.loadPlugin(mcpPlugin)
|
|
30
|
+
|
|
31
|
+
// 列出服务器
|
|
32
|
+
console.log('\n--- MCP Servers ---')
|
|
33
|
+
const servers = mcpPlugin.getServers()
|
|
34
|
+
console.log('Servers:', servers)
|
|
35
|
+
|
|
36
|
+
// 列出所有 MCP 工具
|
|
37
|
+
console.log('\n--- MCP Tools ---')
|
|
38
|
+
const tools = framework.getTools().filter(t => t.name.startsWith('mcp_'))
|
|
39
|
+
console.log('MCP tools:', tools.map(t => t.name))
|
|
40
|
+
|
|
41
|
+
// 如果有配置的服务器,可以这样调用:
|
|
42
|
+
// const result = await framework.executeTool('mcp_call', {
|
|
43
|
+
// server: 'example',
|
|
44
|
+
// tool: 'tool_name',
|
|
45
|
+
// args: { /* tool arguments */ }
|
|
46
|
+
// })
|
|
47
|
+
|
|
48
|
+
// 清理
|
|
49
|
+
await framework.destroy()
|
|
50
|
+
console.log('\n[Done]')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
main().catch(console.error)
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill 管理器示例
|
|
3
|
-
* 展示如何加载和使用 Skill
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const { Framework } = require('../src')
|
|
7
|
-
const { SkillManagerPlugin } = require('../src/capabilities/skill-manager')
|
|
8
|
-
|
|
9
|
-
async function main() {
|
|
10
|
-
console.log('=== Skill Manager Example ===\n')
|
|
11
|
-
|
|
12
|
-
// 创建框架
|
|
13
|
-
const framework = new Framework({ debug: true })
|
|
14
|
-
|
|
15
|
-
// 创建 skills 目录(如果没有)
|
|
16
|
-
const fs = require('fs')
|
|
17
|
-
const skillsDir = './skills'
|
|
18
|
-
if (!fs.existsSync(skillsDir)) {
|
|
19
|
-
fs.mkdirSync(skillsDir, { recursive: true })
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// 加载 Skill 管理器插件
|
|
23
|
-
const skillPlugin = new SkillManagerPlugin({
|
|
24
|
-
skillsDir: skillsDir
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
await framework.loadPlugin(skillPlugin)
|
|
28
|
-
|
|
29
|
-
// 列出所有加载的 skills
|
|
30
|
-
console.log('\n--- Loaded Skills ---')
|
|
31
|
-
const skills = skillPlugin.getAllSkills()
|
|
32
|
-
console.log(`Found ${skills.length} skills:`)
|
|
33
|
-
for (const skill of skills) {
|
|
34
|
-
console.log(` - ${skill.name}: ${skill.metadata.description}`)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// 获取单个 skill
|
|
38
|
-
if (skillPlugin.hasSkill('hello-skill')) {
|
|
39
|
-
console.log('\n--- Hello Skill ---')
|
|
40
|
-
const helloSkill = skillPlugin.getSkill('hello-skill')
|
|
41
|
-
console.log('Content preview:', helloSkill.content.substring(0, 100) + '...')
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// 清理
|
|
45
|
-
await framework.destroy()
|
|
46
|
-
console.log('\n[Done]')
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
main().catch(console.error)
|
|
1
|
+
/**
|
|
2
|
+
* Skill 管理器示例
|
|
3
|
+
* 展示如何加载和使用 Skill
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { Framework } = require('../src')
|
|
7
|
+
const { SkillManagerPlugin } = require('../src/capabilities/skill-manager')
|
|
8
|
+
|
|
9
|
+
async function main() {
|
|
10
|
+
console.log('=== Skill Manager Example ===\n')
|
|
11
|
+
|
|
12
|
+
// 创建框架
|
|
13
|
+
const framework = new Framework({ debug: true })
|
|
14
|
+
|
|
15
|
+
// 创建 skills 目录(如果没有)
|
|
16
|
+
const fs = require('fs')
|
|
17
|
+
const skillsDir = './skills'
|
|
18
|
+
if (!fs.existsSync(skillsDir)) {
|
|
19
|
+
fs.mkdirSync(skillsDir, { recursive: true })
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// 加载 Skill 管理器插件
|
|
23
|
+
const skillPlugin = new SkillManagerPlugin({
|
|
24
|
+
skillsDir: skillsDir
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
await framework.loadPlugin(skillPlugin)
|
|
28
|
+
|
|
29
|
+
// 列出所有加载的 skills
|
|
30
|
+
console.log('\n--- Loaded Skills ---')
|
|
31
|
+
const skills = skillPlugin.getAllSkills()
|
|
32
|
+
console.log(`Found ${skills.length} skills:`)
|
|
33
|
+
for (const skill of skills) {
|
|
34
|
+
console.log(` - ${skill.name}: ${skill.metadata.description}`)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// 获取单个 skill
|
|
38
|
+
if (skillPlugin.hasSkill('hello-skill')) {
|
|
39
|
+
console.log('\n--- Hello Skill ---')
|
|
40
|
+
const helloSkill = skillPlugin.getSkill('hello-skill')
|
|
41
|
+
console.log('Content preview:', helloSkill.content.substring(0, 100) + '...')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// 清理
|
|
45
|
+
await framework.destroy()
|
|
46
|
+
console.log('\n[Done]')
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
main().catch(console.error)
|
package/examples/test-mcp.js
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP 插件测试脚本
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const { Framework } = require('../src')
|
|
6
|
-
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
7
|
-
|
|
8
|
-
async function test() {
|
|
9
|
-
console.log('=== MCP Plugin Test ===\n')
|
|
10
|
-
|
|
11
|
-
console.log('1. Creating framework...')
|
|
12
|
-
const framework = new Framework({ debug: true })
|
|
13
|
-
|
|
14
|
-
console.log('2. Creating MCP plugin with fetch server...')
|
|
15
|
-
const mcpPlugin = new MCPExecutorPlugin({
|
|
16
|
-
servers: [
|
|
17
|
-
{
|
|
18
|
-
name: 'fetch',
|
|
19
|
-
command: 'uvx',
|
|
20
|
-
args: ['mcp-server-fetch']
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
console.log('3. Loading MCP plugin...')
|
|
26
|
-
await framework.loadPlugin(mcpPlugin)
|
|
27
|
-
|
|
28
|
-
console.log('4. Starting framework...')
|
|
29
|
-
await framework.pluginManager.startAll()
|
|
30
|
-
|
|
31
|
-
// 等待 MCP 服务器连接
|
|
32
|
-
console.log('\n5. Waiting for MCP connection...')
|
|
33
|
-
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
34
|
-
|
|
35
|
-
console.log('\n6. Listing MCP servers...')
|
|
36
|
-
const servers = mcpPlugin.getServers()
|
|
37
|
-
console.log('Servers:', JSON.stringify(servers, null, 2))
|
|
38
|
-
|
|
39
|
-
console.log('\n7. Listing MCP tools...')
|
|
40
|
-
const mcpTools = framework.getTools().filter(t => t.name.startsWith('mcp_'))
|
|
41
|
-
console.log('MCP Tools:', mcpTools.map(t => t.name))
|
|
42
|
-
|
|
43
|
-
if (mcpTools.length > 0) {
|
|
44
|
-
console.log('\n8. Testing mcp_list_servers...')
|
|
45
|
-
const listResult = await framework.executeTool('mcp_list_servers', {})
|
|
46
|
-
console.log('List Servers Result:', JSON.stringify(listResult, null, 2))
|
|
47
|
-
|
|
48
|
-
console.log('\n9. Testing mcp_tool_schema...')
|
|
49
|
-
const schemaResult = await framework.executeTool('mcp_tool_schema', {
|
|
50
|
-
server: 'fetch',
|
|
51
|
-
tool: 'fetch'
|
|
52
|
-
})
|
|
53
|
-
console.log('Tool Schema:', JSON.stringify(schemaResult, null, 2))
|
|
54
|
-
|
|
55
|
-
console.log('\n10. Testing mcp_call (fetch a webpage)...')
|
|
56
|
-
const callResult = await framework.executeTool('mcp_call', {
|
|
57
|
-
server: 'fetch',
|
|
58
|
-
tool: 'fetch',
|
|
59
|
-
args_json: JSON.stringify({ url: 'https://httpbin.org/get' })
|
|
60
|
-
})
|
|
61
|
-
console.log('Fetch Result (truncated):', JSON.stringify(callResult, null, 2).substring(0, 500) + '...')
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
console.log('\n11. Destroying framework...')
|
|
65
|
-
await framework.destroy()
|
|
66
|
-
|
|
67
|
-
console.log('\n=== Test Complete ===')
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
test()
|
|
71
|
-
.then(() => {
|
|
72
|
-
console.log('\n✓ Test completed successfully')
|
|
73
|
-
process.exit(0)
|
|
74
|
-
})
|
|
75
|
-
.catch(err => {
|
|
76
|
-
console.error('\n✗ Test failed:', err.message)
|
|
77
|
-
console.error(err.stack)
|
|
78
|
-
process.exit(1)
|
|
79
|
-
})
|
|
1
|
+
/**
|
|
2
|
+
* MCP 插件测试脚本
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const { Framework } = require('../src')
|
|
6
|
+
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
7
|
+
|
|
8
|
+
async function test() {
|
|
9
|
+
console.log('=== MCP Plugin Test ===\n')
|
|
10
|
+
|
|
11
|
+
console.log('1. Creating framework...')
|
|
12
|
+
const framework = new Framework({ debug: true })
|
|
13
|
+
|
|
14
|
+
console.log('2. Creating MCP plugin with fetch server...')
|
|
15
|
+
const mcpPlugin = new MCPExecutorPlugin({
|
|
16
|
+
servers: [
|
|
17
|
+
{
|
|
18
|
+
name: 'fetch',
|
|
19
|
+
command: 'uvx',
|
|
20
|
+
args: ['mcp-server-fetch']
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
console.log('3. Loading MCP plugin...')
|
|
26
|
+
await framework.loadPlugin(mcpPlugin)
|
|
27
|
+
|
|
28
|
+
console.log('4. Starting framework...')
|
|
29
|
+
await framework.pluginManager.startAll()
|
|
30
|
+
|
|
31
|
+
// 等待 MCP 服务器连接
|
|
32
|
+
console.log('\n5. Waiting for MCP connection...')
|
|
33
|
+
await new Promise(resolve => setTimeout(resolve, 2000))
|
|
34
|
+
|
|
35
|
+
console.log('\n6. Listing MCP servers...')
|
|
36
|
+
const servers = mcpPlugin.getServers()
|
|
37
|
+
console.log('Servers:', JSON.stringify(servers, null, 2))
|
|
38
|
+
|
|
39
|
+
console.log('\n7. Listing MCP tools...')
|
|
40
|
+
const mcpTools = framework.getTools().filter(t => t.name.startsWith('mcp_'))
|
|
41
|
+
console.log('MCP Tools:', mcpTools.map(t => t.name))
|
|
42
|
+
|
|
43
|
+
if (mcpTools.length > 0) {
|
|
44
|
+
console.log('\n8. Testing mcp_list_servers...')
|
|
45
|
+
const listResult = await framework.executeTool('mcp_list_servers', {})
|
|
46
|
+
console.log('List Servers Result:', JSON.stringify(listResult, null, 2))
|
|
47
|
+
|
|
48
|
+
console.log('\n9. Testing mcp_tool_schema...')
|
|
49
|
+
const schemaResult = await framework.executeTool('mcp_tool_schema', {
|
|
50
|
+
server: 'fetch',
|
|
51
|
+
tool: 'fetch'
|
|
52
|
+
})
|
|
53
|
+
console.log('Tool Schema:', JSON.stringify(schemaResult, null, 2))
|
|
54
|
+
|
|
55
|
+
console.log('\n10. Testing mcp_call (fetch a webpage)...')
|
|
56
|
+
const callResult = await framework.executeTool('mcp_call', {
|
|
57
|
+
server: 'fetch',
|
|
58
|
+
tool: 'fetch',
|
|
59
|
+
args_json: JSON.stringify({ url: 'https://httpbin.org/get' })
|
|
60
|
+
})
|
|
61
|
+
console.log('Fetch Result (truncated):', JSON.stringify(callResult, null, 2).substring(0, 500) + '...')
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
console.log('\n11. Destroying framework...')
|
|
65
|
+
await framework.destroy()
|
|
66
|
+
|
|
67
|
+
console.log('\n=== Test Complete ===')
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
test()
|
|
71
|
+
.then(() => {
|
|
72
|
+
console.log('\n✓ Test completed successfully')
|
|
73
|
+
process.exit(0)
|
|
74
|
+
})
|
|
75
|
+
.catch(err => {
|
|
76
|
+
console.error('\n✗ Test failed:', err.message)
|
|
77
|
+
console.error(err.stack)
|
|
78
|
+
process.exit(1)
|
|
79
|
+
})
|
package/examples/test-reload.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MCP mcp_reload 功能测试
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
const { Framework } = require('../src')
|
|
6
|
-
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
7
|
-
const fs = require('fs')
|
|
8
|
-
const path = require('path')
|
|
9
|
-
|
|
10
|
-
async function test() {
|
|
11
|
-
console.log('=== Testing mcp_reload ===\n')
|
|
12
|
-
|
|
13
|
-
// 创建框架
|
|
14
|
-
const framework = new Framework({ debug: true })
|
|
15
|
-
|
|
16
|
-
// 创建 MCP 插件
|
|
17
|
-
const mcpPlugin = new MCPExecutorPlugin({
|
|
18
|
-
servers: [
|
|
19
|
-
{ name: 'fetch', command: 'uvx', args: ['mcp-server-fetch'] }
|
|
20
|
-
]
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
// 加载并启动
|
|
24
|
-
await framework.loadPlugin(mcpPlugin)
|
|
25
|
-
await framework.pluginManager.startAll()
|
|
26
|
-
|
|
27
|
-
// 等待连接
|
|
28
|
-
await new Promise(r => setTimeout(r, 2000))
|
|
29
|
-
|
|
30
|
-
console.log('\n1. 初始服务器列表:')
|
|
31
|
-
const initialServers = mcpPlugin.getServers()
|
|
32
|
-
console.log(JSON.stringify(initialServers, null, 2))
|
|
33
|
-
|
|
34
|
-
// 测试 mcp_reload
|
|
35
|
-
console.log('\n2. 调用 mcp_reload...')
|
|
36
|
-
const result = await framework.executeTool('mcp_reload', {})
|
|
37
|
-
console.log('mcp_reload 结果:')
|
|
38
|
-
console.log(JSON.stringify(result, null, 2))
|
|
39
|
-
|
|
40
|
-
// 检查配置
|
|
41
|
-
console.log('\n3. 当前配置文件:')
|
|
42
|
-
const configPath = path.resolve('.agent/mcp_config.json')
|
|
43
|
-
if (fs.existsSync(configPath)) {
|
|
44
|
-
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
45
|
-
console.log(JSON.stringify(config, null, 2))
|
|
46
|
-
} else {
|
|
47
|
-
console.log('配置文件不存在: ' + configPath)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// 清理
|
|
51
|
-
await framework.destroy()
|
|
52
|
-
|
|
53
|
-
console.log('\n=== 测试完成 ===')
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
test()
|
|
57
|
-
.then(() => process.exit(0))
|
|
58
|
-
.catch(err => {
|
|
59
|
-
console.error('测试失败:', err)
|
|
60
|
-
process.exit(1)
|
|
61
|
-
})
|
|
1
|
+
/**
|
|
2
|
+
* MCP mcp_reload 功能测试
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const { Framework } = require('../src')
|
|
6
|
+
const { MCPExecutorPlugin } = require('../src/executors/mcp-executor')
|
|
7
|
+
const fs = require('fs')
|
|
8
|
+
const path = require('path')
|
|
9
|
+
|
|
10
|
+
async function test() {
|
|
11
|
+
console.log('=== Testing mcp_reload ===\n')
|
|
12
|
+
|
|
13
|
+
// 创建框架
|
|
14
|
+
const framework = new Framework({ debug: true })
|
|
15
|
+
|
|
16
|
+
// 创建 MCP 插件
|
|
17
|
+
const mcpPlugin = new MCPExecutorPlugin({
|
|
18
|
+
servers: [
|
|
19
|
+
{ name: 'fetch', command: 'uvx', args: ['mcp-server-fetch'] }
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
// 加载并启动
|
|
24
|
+
await framework.loadPlugin(mcpPlugin)
|
|
25
|
+
await framework.pluginManager.startAll()
|
|
26
|
+
|
|
27
|
+
// 等待连接
|
|
28
|
+
await new Promise(r => setTimeout(r, 2000))
|
|
29
|
+
|
|
30
|
+
console.log('\n1. 初始服务器列表:')
|
|
31
|
+
const initialServers = mcpPlugin.getServers()
|
|
32
|
+
console.log(JSON.stringify(initialServers, null, 2))
|
|
33
|
+
|
|
34
|
+
// 测试 mcp_reload
|
|
35
|
+
console.log('\n2. 调用 mcp_reload...')
|
|
36
|
+
const result = await framework.executeTool('mcp_reload', {})
|
|
37
|
+
console.log('mcp_reload 结果:')
|
|
38
|
+
console.log(JSON.stringify(result, null, 2))
|
|
39
|
+
|
|
40
|
+
// 检查配置
|
|
41
|
+
console.log('\n3. 当前配置文件:')
|
|
42
|
+
const configPath = path.resolve('.agent/mcp_config.json')
|
|
43
|
+
if (fs.existsSync(configPath)) {
|
|
44
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
45
|
+
console.log(JSON.stringify(config, null, 2))
|
|
46
|
+
} else {
|
|
47
|
+
console.log('配置文件不存在: ' + configPath)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 清理
|
|
51
|
+
await framework.destroy()
|
|
52
|
+
|
|
53
|
+
console.log('\n=== 测试完成 ===')
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
test()
|
|
57
|
+
.then(() => process.exit(0))
|
|
58
|
+
.catch(err => {
|
|
59
|
+
console.error('测试失败:', err)
|
|
60
|
+
process.exit(1)
|
|
61
|
+
})
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>全球新闻聚合 - 2026年3月29日 22:35</title>
|
|
7
|
+
<style>
|
|
8
|
+
*{margin:0;padding:0;box-sizing:border-box;}
|
|
9
|
+
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);min-height:100vh;padding:20px;}
|
|
10
|
+
.container{max-width:1200px;margin:0 auto;}
|
|
11
|
+
h1{text-align:center;color:#fff;margin-bottom:30px;font-size:2.5em;text-shadow:2px 2px 4px rgba(0,0,0,0.3);}
|
|
12
|
+
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:25px;}
|
|
13
|
+
.card{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,0.2);transition:transform 0.3s ease;}
|
|
14
|
+
.card:hover{transform:translateY(-5px);}
|
|
15
|
+
.card-header{padding:20px;color:#fff;font-weight:bold;font-size:1.3em;}
|
|
16
|
+
.card-header.baidu{background:linear-gradient(135deg,#4e54c8,#8f94fb);}
|
|
17
|
+
.card-header.bbc{background:linear-gradient(135deg,#b21f1f,#f64f59);}
|
|
18
|
+
.card-header.reddit{background:linear-gradient(135deg,#ff4500,#ff6a33);}
|
|
19
|
+
.card-body{padding:20px;}
|
|
20
|
+
.news-list{list-style:none;}
|
|
21
|
+
.news-list li{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer;transition:all 0.2s;}
|
|
22
|
+
.news-list li:last-child{border-bottom:none;}
|
|
23
|
+
.news-list li:hover{color:#667eea;padding-left:10px;}
|
|
24
|
+
.news-list li::before{content:"• ";color:#667eea;font-weight:bold;margin-right:8px;}
|
|
25
|
+
.timestamp{text-align:center;color:#999;font-size:0.9em;margin-top:20px;}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div class="container">
|
|
30
|
+
<h1>📰 全球新闻聚合</h1>
|
|
31
|
+
<div class="grid">
|
|
32
|
+
<div class="card"><div class="card-header baidu">🇨🇳 百度新闻</div><div class="card-body"><ul class="news-list"><li>努力让群众看到变化、得到实惠</li><li>手机发烫可能是正在被窃密</li><li>儿子一家去世 老人骑行30年治愈自己</li><li>他们一笑 全场哭了</li><li>中国将在长江水下开高铁</li><li>孩子凌晨偷拿平板玩2小时再放回去</li><li>摆拍“打网约车遭司机辱骂”者被罚</li><li>伊朗新最高领袖为何发声少 专家分析</li><li>内存条价格崩了</li><li>身份证号的“X”到底咋读</li></ul></div></div>
|
|
33
|
+
<div class="card"><div class="card-header bbc">🇬🇧 BBC News</div><div class="card-body"><ul class="news-list"><li>CDATA[Jeremy Bowen: Trump is waging war based on instinct and it isn't working</li><li>CDATA[Iranian attacks across Gulf continue as major industrial sites hit</li><li>CDATA[Three Lebanese journalists killed in Israeli strike, say broadcasters</li><li>CDATA[Prison phone call recordings raise questions over ex-Abercrombie boss' fitness for trial</li><li>CDATA[One ant for $220: The new frontier of wildlife trafficking</li><li>CDATA[African football chief resigns following row over Morocco-Senegal final</li><li>CDATA[No Kings protesters across the US rally against Donald Trump </li><li>CDATA[How deepfake porn scandal surrounding TV star rocked Germany</li><li>CDATA[Frosting, sprinkles and layers of fun: Giant cake picnic hits Sydney</li><li>CDATA[Shops and restaurants in Egypt told to close early as energy crisis deepens</li></ul></div></div>
|
|
34
|
+
<div class="card"><div class="card-header reddit">🤖 Reddit News</div><div class="card-body"><ul class="news-list"><li>Operations Epic Fury / Roaring Lion Megathread</li><li>Pentagon preparing for weeks of ground operations in Iran, Washington Post reports</li><li>Iran warns US over ground attack as regional powers meet in Pakistan</li><li>No Kings protests across the world</li><li>Thousands gather for No Kings rally in Minnesota</li><li>Israeli airstrike in southern Lebanon kills 3 journalists covering the war</li><li>Judicial misconduct allegations: Florida judge faces ethics charges for making racial insensitive comments</li><li>Finland reports suspected territorial violation by drones</li><li>Nestlé says 413,793 KitKat candy bars stolen en route from Italy to Poland</li><li>Japan's foreign resident population hits record 4.12 million</li></ul></div></div>
|
|
35
|
+
</div>
|
|
36
|
+
<p class="timestamp">更新时间: 2026年3月29日 22:35 | 数据来源: 百度新闻、BBC、Reddit</p>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>全球新闻聚合 - 2026年3月29日 22:36</title>
|
|
7
|
+
<style>
|
|
8
|
+
*{margin:0;padding:0;box-sizing:border-box;}
|
|
9
|
+
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);min-height:100vh;padding:20px;}
|
|
10
|
+
.container{max-width:1200px;margin:0 auto;}
|
|
11
|
+
h1{text-align:center;color:#fff;margin-bottom:30px;font-size:2.5em;text-shadow:2px 2px 4px rgba(0,0,0,0.3);}
|
|
12
|
+
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:25px;}
|
|
13
|
+
.card{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,0.2);transition:transform 0.3s ease;}
|
|
14
|
+
.card:hover{transform:translateY(-5px);}
|
|
15
|
+
.card-header{padding:20px;color:#fff;font-weight:bold;font-size:1.3em;}
|
|
16
|
+
.card-header.baidu{background:linear-gradient(135deg,#4e54c8,#8f94fb);}
|
|
17
|
+
.card-header.bbc{background:linear-gradient(135deg,#b21f1f,#f64f59);}
|
|
18
|
+
.card-header.reddit{background:linear-gradient(135deg,#ff4500,#ff6a33);}
|
|
19
|
+
.card-body{padding:20px;}
|
|
20
|
+
.news-list{list-style:none;}
|
|
21
|
+
.news-list li{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer;transition:all 0.2s;}
|
|
22
|
+
.news-list li:last-child{border-bottom:none;}
|
|
23
|
+
.news-list li:hover{color:#667eea;padding-left:10px;}
|
|
24
|
+
.news-list li::before{content:"• ";color:#667eea;font-weight:bold;margin-right:8px;}
|
|
25
|
+
.timestamp{text-align:center;color:#999;font-size:0.9em;margin-top:20px;}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div class="container">
|
|
30
|
+
<h1>📰 全球新闻聚合</h1>
|
|
31
|
+
<div class="grid">
|
|
32
|
+
<div class="card"><div class="card-header baidu">🇨🇳 百度新闻</div><div class="card-body"><ul class="news-list"><li>努力让群众看到变化、得到实惠</li><li>手机发烫可能是正在被窃密</li><li>儿子一家去世 老人骑行30年治愈自己</li><li>他们一笑 全场哭了</li><li>中国将在长江水下开高铁</li><li>孩子凌晨偷拿平板玩2小时再放回去</li><li>摆拍“打网约车遭司机辱骂”者被罚</li><li>伊朗新最高领袖为何发声少 专家分析</li><li>内存条价格崩了</li><li>身份证号的“X”到底咋读</li></ul></div></div>
|
|
33
|
+
<div class="card"><div class="card-header bbc">🇬🇧 BBC News</div><div class="card-body"><ul class="news-list"><li>CDATA[Jeremy Bowen: Trump is waging war based on instinct and it isn't working</li><li>CDATA[Iranian attacks across Gulf continue as major industrial sites hit</li><li>CDATA[Three Lebanese journalists killed in Israeli strike, say broadcasters</li><li>CDATA[Prison phone call recordings raise questions over ex-Abercrombie boss' fitness for trial</li><li>CDATA[One ant for $220: The new frontier of wildlife trafficking</li><li>CDATA[African football chief resigns following row over Morocco-Senegal final</li><li>CDATA[No Kings protesters across the US rally against Donald Trump </li><li>CDATA[How deepfake porn scandal surrounding TV star rocked Germany</li><li>CDATA[Frosting, sprinkles and layers of fun: Giant cake picnic hits Sydney</li><li>CDATA[Shops and restaurants in Egypt told to close early as energy crisis deepens</li></ul></div></div>
|
|
34
|
+
<div class="card"><div class="card-header reddit">🤖 Reddit News</div><div class="card-body"><ul class="news-list"><li>Operations Epic Fury / Roaring Lion Megathread</li><li>Pentagon preparing for weeks of ground operations in Iran, Washington Post reports</li><li>Iran warns US over ground attack as regional powers meet in Pakistan</li><li>No Kings protests across the world</li><li>Thousands gather for No Kings rally in Minnesota</li><li>Israeli airstrike in southern Lebanon kills 3 journalists covering the war</li><li>Judicial misconduct allegations: Florida judge faces ethics charges for making racial insensitive comments</li><li>Finland reports suspected territorial violation by drones</li><li>Nestlé says 413,793 KitKat candy bars stolen en route from Italy to Poland</li><li>Japan's foreign resident population hits record 4.12 million</li></ul></div></div>
|
|
35
|
+
</div>
|
|
36
|
+
<p class="timestamp">更新时间: 2026年3月29日 22:36 | 数据来源: 百度新闻、BBC、Reddit</p>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="zh-CN">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>全球新闻聚合 - 2026年3月29日 23:18</title>
|
|
7
|
+
<style>
|
|
8
|
+
*{margin:0;padding:0;box-sizing:border-box;}
|
|
9
|
+
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;background:linear-gradient(135deg,#667eea 0%,#764ba2 100%);min-height:100vh;padding:20px;}
|
|
10
|
+
.container{max-width:1200px;margin:0 auto;}
|
|
11
|
+
h1{text-align:center;color:#fff;margin-bottom:30px;font-size:2.5em;text-shadow:2px 2px 4px rgba(0,0,0,0.3);}
|
|
12
|
+
.grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:25px;}
|
|
13
|
+
.card{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,0.2);transition:transform 0.3s ease;}
|
|
14
|
+
.card:hover{transform:translateY(-5px);}
|
|
15
|
+
.card-header{padding:20px;color:#fff;font-weight:bold;font-size:1.3em;}
|
|
16
|
+
.card-header.baidu{background:linear-gradient(135deg,#4e54c8,#8f94fb);}
|
|
17
|
+
.card-header.bbc{background:linear-gradient(135deg,#b21f1f,#f64f59);}
|
|
18
|
+
.card-header.reddit{background:linear-gradient(135deg,#ff4500,#ff6a33);}
|
|
19
|
+
.card-body{padding:20px;}
|
|
20
|
+
.news-list{list-style:none;}
|
|
21
|
+
.news-list li{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer;transition:all 0.2s;}
|
|
22
|
+
.news-list li:last-child{border-bottom:none;}
|
|
23
|
+
.news-list li:hover{color:#667eea;padding-left:10px;}
|
|
24
|
+
.news-list li::before{content:"• ";color:#667eea;font-weight:bold;margin-right:8px;}
|
|
25
|
+
.timestamp{text-align:center;color:#999;font-size:0.9em;margin-top:20px;}
|
|
26
|
+
</style>
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<div class="container">
|
|
30
|
+
<h1>📰 全球新闻聚合</h1>
|
|
31
|
+
<div class="grid">
|
|
32
|
+
<div class="card"><div class="card-header baidu">🇨🇳 百度新闻</div><div class="card-body"><ul class="news-list"><li>努力让群众看到变化、得到实惠</li><li>手机发烫可能是正在被窃密</li><li>儿子一家去世 老人骑行30年治愈自己</li><li>他们一笑 全场哭了</li><li>小时候流行的“屁股针”消失了吗</li><li>孩子凌晨偷拿平板玩2小时再放回去</li><li>摆拍“打网约车遭司机辱骂”者被罚</li><li>DeepSeek“崩了”</li><li>身份证号的“X”到底咋读</li><li>内存条价格崩了</li></ul></div></div>
|
|
33
|
+
<div class="card"><div class="card-header bbc">🇬🇧 BBC News</div><div class="card-body"><ul class="news-list"><li>CDATA[Jeremy Bowen: Trump is waging war based on instinct and it isn't working</li><li>CDATA[Iranian attacks across Gulf continue as major industrial sites hit</li><li>CDATA[Three Lebanese journalists killed in Israeli strike, say broadcasters</li><li>CDATA[Prison phone call recordings raise questions over ex-Abercrombie boss' fitness for trial</li><li>CDATA[One ant for $220: The new frontier of wildlife trafficking</li><li>CDATA[African football chief resigns following row over Morocco-Senegal final</li><li>CDATA[No Kings protesters across the US rally against Donald Trump </li><li>CDATA[How deepfake porn scandal surrounding TV star rocked Germany</li><li>CDATA[Frosting, sprinkles and layers of fun: Giant cake picnic hits Sydney</li><li>CDATA[Shops and restaurants in Egypt told to close early as energy crisis deepens</li></ul></div></div>
|
|
34
|
+
<div class="card"><div class="card-header reddit">🤖 Reddit News</div><div class="card-body"><ul class="news-list"><li>Operations Epic Fury / Roaring Lion Megathread</li><li>Iran warns US over ground attack as regional powers meet in Pakistan</li><li>Pentagon preparing for weeks of ground operations in Iran, Washington Post reports</li><li>No Kings protests across the world</li><li>Thousands gather for No Kings rally in Minnesota</li><li>Israeli airstrike in southern Lebanon kills 3 journalists covering the war</li><li>Judicial misconduct allegations: Florida judge faces ethics charges for making racial insensitive comments</li><li>Finland reports suspected territorial violation by drones</li><li>Nestlé says 413,793 KitKat candy bars stolen en route from Italy to Poland</li><li>Japan's foreign resident population hits record 4.12 million</li></ul></div></div>
|
|
35
|
+
</div>
|
|
36
|
+
<p class="timestamp">更新时间: 2026年3月29日 23:18 | 数据来源: 百度新闻、BBC、Reddit</p>
|
|
37
|
+
</div>
|
|
38
|
+
</body>
|
|
39
|
+
</html>
|