foliko 1.1.6 → 1.1.7

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.
Files changed (79) hide show
  1. package/.agent/data/email/processed-emails.json +1 -0
  2. package/.agent/data/plugins-state.json +5 -1
  3. package/.agent/data/web/web-config.json +5 -0
  4. package/.agent/memory/feedback/mnt7jrlt-d67qs7.md +15 -0
  5. package/.agent/memory/feedback/mnt88ja3-al4fuy.md +9 -0
  6. package/.agent/plugins/test-plugin.py +108 -0
  7. package/.agent/sessions/cli_default.json +514 -5298
  8. package/.claude/settings.local.json +2 -1
  9. package/SPEC.md +735 -696
  10. package/output/zen_silence.png +0 -0
  11. package/package.json +2 -2
  12. package/plugins/ambient-agent/EventWatcher.js +33 -37
  13. package/plugins/ambient-agent/ExplorerLoop.js +338 -36
  14. package/plugins/ambient-agent/GoalManager.js +7 -3
  15. package/plugins/ambient-agent/StateStore.js +30 -1
  16. package/plugins/ambient-agent/constants.js +15 -1
  17. package/plugins/ambient-agent/index.js +26 -33
  18. package/plugins/coordinator-plugin.js +3 -3
  19. package/plugins/default-plugins.js +2 -2
  20. package/plugins/email/index.js +150 -36
  21. package/plugins/email/monitor.js +79 -5
  22. package/plugins/email/reply.js +15 -25
  23. package/plugins/extension-executor-plugin.js +160 -31
  24. package/plugins/file-system-plugin.js +57 -24
  25. package/plugins/memory-plugin.js +176 -64
  26. package/plugins/python-plugin-loader.js +79 -9
  27. package/plugins/scheduler-plugin.js +64 -24
  28. package/plugins/think-plugin.js +7 -2
  29. package/plugins/web-plugin.js +263 -4
  30. package/skills/ambient-agent/SKILL.md +342 -314
  31. package/src/core/agent-chat.js +64 -9
  32. package/src/core/agent.js +118 -59
  33. package/src/core/tool-registry.js +5 -5
  34. package/src/executors/mcp-executor.js +188 -26
  35. package/src/utils/id.js +5 -0
  36. package/system.md +3480 -0
  37. package/.agent/data/ambient/goals.json +0 -50
  38. package/.agent/data/ambient/memories.json +0 -7
  39. package/.agent/memory/core.md +0 -1
  40. package/.agent/memory/feedback/mnrsiuoc-e1ru74.md +0 -9
  41. package/.agent/memory/feedback/mnrt2mmz-98az6n.md +0 -9
  42. package/.agent/memory/feedback/mnrtqrhm-kxsicz.md +0 -9
  43. package/.agent/memory/feedback/mnrts8vg-i0ngzp.md +0 -15
  44. package/.agent/memory/feedback/mnrtt7jt-c0trb2.md +0 -9
  45. package/.agent/memory/feedback/mnruc2f0-5s52la.md +0 -16
  46. package/.agent/memory/feedback/mnrumbmx-63sa0v.md +0 -9
  47. package/.agent/memory/project/mnn93ogy-ypjn27.md +0 -9
  48. package/.agent/memory/project/mnn98fqy-5nhc1u.md +0 -25
  49. package/.agent/memory/project/mnrp7p5n-8enm2a.md +0 -31
  50. package/.agent/memory/project/mnrp9ifb-yynks0.md +0 -40
  51. package/.agent/memory/project/mnrpb3b8-f617s4.md +0 -25
  52. package/.agent/memory/project/mnrrmqgg-focprv.md +0 -9
  53. package/.agent/memory/project/mnrtykbh-6atsor.md +0 -9
  54. package/.agent/memory/project/mnru9jiu-kgau16.md +0 -35
  55. package/.agent/memory/reference/mnq3oenw-46haj6.md +0 -63
  56. package/.agent/memory/reference/mnq5qxm2-mjoooh.md +0 -116
  57. package/.agent/memory/reference/mnrnvpwo-rcqv9m.md +0 -52
  58. package/.agent/memory/reference/mnrovxvz-zy9xqm.md +0 -25
  59. package/.agent/memory/reference/mnroxabj-1b3930.md +0 -68
  60. package/.agent/memory/reference/mnrpjtlp-mnb9od.md +0 -35
  61. package/.agent/memory/reference/mnrps1x3-6b8xfm.md +0 -28
  62. package/.agent/memory/reference/mnrpt9ov-15er5w.md +0 -22
  63. package/.agent/memory/reference/mnrq82dn-y9tv9e.md +0 -50
  64. package/.agent/memory/reference/mnrqnr5v-v75drf.md +0 -34
  65. package/.agent/memory/reference/mnrrfzys-urudaf.md +0 -31
  66. package/.agent/memory/reference/mnrrocha-t0027n.md +0 -21
  67. package/.agent/memory/reference/mnrukklc-bxndsb.md +0 -35
  68. package/.agent/memory/user/mnm67t9m-x8rekk.md +0 -9
  69. package/.agent/memory/user/mnn5mmqh-w6aktx.md +0 -11
  70. package/.agent/memory/user/mnnbfhhn-dk1bd1.md +0 -22
  71. package/.agent/memory/user/mnrt39t8-8eosy0.md +0 -9
  72. package/foliko-cloud-rising.png +0 -0
  73. package/foliko-dawn-of-ai.png +0 -0
  74. package/foliko-mindful-observation.png +0 -0
  75. package/foliko-stellar-dreams.png +0 -0
  76. package/foliko-zen-jing.png +0 -0
  77. package/foliko-zen-kong.png +0 -0
  78. package/foliko-zen-wu.png +0 -0
  79. package/zen_karesansui.png +0 -0
