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
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnrqnr5v-v75drf"
|
|
3
|
+
name: "LLM友好工具描述格式最佳实践"
|
|
4
|
+
type: "reference"
|
|
5
|
+
project: "null"
|
|
6
|
+
tags: [llm-prompt, tool-description, agent, best-practice]
|
|
7
|
+
created: "2026-04-09"
|
|
8
|
+
---
|
|
9
|
+
为 AI Agent 扩展工具设计 LLM 友好提示词格式的最佳实践:
|
|
10
|
+
|
|
11
|
+
**核心原则:**
|
|
12
|
+
1. **使用场景描述** - 告诉 LLM 何时应该调用该工具,而非仅描述工具功能
|
|
13
|
+
2. **真实可运行的示例** - 生成可直接复制使用的代码示例
|
|
14
|
+
3. **参数清晰标注** - 必填/可选标记、类型、默认值三要素
|
|
15
|
+
4. **枚举值透明** - Enum 类型必须列出所有可选值
|
|
16
|
+
|
|
17
|
+
**实现要点:**
|
|
18
|
+
- 使用 `_inferUseCases()` 根据插件/工具名称自动推断使用场景
|
|
19
|
+
- 使用 `_generateExampleValue()` 根据参数名和类型生成合理示例
|
|
20
|
+
- 表格化参数描述,用 ✅❌ 标记必填
|
|
21
|
+
- 示例代码添加中文注释说明意图
|
|
22
|
+
|
|
23
|
+
**格式结构:**
|
|
24
|
+
1. 插件级:名称 + 功能描述 + 使用场景
|
|
25
|
+
2. 工具级:工具名 + 功能 + 参数表 + 调用示例
|
|
26
|
+
3. 参数级:参数名 + 类型 + 必填标记 + 描述
|
|
27
|
+
|
|
28
|
+
**Why 重要:**
|
|
29
|
+
- 模糊的工具描述导致 LLM 乱传参数或在不必要场景调用
|
|
30
|
+
- 没有示例时 LLM 容易生成格式错误的调用
|
|
31
|
+
- 不标注必填/可选导致 LLM 遗漏关键参数
|
|
32
|
+
|
|
33
|
+
**How to apply:**
|
|
34
|
+
参考 .agent/plugins/agent-core/agent.js 中 `_buildExtensionToolsDescription()` 函数的实现,该函数已整合了上述所有最佳实践。
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnrrfzys-urudaf"
|
|
3
|
+
name: "Zod vs JSON Schema 兼容性修复"
|
|
4
|
+
type: "reference"
|
|
5
|
+
project: "null"
|
|
6
|
+
tags: [foliko, plugin, schema, gate-trading, zod, json-schema]
|
|
7
|
+
created: "2026-04-09"
|
|
8
|
+
---
|
|
9
|
+
**问题**:gate-trading 插件使用 Zod schema,但 Foliko framework 的 `_buildParamTable` 函数期望 JSON Schema 格式。
|
|
10
|
+
|
|
11
|
+
**原因**:`tool.js` 中 `_buildParamTable` 直接访问 `inputSchema.properties`,但 Zod schema 没有 `properties` 属性,只有 `shape` 属性。
|
|
12
|
+
|
|
13
|
+
**影响**:当插件使用 Zod schema 时,工具参数表格无法正确渲染。
|
|
14
|
+
|
|
15
|
+
**解决方案**:
|
|
16
|
+
1. 在 `_buildParamTable` 函数开头检测 schema 类型
|
|
17
|
+
2. 如果是 Zod schema(检测 `.shape` 属性),自动转换为 JSON Schema 格式
|
|
18
|
+
3. 或要求所有插件使用 JSON Schema 格式而非 Zod
|
|
19
|
+
|
|
20
|
+
**修复代码模式**:
|
|
21
|
+
```javascript
|
|
22
|
+
const _buildParamTable = (inputSchema, isRequired) => {
|
|
23
|
+
// 兼容 Zod schema
|
|
24
|
+
let schema = inputSchema;
|
|
25
|
+
if (inputSchema && inputSchema.shape) {
|
|
26
|
+
schema = zodToJsonSchema(inputSchema);
|
|
27
|
+
}
|
|
28
|
+
const properties = schema.properties || {};
|
|
29
|
+
// ... 后续逻辑
|
|
30
|
+
};
|
|
31
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnrrocha-t0027n"
|
|
3
|
+
name: "AI SDK v6 tool API 使用方式"
|
|
4
|
+
type: "reference"
|
|
5
|
+
project: "null"
|
|
6
|
+
tags: [ai-sdk, tool-function, v6, agent]
|
|
7
|
+
created: "2026-04-09"
|
|
8
|
+
---
|
|
9
|
+
AI SDK v6 中 `ai.tool` 的使用方式。
|
|
10
|
+
|
|
11
|
+
**问题描述**:
|
|
12
|
+
在 AgentProvider 的 `_getAITools` 方法中(第 1165 行),通过 `const { tool, ToolLoopAgent } = await this._importAI()` 动态导入 `ai.tool`。在 v6.0.146 版本中,`ai.tool` 应该作为工具函数导出,但需要注意版本兼容性问题。
|
|
13
|
+
|
|
14
|
+
**如何验证**:
|
|
15
|
+
1. 检查 `node_modules/ai/dist/index.js` 中是否导出 `tool`
|
|
16
|
+
2. 如果 `ai.tool` 不可用,可能需要升级 SDK 或使用替代方法
|
|
17
|
+
|
|
18
|
+
**应用场景**:
|
|
19
|
+
- 构建 AI Agent 工具系统
|
|
20
|
+
- 定义工具函数供 Agent 调用
|
|
21
|
+
- 如果遇到 `Cannot read properties of undefined (reading 'tool')` 错误,需检查 SDK 版本或改用其他导入方式
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnrukklc-bxndsb"
|
|
3
|
+
name: "AI主题海报设计-破晓风格"
|
|
4
|
+
type: "reference"
|
|
5
|
+
project: "null"
|
|
6
|
+
tags: [海报, AI主题, 破晓, 日出渐变, 科技蓝]
|
|
7
|
+
created: "2026-04-09"
|
|
8
|
+
---
|
|
9
|
+
## 破晓主题AI海报设计参考
|
|
10
|
+
|
|
11
|
+
**设计要点**:
|
|
12
|
+
- 主标题:「破 晓」使用蓝白渐变艺术文字,居中偏上
|
|
13
|
+
- 背景:深蓝夜空 → 黎明蓝 → 天蓝垂直渐变
|
|
14
|
+
- 焦点元素:暖白色圆形太阳 + 金色光芒射线从底部中央向外辐射
|
|
15
|
+
- 副标题:大写英文 "DAWN OF AI" 置于主标题下方
|
|
16
|
+
- 功能卡片:三栏布局展示核心能力(自然语言、Agent、插件系统)
|
|
17
|
+
- 统计卡片:数字+标签形式展示性能指标
|
|
18
|
+
- 底部引用语:科技感短句
|
|
19
|
+
|
|
20
|
+
**配色方案**:
|
|
21
|
+
- 主色:#1e3a5f(深蓝夜空)
|
|
22
|
+
- 渐变:#3b82f6(黎明蓝)
|
|
23
|
+
- 强调:#60a5fa(天蓝)
|
|
24
|
+
- 高光:#fef3c7(暖白太阳)
|
|
25
|
+
- 光芒:#fbbf24(金色射线)
|
|
26
|
+
- 文字:#ffffff(纯白)
|
|
27
|
+
|
|
28
|
+
**应用场景**: AI工具宣传、破茧重生主题、黎明/希望意象的任何场景
|
|
29
|
+
|
|
30
|
+
**Why重要**: 这是一个成功的AI主题海报设计,融合了科技感与希望感,配色和布局都具有视觉冲击力。
|
|
31
|
+
|
|
32
|
+
**How to apply**:
|
|
33
|
+
1. AI工具宣传 → 使用破晓/启航/极光等主题
|
|
34
|
+
2. 表现希望/新生 → 日出渐变 + 暖白太阳
|
|
35
|
+
3. 简洁有力 → 主标题 + 功能卡片 + 统计卡片
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnrt39t8-8eosy0"
|
|
3
|
+
name: "蓝色系配色偏好"
|
|
4
|
+
type: "user"
|
|
5
|
+
project: "foliko"
|
|
6
|
+
tags: [poster, design, blue, preference]
|
|
7
|
+
created: "2026-04-09"
|
|
8
|
+
---
|
|
9
|
+
用户偏好蓝色系配色方案。在海报设计中应优先使用蓝色主题,如 #3b82f6 作为主色调,深蓝色用于背景,浅蓝色用于装饰元素。Why: 用户多次表示喜欢蓝色,这应作为默认配色方案。How to apply: 在使用 poster 插件生成海报时,默认使用 blue 主题或自定义蓝色渐变。
|
|
Binary file
|