foliko 1.1.4 → 1.1.6
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/.agent/agents/code-assistant.json +4 -1
- package/.agent/agents/file-assistant.json +4 -1
- package/.agent/agents/orchestrator-demo.md +53 -0
- package/.agent/agents/orchestrator.json +7 -0
- package/.agent/data/plugins-state.json +4 -0
- package/.agent/mcp_config.json +6 -0
- package/.agent/memory/feedback/mnrsiuoc-e1ru74.md +9 -0
- package/.agent/memory/feedback/mnrt2mmz-98az6n.md +9 -0
- package/.agent/memory/feedback/mnrtqrhm-kxsicz.md +9 -0
- package/.agent/memory/feedback/mnrts8vg-i0ngzp.md +15 -0
- package/.agent/memory/feedback/mnrtt7jt-c0trb2.md +9 -0
- package/.agent/memory/feedback/mnruc2f0-5s52la.md +16 -0
- package/.agent/memory/feedback/mnrumbmx-63sa0v.md +9 -0
- package/.agent/memory/project/mnrp7p5n-8enm2a.md +31 -0
- package/.agent/memory/project/mnrp9ifb-yynks0.md +40 -0
- package/.agent/memory/project/mnrpb3b8-f617s4.md +25 -0
- package/.agent/memory/project/mnrrmqgg-focprv.md +9 -0
- package/.agent/memory/project/mnrtykbh-6atsor.md +9 -0
- package/.agent/memory/project/mnru9jiu-kgau16.md +35 -0
- package/.agent/memory/reference/mnrnvpwo-rcqv9m.md +52 -0
- package/.agent/memory/reference/mnrovxvz-zy9xqm.md +25 -0
- package/.agent/memory/reference/mnroxabj-1b3930.md +68 -0
- package/.agent/memory/reference/mnrpjtlp-mnb9od.md +35 -0
- package/.agent/memory/reference/mnrps1x3-6b8xfm.md +28 -0
- package/.agent/memory/reference/mnrpt9ov-15er5w.md +22 -0
- package/.agent/memory/reference/mnrq82dn-y9tv9e.md +50 -0
- package/.agent/memory/reference/mnrqnr5v-v75drf.md +34 -0
- package/.agent/memory/reference/mnrrfzys-urudaf.md +31 -0
- package/.agent/memory/reference/mnrrocha-t0027n.md +21 -0
- package/.agent/memory/reference/mnrukklc-bxndsb.md +35 -0
- package/.agent/memory/user/mnrt39t8-8eosy0.md +9 -0
- package/.agent/plugins/marknative/fonts.zip +0 -0
- package/.agent/sessions/cli_default.json +4493 -1183
- package/.agent/test-agent.js +35 -0
- package/cli/src/commands/chat.js +69 -1
- package/cli/src/index.js +11 -2
- package/foliko-cloud-rising.png +0 -0
- package/foliko-dawn-of-ai.png +0 -0
- package/foliko-mindful-observation.png +0 -0
- package/foliko-stellar-dreams.png +0 -0
- package/foliko-zen-jing.png +0 -0
- package/foliko-zen-kong.png +0 -0
- package/foliko-zen-wu.png +0 -0
- package/package.json +2 -2
- package/plugins/coordinator-plugin.js +282 -0
- package/plugins/default-plugins.js +1 -1
- package/plugins/extension-executor-plugin.js +27 -1
- package/plugins/memory-plugin.js +228 -57
- package/src/core/agent-chat.js +206 -115
- package/src/core/agent.js +258 -71
- package/src/core/coordinator-manager.js +341 -0
- package/src/core/framework.js +50 -0
- package/src/core/plugin-base.js +30 -17
- package/src/core/sub-agent-config.js +8 -1
- package/src/core/worker-agent.js +176 -0
- package/src/executors/mcp-executor.js +4 -4
- package/zen_karesansui.png +0 -0
- package/.agent/plugins/marknative/update-readme.js +0 -134
- package/output/emoji-segoe-test-v2.png +0 -0
- package/output/emoji-segoe-test.png +0 -0
- package/output/emoji-test.png +0 -0
- package/output/emoji-windows-test.png +0 -0
- package/output/foliko-emoji-poster.png +0 -0
- package/output/foliko-muji-poster-final.png +0 -0
- package/output/foliko-muji-poster-v2.png +0 -0
- package/output/foliko-muji-poster.png +0 -0
- package/output/foliko-share.png +0 -0
- package/output/progress-circle-test.png +0 -0
- package/output/vb-agent-poster.png +0 -0
|
@@ -10,7 +10,7 @@ const path = require('path');
|
|
|
10
10
|
const { z } = require('zod');
|
|
11
11
|
const { createMCPClient } = require('@ai-sdk/mcp');
|
|
12
12
|
const { StdioClientTransport } = require('@modelcontextprotocol/sdk/client/stdio.js');
|
|
13
|
-
const {
|
|
13
|
+
const { zodSchemaToTable } = require('@chnak/zod-to-markdown');
|
|
14
14
|
const { logger } = require('../utils/logger');
|
|
15
15
|
|
|
16
16
|
const log = logger.child('MCPExecutor');
|
|
@@ -548,20 +548,20 @@ class MCPExecutorPlugin extends Plugin {
|
|
|
548
548
|
if (typeof schema.toJSON === 'function') {
|
|
549
549
|
// Zod schema 直接转换
|
|
550
550
|
desc += `**参数:**\n\n`;
|
|
551
|
-
desc +=
|
|
551
|
+
desc += zodSchemaToTable(schema) + '\n\n';
|
|
552
552
|
} else if (schema.jsonSchema) {
|
|
553
553
|
// JSON Schema 格式,尝试转换为 Zod schema
|
|
554
554
|
const zodSchema = this._jsonSchemaToZod(schema.jsonSchema || schema);
|
|
555
555
|
if (zodSchema) {
|
|
556
556
|
desc += `**参数:**\n\n`;
|
|
557
|
-
desc +=
|
|
557
|
+
desc += zodSchemaToTable(zodSchema) + '\n\n';
|
|
558
558
|
}
|
|
559
559
|
} else if (schema.properties) {
|
|
560
560
|
// 已经是对象格式
|
|
561
561
|
const zodSchema = this._jsonSchemaToZod(schema);
|
|
562
562
|
if (zodSchema) {
|
|
563
563
|
desc += `**参数:**\n\n`;
|
|
564
|
-
desc +=
|
|
564
|
+
desc += zodSchemaToTable(zodSchema) + '\n\n';
|
|
565
565
|
}
|
|
566
566
|
}
|
|
567
567
|
} catch (e) {
|
|
Binary file
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* 更新仓库 README 的脚本
|
|
5
|
-
* 读取所有插件目录,生成插件列表表格
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const path = require('path');
|
|
10
|
-
|
|
11
|
-
const REPO_DIR = path.join(__dirname, '..', '..', '..');
|
|
12
|
-
const README_PATH = path.join(REPO_DIR, 'README.md');
|
|
13
|
-
|
|
14
|
-
// 插件信息
|
|
15
|
-
const plugins = [];
|
|
16
|
-
|
|
17
|
-
function getPluginInfo(pluginPath) {
|
|
18
|
-
const indexPath = path.join(pluginPath, 'index.js');
|
|
19
|
-
const readmePath = path.join(pluginPath, 'README.md');
|
|
20
|
-
|
|
21
|
-
let name = path.basename(pluginPath);
|
|
22
|
-
let description = '暂无描述';
|
|
23
|
-
let tools = [];
|
|
24
|
-
|
|
25
|
-
// 读取 README
|
|
26
|
-
if (fs.existsSync(readmePath)) {
|
|
27
|
-
const content = fs.readFileSync(readmePath, 'utf-8');
|
|
28
|
-
const descMatch = content.match(/^#\s+(.+)$/m);
|
|
29
|
-
if (descMatch) {
|
|
30
|
-
description = descMatch[1];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// 读取 index.js 获取工具列表
|
|
35
|
-
if (fs.existsSync(indexPath)) {
|
|
36
|
-
const content = fs.readFileSync(indexPath, 'utf-8');
|
|
37
|
-
const toolMatches = content.match(/^\s{2}(\w+):\s*\{\s*description:/gm);
|
|
38
|
-
if (toolMatches) {
|
|
39
|
-
tools = toolMatches.map(m => m.match(/\s{2}(\w+):/)[1]);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return { name, description, tools };
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// 扫描插件目录
|
|
47
|
-
function scanPlugins() {
|
|
48
|
-
const pluginsDir = path.join(REPO_DIR);
|
|
49
|
-
|
|
50
|
-
if (!fs.existsSync(pluginsDir)) {
|
|
51
|
-
console.error('Plugins directory not found:', pluginsDir);
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const entries = fs.readdirSync(pluginsDir, { withFileTypes: true });
|
|
56
|
-
|
|
57
|
-
for (const entry of entries) {
|
|
58
|
-
if (entry.isDirectory() && !entry.name.startsWith('.')) {
|
|
59
|
-
const pluginPath = path.join(pluginsDir, entry.name);
|
|
60
|
-
const indexPath = path.join(pluginPath, 'index.js');
|
|
61
|
-
|
|
62
|
-
if (fs.existsSync(indexPath)) {
|
|
63
|
-
const info = getPluginInfo(pluginPath);
|
|
64
|
-
plugins.push(info);
|
|
65
|
-
console.log(`Found plugin: ${info.name}`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 生成 README 内容
|
|
72
|
-
function generateReadme() {
|
|
73
|
-
const pluginTable = plugins.map(p => {
|
|
74
|
-
const toolList = p.tools.length > 0
|
|
75
|
-
? p.tools.map(t => `| \`${t}\` | - |`).join('\n')
|
|
76
|
-
: '| - | - |';
|
|
77
|
-
|
|
78
|
-
return `## ${p.name.charAt(0).toUpperCase() + p.name.slice(1).replace(/-/g, ' ')}\n\n${p.description}\n\n### 工具\n\n| 工具 | 描述 |\n|------|------|\n${toolList}\n`;
|
|
79
|
-
}).join('\n---\n\n');
|
|
80
|
-
|
|
81
|
-
const pluginListTable = plugins.map(p => {
|
|
82
|
-
const name = p.name.charAt(0).toUpperCase() + p.name.slice(1).replace(/-/g, ' ');
|
|
83
|
-
return `| [\`${p.name}\`](#${p.name.toLowerCase()}) | ${p.description} | ✅ 可用 |`;
|
|
84
|
-
}).join('\n');
|
|
85
|
-
|
|
86
|
-
const pluginToolsTable = plugins.map(p => {
|
|
87
|
-
return `### ${p.name}\n\n| 工具 | 描述 |\n|------|------|\n${p.tools.map(t => `| \`${t}\` | - |`).join('\n')}\n`;
|
|
88
|
-
}).join('\n---\n\n');
|
|
89
|
-
|
|
90
|
-
return `# Foliko Plugins
|
|
91
|
-
|
|
92
|
-
Foliko Agent 框架的插件仓库,为 Foliko 提供扩展功能。
|
|
93
|
-
|
|
94
|
-
## 插件列表
|
|
95
|
-
|
|
96
|
-
| 插件 | 描述 | 状态 |
|
|
97
|
-
|------|------|------|
|
|
98
|
-
${pluginListTable}
|
|
99
|
-
|
|
100
|
-
${pluginToolsTable}
|
|
101
|
-
|
|
102
|
-
## 安装所有插件
|
|
103
|
-
|
|
104
|
-
\`\`\`bash
|
|
105
|
-
${plugins.map(p => `folko plugin install ${p.name}`).join('\n')}
|
|
106
|
-
folko reload
|
|
107
|
-
\`\`\`
|
|
108
|
-
|
|
109
|
-
## 许可证
|
|
110
|
-
|
|
111
|
-
Apache-2.0
|
|
112
|
-
`;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// 主函数
|
|
116
|
-
function main() {
|
|
117
|
-
console.log('Scanning plugins...');
|
|
118
|
-
scanPlugins();
|
|
119
|
-
|
|
120
|
-
console.log(`\nFound ${plugins.length} plugins`);
|
|
121
|
-
|
|
122
|
-
if (plugins.length === 0) {
|
|
123
|
-
console.log('No plugins found, skipping README update');
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
console.log('\nGenerating README...');
|
|
128
|
-
const content = generateReadme();
|
|
129
|
-
|
|
130
|
-
fs.writeFileSync(README_PATH, content, 'utf-8');
|
|
131
|
-
console.log(`README updated: ${README_PATH}`);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
main();
|
|
Binary file
|
|
Binary file
|
package/output/emoji-test.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/output/foliko-share.png
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|