@@ -1,50 +0,0 @@
1
- [
2
- {
3
- "id": "041f34d6-8ada-4a0f-932d-147f8476a830",
4
- "title": "邮箱监控与自动回复",
5
- "description": "监控邮箱,收到新邮件时自动分析内容并回复,无需用户确认",
6
- "priority": 8,
7
- "state": "active",
8
- "actions": [
9
- {
10
- "type": "tool",
11
- "name": "email_auto_reply",
12
- "args": {
13
- "to": "${event.to}",
14
- "subject": "${event.subject}",
15
- "body": "${event.text}",
16
- "from": "${event.from}",
17
- "messageId": "${event.messageId}"
18
- }
19
- }
20
- ],
21
- "_originalActions": [
22
- {
23
- "type": "tool",
24
- "name": "email_auto_reply",
25
- "args": {
26
- "to": "${event.to}",
27
- "subject": "${event.subject}",
28
- "body": "${event.text}",
29
- "from": "${event.from}",
30
- "messageId": "${event.messageId}"
31
- }
32
- }
33
- ],
34
- "conditions": {
35
- "events": [
36
- "email:received"
37
- ]
38
- },
39
- "createdAt": "2026-03-29T18:15:42.180Z",
40
- "updatedAt": "2026-03-29T19:00:39.406Z",
41
- "activatedAt": "2026-03-29T18:15:44.186Z",
42
- "completedAt": "2026-03-29T18:54:56.861Z",
43
- "failedAt": null,
44
- "attempts": 11,
45
- "maxAttempts": 10,
46
- "consecutiveSameActions": 0,
47
- "lastActionId": null,
48
- "eventsReceived": []
49
- }
50
- ]
@@ -1,7 +0,0 @@
1
- [
2
- {
3
- "key": "test_memory",
4
- "content": "Ambient Agent 测试记忆 - 创建时间: 2026-03-29,系统运行正常",
5
- "timestamp": "2026-03-29T14:53:03.801Z"
6
- }
7
- ]
@@ -1 +0,0 @@
1
- 测试数据 - 姓名: 李四, 职业: 工程师, 城市: 北京, 兴趣: 编程
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrsiuoc-e1ru74"
3
- name: "【避免指南】使用 poster 插件时必须使用完整的预设名称"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, preset]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】调用 poster:create_poster_canvas 时,预设名称必须使用完整值而非简化值。错误原因:用户传入了 "instagram",但这不是有效预设,正确值是 "social_instagram"。可用的社交媒体相关预设包括:social_instagram、social_story、social_facebook、social_linkedin、social_youtube。建议在使用前查阅完整预设列表(poster_a4, poster_square, poster_16_9, poster_4_3, poster_9_16, banner_1920x500, banner_1200x400, banner_750x300, banner_468x60, banner_twitter, social_instagram, social_story, social_facebook, social_linkedin, social_youtube, promo_900x500, promo_500x500, promo_300x250, card_standard)。
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrt2mmz-98az6n"
3
- name: "【避免指南】使用 generate_poster 前确保画布已创建"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, generate_poster]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】使用 generate_poster 生成海报前,需先调用 create_poster_canvas 创建画布,或检查工具调用链是否完整。错误原因:generate_poster 是组合式海报生成的快捷方法,但底层依赖画布上下文,缺少画布初始化会导致 "No canvas created" 错误。建议先调用 create_poster_canvas 创建空白画布,或改用 compose_poster 组件化方法分步构建海报。
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrtqrhm-kxsicz"
3
- name: "【避免指南】避免使用不存在的 preset 值调用 create_poster_canvas"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, create_poster_canvas, 参数错误]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】调用 poster:create_poster_canvas 时,preset 参数必须使用系统提供的预设值之一,禁止使用 'custom' 或其他自定义字符串。可用的 preset 值包括:poster_a4, poster_square, poster_16_9, poster_4_3, poster_9_16, banner_1920x500, banner_1200x400, banner_750x300, banner_468x60, banner_twitter, social_instagram, social_story, social_facebook, social_linkedin, social_youtube, promo_900x500, promo_500x500, promo_300x250, card_standard。如果需要自定义尺寸,应通过 width 和 height 参数直接指定(同时 preset 设为空或使用基础预设),而非将 preset 设为 'custom'。错误原因:系统不支持 'custom' 作为 preset 参数的有效值。
@@ -1,15 +0,0 @@
1
- ---
2
- id: "mnrts8vg-i0ngzp"
3
- name: "避免调用 ext_call 时参数类型错误导致 path.arc is not a function"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, chart, extension]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】使用海报图表组件时,确保传入正确的参数类型和结构。错误原因:path.arc is not a function 通常是因为内部渲染逻辑在处理饼图时,path 参数类型不匹配(如传入了普通对象而非 Path2D 对象)。
10
-
11
- 【具体避免措施】
12
- 1. 图表数据使用标准格式:{"data":[{"label":"...","value":数字,"color":"颜色"}],"type":"pie","width":数字,"height":数字}
13
- 2. 避免在 data 中混用字符串和数字类型的 value
14
- 3. 确认使用的插件版本支持该图表类型
15
- 4. 如遇持续报错,考虑使用其他图表组件(柱状图)或降级插件版本
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrtt7jt-c0trb2"
3
- name: "【避免指南】poster插件图片src参数必须使用本地文件路径"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster:add_poster_image]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】使用 poster 插件添加图片时,src 参数必须传入本地文件路径(如 ./images/logo.png),不能直接使用网络 URL(如 https://via.placeholder.com/...)。错误原因:poster 插件的图片加载功能不支持网络 URL,会将 URL 当作本地文件路径处理导致文件不存在错误。如果需要使用网络图片,应先下载到本地,再传入本地路径。
@@ -1,16 +0,0 @@
1
- ---
2
- id: "mnruc2f0-5s52la"
3
- name: "【避免指南】避免同时传入互斥的背景参数(gradient/color 和 image)"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, add_poster_background]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】调用 add_poster_background 时,渐变背景(gradient)、纯色背景(color)、图片背景(image)三个参数是互斥的,不能同时传入。
10
-
11
- 错误原因:同时传入了 gradient 和 image 参数,且 image 的值是颜色码 "#F5F2EB",系统误认为这是图片路径,导致报错 "图片文件不存在: D:\Code\foliko\#F5F2EB"。
12
-
13
- 正确做法:
14
- - 使用渐变背景:只传 gradient 参数,不传 image 和 color
15
- - 使用纯色背景:只传 color 参数(如 "#F5F2EB"),不传 gradient 和 image
16
- - 使用图片背景:只传 image 参数(如 "./bg.png"),不传 gradient 和 color
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrumbmx-63sa0v"
3
- name: "【避免指南】ext_call 调用时正确传入 plugin、tool、args 参数"
4
- type: "feedback"
5
- project: "null"
6
- tags: [error, avoid, poster, ext_call]
7
- created: "2026-04-09"
8
- ---
9
- 【下次这样做】调用 ext_call 时必须正确传入 plugin、tool、args 三个参数。错误原因:调用参数中包含错误的字符串 `</parameter` 导致 plugin 参数被错误解析为 `poster</parameter` 而非 `poster`,导致扩展插件无法定位。正确调用方式:ext_call({ plugin: "poster", tool: "export_poster_canvas", args: {filename: "foliko-zen-kong", format: "png", outputDir: "."} })
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnn93ogy-ypjn27"
3
- name: "Foliko AI Agent Platform"
4
- type: "project"
5
- project: "foliko"
6
- tags: [foliko, ai-agent, poster, design]
7
- created: "2026-04-06"
8
- ---
9
- Foliko 是一个 AI Agent 平台项目,位于 D:\Code\vb-agent 目录。用户正在测试不同的海报设计风格,目前已经测试了 simple、business、social 和 modern 四种模板样式。这表明用户在为项目选择合适的视觉设计风格。后续可以使用此记忆来理解用户的设计偏好,或在类似项目中提供风格建议。
@@ -1,25 +0,0 @@
1
- ---
2
- id: "mnn98fqy-5nhc1u"
3
- name: "Foliko AI 海报设计规范"
4
- type: "project"
5
- project: "Foliko"
6
- tags: [海报设计, AI, 品牌视觉, 项目展示]
7
- created: "2026-04-06"
8
- ---
9
- Foliko 是一个 AI 项目,slogan 是「AI 驱动的创意灵感和效率工具」。为 Foliko 制作海报的设计经验:
10
-
11
- **设计原则**:
12
- - 视觉层次:大标题 > 副标题 > 核心特性 > 行动号召
13
- - 色彩搭配:深色背景 + 霓虹渐变(科技感),蓝色代表科技/信任,绿色代表创新
14
- - 留白:保持简洁,不要过于拥挤
15
- - 对比:使用深色背景+亮色文字产生强烈对比
16
- - 品牌识别:保持 Foliko 的品牌色
17
-
18
- **成功实践**:
19
- - 使用渐变标题突出品牌名
20
- - 添加装饰性几何元素(圆、线条、发光点)增强科技感
21
- - 卡片式展示核心功能
22
- - 英文 + 中文双语展示增强国际感
23
- - 暗底亮字是有效的视觉策略
24
-
25
- **How to apply**: 在后续海报生成中,应优先使用深色背景、渐变品牌色、科技感装饰元素,聚焦核心功能展示,保持简洁有力的视觉层次。
@@ -1,31 +0,0 @@
1
- ---
2
- id: "mnrp7p5n-8enm2a"
3
- name: "Foliko Agent Framework 结构"
4
- type: "project"
5
- project: "foliko"
6
- tags: [architecture, src目录, 代码结构]
7
- created: "2026-04-09"
8
- ---
9
- ## Foliko 项目 src 目录结构
10
-
11
- ### 目录组成
12
- - **core/** (14文件, 208KB): 核心层,包含 Agent管理、插件系统、工具系统、会话管理
13
- - **capabilities/** (3文件, 56KB): 能力层,包含技能管理和工作流引擎
14
- - **executors/** (2文件, 27KB): 执行层,支持 MCP 协议
15
- - **utils/** (10文件, 63KB): 基础设施,包含错误处理、日志、熔断、重试、沙箱
16
- - **agent/** (空目录): 预留待开发
17
-
18
- ### 设计模式
19
- - 插件模式 (plugin-manager)
20
- - 注册表模式 (tool-registry)
21
- - 工厂模式 (framework)
22
- - 熔断器模式 (circuit-breaker)
23
- - 观察者模式 (event-emitter)
24
-
25
- ### 入口依赖链
26
- framework.js → agent.js → agent-chat.js + session-context.js + context-manager.js
27
-
28
- ### 如何应用
29
- - 了解项目架构时查看此记忆
30
- - 新增功能时确定放在哪个层级
31
- - 调试问题时代码定位
@@ -1,40 +0,0 @@
1
- ---
2
- id: "mnrp9ifb-yynks0"
3
- name: "agent.js 代码质量分析报告"
4
- type: "project"
5
- project: "foliko"
6
- tags: [代码分析, agent.js, 静态分析, 性能优化, 重构]
7
- created: "2026-04-09"
8
- ---
9
- ## 背景
10
- Agent.js (Agent执行器) 静态分析报告,2025年1月通过静态分析工具生成。
11
-
12
- ## 关键发现
13
-
14
- ### P0 必须修复
15
- - Line 6: 删除未使用的导入 `const { pl } = require('zod/v4/locales')`
16
-
17
- ### P1 强烈建议
18
- - Line 35-36: 魔法数字需提取为常量 (MAX_OUTPUT_TOKENS, DEFAULT_TEMPERATURE)
19
- - Line 370: 同步文件I/O应改为异步 `fs.promises.readFile()`
20
- - 多处: 循环内字符串拼接改用 `array.join('\n')`
21
-
22
- ### P2 建议优化
23
- 1. **拆分 Agent 类** - 当前承担7+种职责(Agent类913行)
24
- 2. **显式清理事件监听器** - `destroy()` 中调用 `removeAllListeners()`
25
- 3. **添加缺失的 JSDoc**
26
- 4. **清理被注释代码** - Line 173
27
-
28
- ### 代码指标
29
- - 圈复杂度: ~97
30
- - 最大嵌套深度: 6层
31
- - 代码行数: 913
32
- - 控制流(if): 55次, (for): 13次
33
- - 公共API: 76个
34
- - 综合评分: 3.0/5
35
-
36
- ## How to Apply
37
- - 重构前优先处理 P0/P1 问题
38
- - Agent 类拆分建议:拆分为 AgentCore + AgentPlugins + AgentExecutor
39
- - 建议使用 ESLint + TypeScript strict 模式防止回归
40
- - 优化后重新跑分析对比指标改善情况
@@ -1,25 +0,0 @@
1
- ---
2
- id: "mnrpb3b8-f617s4"
3
- name: "Foliko 项目架构与代码质量分析"
4
- type: "project"
5
- project: "foliko"
6
- tags: [架构, 代码质量, 重构, agent]
7
- created: "2026-04-09"
8
- ---
9
- ## Why - 为什么重要
10
-
11
- Foliko 是一个 AI Agent 框架,采用分层架构设计。核心文件 `src/core/agent.js` 存在以下问题需要关注:
12
-
13
- 1. **圈复杂度 97**(偏高)- 影响代码可维护性
14
- 2. **913 行大类** - 承担 7+ 职责,违反单一职责原则
15
- 3. **P0 紧急问题** - 第 6 行存在未使用导入
16
- 4. **同步文件 I/O** - 第 370 行使用 `readFileSync`,阻塞事件循环
17
- 5. **循环内字符串拼接** - 性能隐患
18
-
19
- ## How to apply - 如何使用
20
-
21
- 1. **立即修复**: 删除 `src/core/agent.js` 第 6 行未使用导入
22
- 2. **重构 Agent 类**: 提取 ToolManager、MessageHandler 等职责
23
- 3. **异步化**: 将 `readFileSync` 改为异步版本
24
- 4. **性能优化**: 避免循环内字符串拼接,使用数组 join
25
- 5. **提取魔法数字**: 为 5000、10000 等值定义常量
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrrmqgg-focprv"
3
- name: "zodSchema 转换功能"
4
- type: "project"
5
- project: "foliko-agent"
6
- tags: [ai-sdk, zod, schema, tool-calling]
7
- created: "2026-04-09"
8
- ---
9
- 在 Foliko Agent 项目中添加对 AI SDK v6 zodSchema 的支持。当前的 AI SDK v6 API 发生了重大变化,工具定义方式从 v5 的 JSON Schema 改为 zodSchema。需要修改 agent-chat.js 中 _prepareToolDefinition 方法,将工具的 inputSchema 从 JSON Schema 格式转换为 zodSchema 格式,以支持 AI SDK v6 的工具调用功能。
@@ -1,9 +0,0 @@
1
- ---
2
- id: "mnrtykbh-6atsor"
3
- name: "Foliko 完整功能宣传海报设计"
4
- type: "project"
5
- project: "foliko-poster-design"
6
- tags: [poster, design, foliko, showcase]
7
- created: "2026-04-09"
8
- ---
9
- 为 Foliko 框架生成了完整的宣传海报。包含:深蓝渐变背景、主副标题区、6个核心特性卡片(插件系统、智能Agent、工作流引擎、交易插件、Ambient Agent、会话管理)、4个统计卡片、进度条、步骤指示器、引用块、CTA按钮、图表等153个组件。配色:蓝色#3b82f6为主,紫#8b5cf6、青#06b6d4、粉#f472b6为辅。文件:foliko-complete-poster.png (2000x2000px)。如需其他项目宣传材料可复用此设计模式。
@@ -1,35 +0,0 @@
1
- ---
2
- id: "mnru9jiu-kgau16"
3
- name: "禅意海报设计系统"
4
- type: "project"
5
- project: "foliko-poster-design"
6
- tags: [禅意, 原研哉, 枯山水, 马远夏圭, 极简主义, 东方美学]
7
- created: "2026-04-09"
8
- ---
9
- 禅意海报设计系统 — 融合原研哉极简美学、日本枯山水意境、南宋马远夏圭'马一角夏半边'构图
10
-
11
- **核心原则:**
12
- - 知白守黑:大量留白是东方美学的精髓,留白即大象
13
- - 一角式构图:取局部而非全景,意境大于形似
14
- - 材质为本:追求纸张纹理、手揉痕迹、边缘粗糙等手工质感
15
-
16
- **色彩配置:**
17
- - 卵石色 #D6CEBD — 自然、温暖、纸张质感
18
- - 墨色 #2C2C2C — 书法、水墨、点睛之笔
19
- - 留白 #F5F2EB — 负空间、呼吸感
20
- - 赭石红 #8B4513 — 印章点缀,少量即可
21
-
22
- **可用元素:**
23
- - 枯山水砂纹(同心圆弧)
24
- - 墨色山石剪影(极简几何)
25
- - 残月/圆月
26
- - 禅意文字(空、寂、禅、虚)
27
- - 印章(单字:虚、空、禅、悟)
28
- - 水墨点
29
-
30
- **应用场景:**
31
- - 品牌禅意海报
32
- - 产品MUJI风展示
33
- - 文化活动视觉
34
- - 冥想/瑜伽推广
35
- - 茶道/香道文化宣传
@@ -1,63 +0,0 @@
1
- ---
2
- id: "mnq3oenw-46haj6"
3
- name: "环形进度条代码"
4
- type: "reference"
5
- project: "null"
6
- tags: [poster, 海报, 进度条, 组件]
7
- created: "2026-04-08"
8
- ---
9
- # 环形进度条 (Progress Circle)
10
-
11
- ## 工具函数
12
- `add_poster_progress_circle`
13
-
14
- ## 参数说明
15
- | 参数 | 类型 | 默认值 | 说明 |
16
- |------|------|--------|------|
17
- | cx | number | 必填 | 圆心 X 坐标 |
18
- | cy | number | 必填 | 圆心 Y 坐标 |
19
- | radius | number | 必填 | 圆环半径 |
20
- | value | number | 必填 | 进度值 0-100 |
21
- | strokeWidth | number | 10 | 环宽度 |
22
- | trackColor | string | #dddddd | 轨道颜色 |
23
- | fillColor | string | #4CAF50 | 进度颜色 |
24
- | backgroundColor | string | - | 背景填充色 |
25
- | showLabel | boolean | true | 是否显示百分比 |
26
- | labelColor | string | #000000 | 标签颜色 |
27
-
28
- ## 使用示例
29
-
30
- ```javascript
31
- // 1. 创建画布
32
- create_poster_canvas({
33
- width: 600,
34
- height: 400,
35
- background: '#1a1a2e'
36
- })
37
-
38
- // 2. 添加环形进度条
39
- add_poster_progress_circle({
40
- cx: 300,
41
- cy: 200,
42
- radius: 100,
43
- value: 75,
44
- strokeWidth: 15,
45
- trackColor: '#333355',
46
- fillColor: '#e94560',
47
- backgroundColor: '#1a1a2e',
48
- showLabel: true,
49
- labelColor: '#ffffff'
50
- })
51
-
52
- // 3. 导出图片
53
- export_poster_canvas({
54
- filename: 'progress-circle-test',
55
- format: 'png',
56
- outputDir: './output'
57
- })
58
- ```
59
-
60
- ## 效果
61
- - 深色背景
62
- - 红色环形进度条显示 75%
63
- - 白色百分比标签居中
@@ -1,116 +0,0 @@
1
- ---
2
- id: "mnq5qxm2-mjoooh"
3
- name: "无印风格 Foliko 海报"
4
- type: "reference"
5
- project: "null"
6
- tags: [poster, 海报, 无印风格, MUJI, foliko]
7
- created: "2026-04-08"
8
- ---
9
- # 无印风格 (MUJI Style) Foliko 海报
10
-
11
- ## 配色方案
12
-
13
- | 元素 | 颜色代码 | 用途 |
14
- |------|----------|------|
15
- | 背景 | `#f7f5f0` | 米白纸张色 |
16
- | 主标题 | `#333333` | 深炭灰艺术字 |
17
- | 副标题 | `#666666` | 中灰 |
18
- | 正文 | `#555555` | 深灰正文 |
19
- | 辅助文字 | `#999999` | 浅灰 |
20
- | 点缀/装饰 | `#8b7355` | 自然棕线条 |
21
- | 按钮背景 | `#efefeb` | 淡米色 |
22
- | 功能圆标 | `#e8e5df` | 暖灰圆圈 |
23
- | 分隔线 | `#cccccc` / `#dddddd` | 浅灰分隔 |
24
-
25
- ## 设计规范
26
-
27
- ### 尺寸
28
- - 竖版海报:1080 x 2200
29
-
30
- ### 排版结构
31
- 1. **顶部装饰** - 左右两侧自然棕竖线
32
- 2. **标题区** - Logo + 副标题 + 分隔线
33
- 3. **核心特性** - 6个功能点,3x2网格布局
34
- 4. **安装命令** - PowerShell 命令框
35
- 5. **使用方法** - 4个步骤说明
36
- 6. **底部信息** - 官网 + 装饰线 + 装饰圆
37
-
38
- ### 字体
39
- - 艺术字标题:渐变深灰
40
- - 正文:Microsoft YaHei
41
- - 代码:Consolas
42
-
43
- ### 组件使用
44
- - 线条:`add_poster_line` - 装饰线、分隔线
45
- - 圆形:`add_poster_circle` - 功能图标背景
46
- - 矩形:`add_poster_rectangle` - 命令框
47
- - 艺术字:`add_poster_art_text` - Logo
48
- - 文字:`add_poster_text` - 所有文字
49
-
50
- ## 代码模板
51
-
52
- ```javascript
53
- // 1. 创建画布
54
- create_poster_canvas({
55
- width: 1080,
56
- height: 2200,
57
- background: '#f7f5f0'
58
- })
59
-
60
- // 2. 顶部装饰线
61
- add_poster_line({ x1: 100, y1: 100, x2: 100, y2: 280, stroke: '#8b7355', strokeWidth: 2 })
62
- add_poster_line({ x1: 960, y1: 100, x2: 960, y2: 280, stroke: '#8b7355', strokeWidth: 2 })
63
-
64
- // 3. Logo 艺术字
65
- add_poster_art_text({
66
- text: 'FOLIKO',
67
- x: 540, y: 380,
68
- fontSize: 120,
69
- gradient: { colors: ['#333333', '#555555'], direction: 90 }
70
- })
71
-
72
- // 4. 副标题
73
- add_poster_text({
74
- text: '简约的插件化 Agent 框架',
75
- x: 540, y: 460,
76
- fontSize: 24, color: '#666666', align: 'center'
77
- })
78
-
79
- // 5. 分隔线
80
- add_poster_line({ x1: 340, y1: 510, x2: 740, y2: 510, stroke: '#cccccc', strokeWidth: 1 })
81
-
82
- // 6. 功能特点(3x2网格)
83
- // 每组:圆形背景 + 图标 + 文字
84
-
85
- // 7. 安装命令框
86
- add_poster_rectangle({ x: 140, y: 1100, width: 800, height: 70, fill: '#efefeb', radius: 4 })
87
- add_poster_text({
88
- text: 'irm https://foliko.com/install.ps1 | iex',
89
- x: 540, y: 1145,
90
- fontSize: 20, fontFamily: 'Consolas', color: '#555555', align: 'center'
91
- })
92
-
93
- // 8. 使用方法(4个步骤)
94
- // 01 安装后输入 foliko chat
95
- // 02 支持多 AI:Anthropic / DeepSeek / OpenAI
96
- // 03 插件扩展:Shell / Python / MCP
97
- // 04 技能系统自定义工作流程
98
-
99
- // 9. 底部
100
- add_poster_text({ text: 'foliko.com', x: 540, y: 1750, fontSize: 20, color: '#999999', align: 'center' })
101
-
102
- // 10. 底部装饰
103
- add_poster_line({ x1: 80, y1: 1900, x2: 200, y2: 1900, stroke: '#8b7355', strokeWidth: 1 })
104
- add_poster_circle({ cx: 100, cy: 2050, rx: 80, ry: 80, fill: '#e5e2dc', opacity: 0.5 })
105
- add_poster_circle({ cx: 980, cy: 2000, rx: 120, ry: 120, fill: '#ebe8e2', opacity: 0.6 })
106
-
107
- // 11. 导出
108
- export_poster_canvas({ filename: 'foliko-muji-poster', format: 'png', outputDir: './output' })
109
- ```
110
-
111
- ## 风格特点
112
- - 大量留白,简约干净
113
- - 自然色系,低饱和度
114
- - 简洁线条装饰
115
- - 柔和的圆形元素
116
- - 层次分明的章节结构
@@ -1,52 +0,0 @@
1
- ---
2
- id: "mnrnvpwo-rcqv9m"
3
- name: "Foliko 代码优化分析报告"
4
- type: "reference"
5
- project: "foliko"
6
- tags: [代码分析, 安全漏洞, 性能优化, 最佳实践]
7
- created: "2026-04-09"
8
- ---
9
- # Foliko 代码优化分析报告
10
-
11
- ## 严重问题 (Critical)
12
-
13
- ### 1. VM2 沙箱逃逸风险
14
- - 位置: `src/utils/sandbox.js`
15
- - 问题: VM2 已停止维护,存在已知 CVE 漏洞
16
- - 方案: 替换为 Node.js 内置 vm 模块、isolated-vm 或 Worker Threads
17
-
18
- ### 2. EventEmitter 内存泄漏
19
- - 位置: `src/core/framework.js` 多处 `on()` 调用
20
- - 问题: 插件重载时产生重复监听器
21
- - 方案: 使用 `once()` 或存储引用后手动移除
22
-
23
- ### 3. 依赖安全问题
24
- - vm2, node-telegram-bot-api 版本过旧
25
- - 方案: 运行 `npm audit fix`
26
-
27
- ## 中等问题 (High)
28
-
29
- ### 4. 循环依赖
30
- - `agent-chat.js` ↔ `agent.js`
31
- - 方案: 使用依赖注入或延迟导入
32
-
33
- ### 5. 错误处理不一致
34
- - 部分错误被静默忽略
35
- - 方案: 统一使用 ErrorBoundary
36
-
37
- ### 6. 缺少输入验证
38
- - 方案: 使用 Zod 进行运行时验证
39
-
40
- ### 7. Token 计算不准确
41
- - 位置: `src/core/agent-chat.js` SimpleTokenizer
42
- - 问题: 中文/英文/代码比率差异大
43
- - 方案: 使用 TikToken 或区分内容类型
44
-
45
- ### 8. 敏感信息明文存储
46
- - 方案: 不保存 API keys 到 state 文件
47
-
48
- ## 如何应用
49
- - 开发新功能时避免引入这些问题
50
- - 重构时优先修复 P0/P1 问题
51
- - 代码审查时检查类似模式
52
- - 添加新依赖前检查安全漏洞
@@ -1,25 +0,0 @@
1
- ---
2
- id: "mnrovxvz-zy9xqm"
3
- name: "Foliko Agent 框架架构"
4
- type: "reference"
5
- project: "null"
6
- tags: [ai-agent, framework, nodejs, plugin-system, architecture]
7
- created: "2026-04-09"
8
- ---
9
- Foliko 是一个简约的插件化 Agent 框架 (v1.1.4, MIT)
10
-
11
- **Why 重要**:
12
- - 核心框架位于 src/,采用分层架构设计
13
- - 提供 39 个内置插件(邮件、交易、消息推送、记忆等)
14
- - 支持 MCP 协议、Ambient Agent、SubAgent 子代理
15
- - 内置 13 个技能定义指导 AI 行为
16
- - 工作流引擎支持复杂自动化流程
17
-
18
- **技术栈**:Node.js >= 18, Hono.js, Vercel AI SDK, Zod, 支持多 AI Provider (Anthropic, OpenAI, DeepSeek)
19
-
20
- **How to apply**:
21
- - 开发新插件:参考 plugins/ 目录结构,参考 SPEC.md 规格说明
22
- - 添加技能:在 skills/ 目录创建 .md 文件定义技能指南
23
- - 子 Agent:在 .agent/agents/ 创建配置文件
24
- - 扩展工具:在 src/core/tool-registry.js 注册新工具
25
- - 文档参考:docs/ 目录有用户手册和优化指南