foliko 1.0.87 → 1.1.0
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/data/default.json +3 -108
- package/.agent/data/plugins-state.json +34 -1
- package/.agent/mcp_config.json +0 -1
- package/.agent/memory/core.md +1 -0
- package/.agent/memory/project/mnn93ogy-ypjn27.md +9 -0
- package/.agent/memory/project/mnn98fqy-5nhc1u.md +25 -0
- package/.agent/memory/user/mnm67t9m-x8rekk.md +9 -0
- package/.agent/memory/user/mnn5mmqh-w6aktx.md +11 -0
- package/.agent/memory/user/mnnbfhhn-dk1bd1.md +22 -0
- package/.agent/plugins/__pycache__/file_writer.cpython-312.pyc +0 -0
- package/.agent/plugins/poster-plugin/README.md +304 -0
- package/.agent/plugins/poster-plugin/fonts/PatuaOne-Regular.ttf +0 -0
- package/.agent/plugins/poster-plugin/fonts//345/276/256/350/275/257/351/233/205/351/273/221.ttf +0 -0
- package/.agent/plugins/poster-plugin/fonts//345/276/256/350/275/257/351/233/205/351/273/221/347/262/227/344/275/223.ttf +0 -0
- package/.agent/plugins/poster-plugin/index.js +13 -0
- package/.agent/plugins/poster-plugin/package.json +28 -0
- package/.agent/plugins/poster-plugin/src/canvas.js +161 -0
- package/.agent/plugins/poster-plugin/src/components/arrow.js +84 -0
- package/.agent/plugins/poster-plugin/src/components/avatar.js +71 -0
- package/.agent/plugins/poster-plugin/src/components/badge.js +85 -0
- package/.agent/plugins/poster-plugin/src/components/card.js +88 -0
- package/.agent/plugins/poster-plugin/src/components/chart.js +127 -0
- package/.agent/plugins/poster-plugin/src/components/chip.js +88 -0
- package/.agent/plugins/poster-plugin/src/components/columns.js +107 -0
- package/.agent/plugins/poster-plugin/src/components/cta.js +85 -0
- package/.agent/plugins/poster-plugin/src/components/divider.js +55 -0
- package/.agent/plugins/poster-plugin/src/components/feature.js +85 -0
- package/.agent/plugins/poster-plugin/src/components/featureGrid.js +112 -0
- package/.agent/plugins/poster-plugin/src/components/grid.js +118 -0
- package/.agent/plugins/poster-plugin/src/components/imageFrame.js +155 -0
- package/.agent/plugins/poster-plugin/src/components/index.js +62 -0
- package/.agent/plugins/poster-plugin/src/components/listItem.js +146 -0
- package/.agent/plugins/poster-plugin/src/components/notification.js +123 -0
- package/.agent/plugins/poster-plugin/src/components/progress.js +79 -0
- package/.agent/plugins/poster-plugin/src/components/progressCircle.js +117 -0
- package/.agent/plugins/poster-plugin/src/components/quote.js +97 -0
- package/.agent/plugins/poster-plugin/src/components/rating.js +85 -0
- package/.agent/plugins/poster-plugin/src/components/star.js +70 -0
- package/.agent/plugins/poster-plugin/src/components/statCard.js +105 -0
- package/.agent/plugins/poster-plugin/src/components/stepper.js +118 -0
- package/.agent/plugins/poster-plugin/src/components/table.js +159 -0
- package/.agent/plugins/poster-plugin/src/components/tagCloud.js +78 -0
- package/.agent/plugins/poster-plugin/src/components/timeline.js +105 -0
- package/.agent/plugins/poster-plugin/src/components/watermark.js +52 -0
- package/.agent/plugins/poster-plugin/src/composer.js +1904 -0
- package/.agent/plugins/poster-plugin/src/elements/artText.js +60 -0
- package/.agent/plugins/poster-plugin/src/elements/background.js +52 -0
- package/.agent/plugins/poster-plugin/src/elements/circle.js +31 -0
- package/.agent/plugins/poster-plugin/src/elements/image.js +71 -0
- package/.agent/plugins/poster-plugin/src/elements/index.js +26 -0
- package/.agent/plugins/poster-plugin/src/elements/line.js +23 -0
- package/.agent/plugins/poster-plugin/src/elements/polygon.js +32 -0
- package/.agent/plugins/poster-plugin/src/elements/rectangle.js +32 -0
- package/.agent/plugins/poster-plugin/src/elements/svg.js +92 -0
- package/.agent/plugins/poster-plugin/src/elements/text.js +38 -0
- package/.agent/plugins/poster-plugin/src/fonts.js +118 -0
- package/.agent/plugins/poster-plugin/src/index.js +1659 -0
- package/.agent/plugins/poster-plugin/src/presets.js +36 -0
- package/.agent/plugins/poster-plugin/src/templates/business.js +60 -0
- package/.agent/plugins/poster-plugin/src/templates/gradient.js +64 -0
- package/.agent/plugins/poster-plugin/src/templates/index.js +43 -0
- package/.agent/plugins/poster-plugin/src/templates/modern.js +69 -0
- package/.agent/plugins/poster-plugin/src/templates/simple.js +58 -0
- package/.agent/plugins/poster-plugin/src/templates/social.js +62 -0
- package/.agent/plugins/poster-plugin/src/templates/tech.js +84 -0
- package/.agent/sessions/cli_default.json +24265 -0
- package/.agent/weixin.json +6 -0
- package/.claude/settings.local.json +5 -8
- package/CLAUDE.md +144 -108
- package/docs/CONTEXT_DESIGN.md +1596 -0
- package/examples/test-concurrent-chat.js +60 -60
- package/output/beef-love-poster.png +0 -0
- package/package.json +2 -2
- package/plugins/default-plugins.js +2 -1
- package/plugins/extension-executor-plugin.js +11 -0
- package/plugins/memory-plugin.js +984 -0
- package/plugins/session-plugin.js +57 -1
- package/plugins/weixin-plugin.js +24 -22
- package/skills/poster-guide/SKILL.md +743 -0
- package/skills/python-plugin-dev/SKILL.md +238 -238
- package/skills/skill-guide/SKILL.md +130 -108
- package/src/capabilities/skill-manager.js +99 -0
- package/src/core/agent-chat.js +538 -138
- package/src/core/agent-context.js +188 -0
- package/src/core/agent.js +6 -2
- package/src/core/context-manager.js +283 -0
- package/src/core/framework.js +264 -3
- package/src/core/plugin-manager.js +79 -2
- package/src/core/request-context.js +98 -0
- package/src/core/session-context.js +341 -0
- package/src/core/session-storage.js +274 -0
- package/src/executors/mcp-executor.js +2 -2
- package/src/utils/index.js +239 -67
- package/src/utils/plugin-helpers.js +17 -0
- package//346/265/267/346/212/245/346/217/222/344/273/266.md +621 -0
- package/.agent/plugins/__pycache__/test_plugin.cpython-312.pyc +0 -0
- package/.agent/plugins/temp-repo/LICENSE +0 -201
- package/.agent/plugins/temp-repo/puppeteer-plugin/README.md +0 -147
- package/.agent/plugins/temp-repo/puppeteer-plugin/index.js +0 -1418
- package/.agent/plugins/temp-repo/puppeteer-plugin/package.json +0 -9
- package/.agent/plugins/test_plugin.py +0 -304
- package/examples/test-chat-debug.js +0 -102
- package/examples/test-chat-result.js +0 -76
- package/examples/test-chat-stream-diff.js +0 -63
package/.agent/data/default.json
CHANGED
|
@@ -1,116 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"session:cli_default": {
|
|
3
|
-
"messages": [
|
|
4
|
-
{
|
|
5
|
-
"role": "user",
|
|
6
|
-
"content": "你号"
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
"role": "assistant",
|
|
10
|
-
"content": [
|
|
11
|
-
{
|
|
12
|
-
"type": "text",
|
|
13
|
-
"text": "<think>\n用户说\"你号\",这看起来像是一个打招呼或者问候的简短表达,可能是\"你好\"的打字错误或者网络用语。我应该友好地回应。\n</think>\n\n你好!有什么可以帮你的吗?"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"role": "user",
|
|
19
|
-
"content": "今天星期几?"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"role": "assistant",
|
|
23
|
-
"content": [
|
|
24
|
-
{
|
|
25
|
-
"type": "text",
|
|
26
|
-
"text": "<think>\n用户问今天星期几,我需要获取当前时间。\n</think>\n\n\n"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"role": "user",
|
|
32
|
-
"content": "有什么好玩的"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"role": "assistant",
|
|
36
|
-
"content": [
|
|
37
|
-
{
|
|
38
|
-
"type": "text",
|
|
39
|
-
"text": "<think>\n用户问有什么好玩的,但没有具体说明想要什么类型的好玩内容。我可以先获取当前时间来了解更多信息,然后根据情况给出建议。\n</think>\n\n\n"
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"role": "user",
|
|
45
|
-
"content": "你好啊"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"role": "assistant",
|
|
49
|
-
"content": [
|
|
50
|
-
{
|
|
51
|
-
"type": "text",
|
|
52
|
-
"text": "<think>\n用户只是打了个招呼\"你好啊\",我简单回应一下就好,不需要调用工具。\n</think>\n\n你好啊!👋\n\n有什么我可以帮你的吗?比如:\n\n- 💻 **代码问题** - 帮你写代码、调试、解释代码\n- 📁 **文件操作** - 读写文件、管理项目\n- 🔧 **系统操作** - 查询系统信息、执行命令\n- 🌐 **网页浏览** - 访问网页、抓取内容\n- 📦 **插件管理** - 安装和管理插件\n- ⏰ **定时任务** - 设置提醒和定时任务\n- 💬 **其他问题** - 聊天、问答等\n\n随便聊聊也行~ 😄"
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"role": "user",
|
|
58
|
-
"content": "查看插件列表"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"role": "assistant",
|
|
62
|
-
"content": [
|
|
63
|
-
{
|
|
64
|
-
"type": "text",
|
|
65
|
-
"text": "<think>\n用户想查看插件列表,我应该调用 list_plugins 工具来列出所有可用的插件。\n</think>\n\n\n"
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"role": "user",
|
|
71
|
-
"content": "你好啊"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"role": "assistant",
|
|
75
|
-
"content": [
|
|
76
|
-
{
|
|
77
|
-
"type": "text",
|
|
78
|
-
"text": "<think>\n用户又打招呼了,我应该简单友好地回复。\n</think>\n\n你好!😊 有什么需要帮忙的吗?\n\n刚才查看了插件列表,你是想安装新插件还是想了解某个插件的使用方法?"
|
|
79
|
-
}
|
|
80
|
-
]
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
"role": "user",
|
|
84
|
-
"content": "嗯"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
"role": "assistant",
|
|
88
|
-
"content": [
|
|
89
|
-
{
|
|
90
|
-
"type": "text",
|
|
91
|
-
"text": "<think>\n用户只是简单回复\"嗯\",我需要引导用户明确需求,或者主动提供一些选项。\n</think>\n\n好的~ 给你几个常用选项参考:\n\n| 操作 | 说明 |\n|------|------|\n| 📦 安装插件 | 从远程仓库安装新插件 |\n| 🔍 搜索技能 | 查找可能对你有帮助的技能 |\n| ⚙️ 查看已装插件 | 查看当前已安装的插件列表 |\n| 🔧 插件管理 | 启用/禁用/重载插件 |\n\n想试试哪个?或者直接告诉我你想做什么也行 😄"
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
"role": "user",
|
|
97
|
-
"content": "下一条"
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
"role": "assistant",
|
|
101
|
-
"content": [
|
|
102
|
-
{
|
|
103
|
-
"type": "text",
|
|
104
|
-
"text": "<think>\n用户说\"下一条\",这可能是指下一条消息或者下一个话题。我不确定用户的具体意思,可能是:\n1. 想要看其他东西\n2. 想要换个话题\n3. 想要我推荐什么\n\n我应该简单回复,询问用户具体想要什么。\n</think>\n\n好的~ 你是想:\n\n1. 🔍 **查看其他内容** - 比如查看系统信息、文件目录等\n2. 💬 **换个话题聊**\n3. 🚀 **开始做点什么** - 比如写代码、处理文件等\n\n告诉我你想做什么?或者直接说说你想了解什么 😄"
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
],
|
|
3
|
+
"messages": [],
|
|
109
4
|
"variables": {},
|
|
110
5
|
"metadata": {
|
|
111
6
|
"platform": "cli"
|
|
112
7
|
},
|
|
113
|
-
"createdAt": "2026-04-
|
|
114
|
-
"lastActive": "2026-04-
|
|
8
|
+
"createdAt": "2026-04-06T11:30:16.479Z",
|
|
9
|
+
"lastActive": "2026-04-06T11:30:16.479Z"
|
|
115
10
|
}
|
|
116
11
|
}
|
|
@@ -182,7 +182,10 @@
|
|
|
182
182
|
"maxHistoryLength": 150,
|
|
183
183
|
"autoCleanup": true,
|
|
184
184
|
"cleanupInterval": 300000,
|
|
185
|
-
"persistToStorage": true
|
|
185
|
+
"persistToStorage": true,
|
|
186
|
+
"onSessionStart": null,
|
|
187
|
+
"onSessionEnd": null,
|
|
188
|
+
"onSessionCreated": null
|
|
186
189
|
}
|
|
187
190
|
},
|
|
188
191
|
"shell-executor": {
|
|
@@ -252,5 +255,35 @@
|
|
|
252
255
|
"marknative": {
|
|
253
256
|
"enabled": true,
|
|
254
257
|
"config": {}
|
|
258
|
+
},
|
|
259
|
+
"poster-designer": {
|
|
260
|
+
"enabled": true,
|
|
261
|
+
"config": {}
|
|
262
|
+
},
|
|
263
|
+
"memory": {
|
|
264
|
+
"enabled": true,
|
|
265
|
+
"config": {
|
|
266
|
+
"memoryDir": ".agent/memory",
|
|
267
|
+
"autoExtract": true,
|
|
268
|
+
"extractOnTopics": [
|
|
269
|
+
"provider",
|
|
270
|
+
"preference",
|
|
271
|
+
"setting",
|
|
272
|
+
"user"
|
|
273
|
+
],
|
|
274
|
+
"maxCoreMemory": 4000
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"session-memory": {
|
|
278
|
+
"enabled": true,
|
|
279
|
+
"config": {
|
|
280
|
+
"memoryDir": ".agent/memory",
|
|
281
|
+
"maxCoreMemory": 4000,
|
|
282
|
+
"maxRecallResults": 5
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
"poster": {
|
|
286
|
+
"enabled": true,
|
|
287
|
+
"config": {}
|
|
255
288
|
}
|
|
256
289
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
测试数据 - 姓名: 李四, 职业: 工程师, 城市: 北京, 兴趣: 编程
|
|
@@ -0,0 +1,9 @@
|
|
|
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 四种模板样式。这表明用户在为项目选择合适的视觉设计风格。后续可以使用此记忆来理解用户的设计偏好,或在类似项目中提供风格建议。
|
|
@@ -0,0 +1,25 @@
|
|
|
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**: 在后续海报生成中,应优先使用深色背景、渐变品牌色、科技感装饰元素,聚焦核心功能展示,保持简洁有力的视觉层次。
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: "mnnbfhhn-dk1bd1"
|
|
3
|
+
name: "何建成"
|
|
4
|
+
type: "user"
|
|
5
|
+
project: "null"
|
|
6
|
+
tags: []
|
|
7
|
+
created: "2026-04-06"
|
|
8
|
+
---
|
|
9
|
+
用户姓名:何建成
|
|
10
|
+
|
|
11
|
+
项目:Foliko - 简约的插件化 Agent 框架
|
|
12
|
+
工作目录:D:\Code\vb-agent
|
|
13
|
+
|
|
14
|
+
已发布插件:poster-plugin
|
|
15
|
+
|
|
16
|
+
创建的海报:
|
|
17
|
+
- foliko-poster.png (1080x1080)
|
|
18
|
+
- foliko-twitter-cover.png (1500x500)
|
|
19
|
+
- foliko-instagram-story.png (1080x1920)
|
|
20
|
+
- foliko-japanese-minimal.png (1080x1350)
|
|
21
|
+
- zen-card-japanese.png (800x1100)
|
|
22
|
+
- foliko-final-poster.png
|
|
Binary file
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
# Poster Plugin - 海报制作插件
|
|
2
|
+
|
|
3
|
+
基于 Paper.js 的海报/Banner 设计插件,支持**组件化**海报生成。
|
|
4
|
+
|
|
5
|
+
## 功能特性
|
|
6
|
+
|
|
7
|
+
- **预设尺寸**:20+ 常用尺寸(海报、Banner、社交媒体)
|
|
8
|
+
- **基础元素**:矩形、圆形、线条、多边形、图片、文字、艺术文字、图片框
|
|
9
|
+
- **布局组件**:分栏布局、网格布局
|
|
10
|
+
- **装饰组件**:星形、箭头、环形进度条、标签、图表、水印、表格
|
|
11
|
+
- **高级组件**:卡片、徽章、CTA按钮、特性展示、特性网格、分隔线、头像、进度条、评分、引用、统计卡、标签云、步骤条、时间线、列表项、通知
|
|
12
|
+
- **组件化生成**:通过 JSON 配置一次性生成完整海报
|
|
13
|
+
- **模板系统**:modern、business、social、simple、tech、gradient 六种预设模板
|
|
14
|
+
|
|
15
|
+
## 工具列表(共 35 个组件)
|
|
16
|
+
|
|
17
|
+
### 画布管理
|
|
18
|
+
| 工具 | 描述 |
|
|
19
|
+
|------|------|
|
|
20
|
+
| `list_poster_presets` | 列出所有预设尺寸 |
|
|
21
|
+
| `create_poster_canvas` | 创建新画布 |
|
|
22
|
+
| `get_poster_canvas_info` | 获取画布信息 |
|
|
23
|
+
| `clear_poster_canvas` | 清除画布 |
|
|
24
|
+
| `export_poster_canvas` | 导出为 PNG 文件 |
|
|
25
|
+
| `export_poster_svg` | 导出为 SVG 矢量图 |
|
|
26
|
+
| `export_poster_base64` | 导出为 Base64 |
|
|
27
|
+
|
|
28
|
+
### 基础元素 (10)
|
|
29
|
+
| 工具 | 描述 |
|
|
30
|
+
|------|------|
|
|
31
|
+
| `add_poster_background` | 添加纯色/渐变背景 |
|
|
32
|
+
| `add_poster_rectangle` | 添加矩形 |
|
|
33
|
+
| `add_poster_circle` | 添加圆形/椭圆 |
|
|
34
|
+
| `add_poster_line` | 添加线条 |
|
|
35
|
+
| `add_poster_polygon` | 添加多边形 |
|
|
36
|
+
| `add_poster_text` | 添加文字 |
|
|
37
|
+
| `add_poster_art_text` | 添加艺术文字(渐变/描边) |
|
|
38
|
+
| `add_poster_image` | 添加图片 |
|
|
39
|
+
| `add_poster_svg` | 添加 SVG 矢量图 |
|
|
40
|
+
| `add_poster_image_frame` | 添加图片框(带装饰边框) |
|
|
41
|
+
|
|
42
|
+
### 布局组件 (2)
|
|
43
|
+
| 工具 | 描述 |
|
|
44
|
+
|------|------|
|
|
45
|
+
| `add_poster_columns` | 分栏布局(左右分栏、多栏) |
|
|
46
|
+
| `add_poster_grid` | 网格布局(任意行列) |
|
|
47
|
+
|
|
48
|
+
### 装饰组件 (7)
|
|
49
|
+
| 工具 | 描述 |
|
|
50
|
+
|------|------|
|
|
51
|
+
| `add_poster_star` | 星形/多角形装饰 |
|
|
52
|
+
| `add_poster_arrow` | 箭头指示 |
|
|
53
|
+
| `add_poster_progress_circle` | 环形进度条 |
|
|
54
|
+
| `add_poster_chip` | 小型标签 |
|
|
55
|
+
| `add_poster_chart` | 图表(柱状图、饼图) |
|
|
56
|
+
| `add_poster_watermark` | 水印文字 |
|
|
57
|
+
| `add_poster_table` | 数据表格 |
|
|
58
|
+
|
|
59
|
+
### 高级组件 (16)
|
|
60
|
+
| 工具 | 描述 |
|
|
61
|
+
|------|------|
|
|
62
|
+
| `add_poster_card` | 卡片组件 |
|
|
63
|
+
| `add_poster_badge` | 徽章/标签 |
|
|
64
|
+
| `add_poster_cta` | CTA 行动号召按钮 |
|
|
65
|
+
| `add_poster_feature` | 特性展示块 |
|
|
66
|
+
| `add_poster_feature_grid` | 特性网格布局 |
|
|
67
|
+
| `add_poster_divider` | 分隔线 |
|
|
68
|
+
| `add_poster_avatar` | 用户头像 |
|
|
69
|
+
| `add_poster_progress` | 线性进度条 |
|
|
70
|
+
| `add_poster_rating` | 星级评分 |
|
|
71
|
+
| `add_poster_quote` | 引用块 |
|
|
72
|
+
| `add_poster_stat_card` | 统计卡片 |
|
|
73
|
+
| `add_poster_tag_cloud` | 标签云 |
|
|
74
|
+
| `add_poster_stepper` | 步骤指示器 |
|
|
75
|
+
| `add_poster_timeline` | 时间线 |
|
|
76
|
+
| `add_poster_list_item` | 列表项 |
|
|
77
|
+
| `add_poster_notification` | 通知提示 |
|
|
78
|
+
|
|
79
|
+
### 组件化生成 & 模板
|
|
80
|
+
| 工具 | 描述 |
|
|
81
|
+
|------|------|
|
|
82
|
+
| `compose_poster` | 使用组件配置生成海报 |
|
|
83
|
+
| `list_poster_components` | 列出可用组件类型 |
|
|
84
|
+
| `generate_poster` | 一键生成海报(6种模板) |
|
|
85
|
+
| `list_poster_templates` | 列出可用模板 |
|
|
86
|
+
|
|
87
|
+
## 预设尺寸
|
|
88
|
+
|
|
89
|
+
| Key | 尺寸 | 名称 |
|
|
90
|
+
|-----|------|------|
|
|
91
|
+
| `poster_a4` | 2480×3508 | A4海报 (300dpi) |
|
|
92
|
+
| `poster_square` | 2000×2000 | 方形海报 |
|
|
93
|
+
| `poster_16_9` | 1920×1080 | 16:9海报 |
|
|
94
|
+
| `poster_9_16` | 1080×1920 | 9:16竖版海报 |
|
|
95
|
+
| `banner_1920x500` | 1920×500 | 网站Banner |
|
|
96
|
+
| `banner_twitter` | 1500×500 | Twitter封面 |
|
|
97
|
+
| `social_instagram` | 1080×1080 | Instagram正方形 |
|
|
98
|
+
| `social_story` | 1080×1920 | Instagram Story |
|
|
99
|
+
| `social_facebook` | 1200×630 | Facebook封面 |
|
|
100
|
+
| `social_linkedin` | 1200×627 | LinkedIn封面 |
|
|
101
|
+
| `social_youtube` | 2560×1440 | YouTube封面 |
|
|
102
|
+
|
|
103
|
+
## 使用示例
|
|
104
|
+
|
|
105
|
+
### 1. 组件化生成(推荐)
|
|
106
|
+
|
|
107
|
+
```javascript
|
|
108
|
+
compose_poster({
|
|
109
|
+
components: [
|
|
110
|
+
// 背景
|
|
111
|
+
{ type: 'background', color: '#1a1a2e' },
|
|
112
|
+
|
|
113
|
+
// 装饰圆形
|
|
114
|
+
{ type: 'circle', cx: 1600, cy: 200, rx: 200, fill: '#00d9ff', opacity: 0.3 },
|
|
115
|
+
|
|
116
|
+
// 星形装饰
|
|
117
|
+
{ type: 'star', cx: 200, cy: 200, points: 5, outerRadius: 60, fill: '#fbbf24' },
|
|
118
|
+
|
|
119
|
+
// 主标题
|
|
120
|
+
{ type: 'artText', text: 'VB-Agent', x: 960, y: 400, fontSize: 120,
|
|
121
|
+
gradient: { colors: ['#00d9ff', '#00ff88'] } },
|
|
122
|
+
|
|
123
|
+
// 环形进度条
|
|
124
|
+
{ type: 'progressCircle', cx: 400, cy: 600, radius: 80, value: 85,
|
|
125
|
+
strokeWidth: 15, fillColor: '#3b82f6', showLabel: true },
|
|
126
|
+
{ type: 'progressCircle', cx: 700, cy: 600, radius: 80, value: 92,
|
|
127
|
+
strokeWidth: 15, fillColor: '#10b981', showLabel: true },
|
|
128
|
+
|
|
129
|
+
// 图表
|
|
130
|
+
{ type: 'chart', type: 'bar', x: 1100, y: 450, width: 400, height: 250,
|
|
131
|
+
data: [
|
|
132
|
+
{ label: '一月', value: 120, color: '#3b82f6' },
|
|
133
|
+
{ label: '二月', value: 90, color: '#10b981' },
|
|
134
|
+
{ label: '三月', value: 150, color: '#f59e0b' }
|
|
135
|
+
],
|
|
136
|
+
showLabels: true, showValues: true },
|
|
137
|
+
|
|
138
|
+
// 数据表格
|
|
139
|
+
{ type: 'table', x: 100, y: 700, width: 800,
|
|
140
|
+
columns: [
|
|
141
|
+
{ title: '功能', width: 300, align: 'left' },
|
|
142
|
+
{ title: '状态', width: 200 },
|
|
143
|
+
{ title: '价格', width: 150 }
|
|
144
|
+
],
|
|
145
|
+
rows: [
|
|
146
|
+
['智能对话', '可用', '免费'],
|
|
147
|
+
['图片生成', '可用', '$29'],
|
|
148
|
+
['代码助手', 'Beta', '免费']
|
|
149
|
+
],
|
|
150
|
+
headerBg: '#1e293b', headerColor: '#ffffff', striped: true },
|
|
151
|
+
|
|
152
|
+
// 标签
|
|
153
|
+
{ type: 'chip', x: 400, y: 850, text: 'AI驱动', background: '#3b82f6', color: '#ffffff' },
|
|
154
|
+
{ type: 'chip', x: 550, y: 850, text: '开源', background: '#10b981', color: '#ffffff' },
|
|
155
|
+
|
|
156
|
+
// 水印
|
|
157
|
+
{ type: 'watermark', text: 'VB-Agent', cx: 960, cy: 1000, fontSize: 200,
|
|
158
|
+
color: 'rgba(255,255,255,0.03)', rotation: -15 },
|
|
159
|
+
|
|
160
|
+
// CTA 按钮
|
|
161
|
+
{ type: 'cta', x: 960, y: 950, text: '立即体验 →',
|
|
162
|
+
background: '#00d9ff', color: '#0a0a0f', fontSize: 24, radius: 30 }
|
|
163
|
+
]
|
|
164
|
+
})
|
|
165
|
+
export_poster_canvas({ filename: 'my-poster', outputDir: '.' })
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 2. 基础使用
|
|
169
|
+
|
|
170
|
+
```javascript
|
|
171
|
+
// 创建画布
|
|
172
|
+
create_poster_canvas({ preset: 'poster_square', background: '#1a1a2e' })
|
|
173
|
+
|
|
174
|
+
// 添加元素
|
|
175
|
+
add_poster_circle({ cx: 500, cy: 500, rx: 100, fill: '#00d9ff' })
|
|
176
|
+
add_poster_text({ text: 'Hello Foliko', x: 500, y: 600, fontSize: 48, color: '#ffffff', align: 'center' })
|
|
177
|
+
|
|
178
|
+
// 导出
|
|
179
|
+
export_poster_canvas({ filename: 'my-poster' })
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## 新增组件详解
|
|
183
|
+
|
|
184
|
+
### 星形 (star)
|
|
185
|
+
```javascript
|
|
186
|
+
add_poster_star({
|
|
187
|
+
cx: 200, cy: 200, // 中心坐标
|
|
188
|
+
points: 5, // 星形点数
|
|
189
|
+
outerRadius: 60, // 外半径
|
|
190
|
+
fill: '#fbbf24', // 填充颜色
|
|
191
|
+
rotation: 0 // 旋转角度
|
|
192
|
+
})
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 环形进度条 (progressCircle)
|
|
196
|
+
```javascript
|
|
197
|
+
add_poster_progress_circle({
|
|
198
|
+
cx: 200, cy: 200, // 圆心坐标
|
|
199
|
+
radius: 80, // 圆环半径
|
|
200
|
+
value: 75, // 进度值 0-100
|
|
201
|
+
strokeWidth: 15, // 环宽度
|
|
202
|
+
trackColor: '#e5e7eb', // 轨道颜色
|
|
203
|
+
fillColor: '#3b82f6', // 进度颜色
|
|
204
|
+
backgroundColor: '#ffffff', // 背景填充
|
|
205
|
+
showLabel: true // 显示百分比
|
|
206
|
+
})
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### 图表 (chart)
|
|
210
|
+
```javascript
|
|
211
|
+
// 柱状图
|
|
212
|
+
add_poster_chart({
|
|
213
|
+
type: 'bar', // bar 或 pie
|
|
214
|
+
x: 100, y: 300,
|
|
215
|
+
width: 500, height: 250,
|
|
216
|
+
data: [
|
|
217
|
+
{ label: '一月', value: 120, color: '#3b82f6' },
|
|
218
|
+
{ label: '二月', value: 90, color: '#10b981' }
|
|
219
|
+
],
|
|
220
|
+
showLabels: true,
|
|
221
|
+
showValues: true
|
|
222
|
+
})
|
|
223
|
+
|
|
224
|
+
// 饼图
|
|
225
|
+
add_poster_chart({
|
|
226
|
+
type: 'pie',
|
|
227
|
+
x: 700, y: 300,
|
|
228
|
+
width: 250, height: 250,
|
|
229
|
+
data: [
|
|
230
|
+
{ label: 'A', value: 45, color: '#3b82f6' },
|
|
231
|
+
{ label: 'B', value: 35, color: '#10b981' },
|
|
232
|
+
{ label: 'C', value: 20, color: '#f59e0b' }
|
|
233
|
+
],
|
|
234
|
+
showLabels: true
|
|
235
|
+
})
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 表格 (table)
|
|
239
|
+
```javascript
|
|
240
|
+
add_poster_table({
|
|
241
|
+
x: 100, y: 400,
|
|
242
|
+
width: 800,
|
|
243
|
+
columns: [
|
|
244
|
+
{ title: '功能', width: 300, align: 'left' },
|
|
245
|
+
{ title: '状态', width: 200 }
|
|
246
|
+
],
|
|
247
|
+
rows: [
|
|
248
|
+
['智能对话', '可用'],
|
|
249
|
+
['代码助手', 'Beta']
|
|
250
|
+
],
|
|
251
|
+
headerBg: '#1e293b',
|
|
252
|
+
headerColor: '#ffffff',
|
|
253
|
+
striped: true
|
|
254
|
+
})
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### 标签 (chip)
|
|
258
|
+
```javascript
|
|
259
|
+
add_poster_chip({
|
|
260
|
+
x: 200, y: 300,
|
|
261
|
+
text: 'NEW', // 标签文字
|
|
262
|
+
background: '#ef4444', // 背景色
|
|
263
|
+
color: '#ffffff', // 文字颜色
|
|
264
|
+
fontSize: 14,
|
|
265
|
+
radius: 16, // 圆角
|
|
266
|
+
icon: '⭐' // 前置图标(可选)
|
|
267
|
+
})
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
## 项目结构
|
|
271
|
+
|
|
272
|
+
```
|
|
273
|
+
poster-plugin/
|
|
274
|
+
├── index.js # 插件入口
|
|
275
|
+
├── package.json # 包配置
|
|
276
|
+
├── README.md # 文档
|
|
277
|
+
├── src/
|
|
278
|
+
│ ├── index.js # 主模块
|
|
279
|
+
│ ├── canvas.js # 画布管理器
|
|
280
|
+
│ ├── presets.js # 预设尺寸
|
|
281
|
+
│ ├── fonts.js # 字体管理
|
|
282
|
+
│ ├── composer.js # 组件化生成器
|
|
283
|
+
│ ├── elements/ # 基础元素
|
|
284
|
+
│ ├── components/ # 高级组件
|
|
285
|
+
│ └── templates/ # 模板
|
|
286
|
+
└── fonts/ # 字体文件
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
## 更新日志
|
|
290
|
+
|
|
291
|
+
### v1.2.0
|
|
292
|
+
- 新增布局组件:columns(分栏)、grid(网格)
|
|
293
|
+
- 新增装饰组件:star(星形)、arrow(箭头)、progressCircle(环形进度条)
|
|
294
|
+
- 新增 chip(标签)、chart(图表)、watermark(水印)、table(表格)
|
|
295
|
+
- 新增 imageFrame(图片框)
|
|
296
|
+
- 组件总数达到 **35 个**
|
|
297
|
+
- 模板新增 tech(科技)、gradient(渐变)
|
|
298
|
+
- 修复环形进度条绘制逻辑
|
|
299
|
+
|
|
300
|
+
### v1.1.0
|
|
301
|
+
- 重构为模块化架构
|
|
302
|
+
- 新增组件化海报生成(compose_poster)
|
|
303
|
+
- 新增高级组件:card, badge, cta, feature, featureGrid, divider
|
|
304
|
+
- 新增组件:avatar, progress, rating, quote, statCard, tagCloud, stepper, timeline, listItem, notification
|
|
Binary file
|
package/.agent/plugins/poster-plugin/fonts//345/276/256/350/275/257/351/233/205/351/273/221.ttf
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Poster Plugin - 海报制作插件
|
|
3
|
+
*
|
|
4
|
+
* 模块化架构,支持组件化海报生成
|
|
5
|
+
*
|
|
6
|
+
* 使用方法:
|
|
7
|
+
* 1. 基础元素:add_poster_rectangle, add_poster_circle, add_poster_text 等
|
|
8
|
+
* 2. 高级组件:add_poster_card, add_poster_badge, add_poster_cta 等
|
|
9
|
+
* 3. 组件化生成:compose_poster - 通过配置 JSON 一次性生成海报
|
|
10
|
+
* 4. 模板生成:generate_poster - 一键使用预设模板
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
module.exports = require('./src/index.js')
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "poster-plugin",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"description": "海报/Banner 设计插件 - 基于 Paper.js 实现,支持 35 个组件",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"canvas": "^3.2.0",
|
|
8
|
+
"fontkit": "^2.0.4",
|
|
9
|
+
"jsdom": "^16.2.2",
|
|
10
|
+
"paper": "^0.12.18"
|
|
11
|
+
},
|
|
12
|
+
"overrides": {
|
|
13
|
+
"canvas": "^3.2.0"
|
|
14
|
+
},
|
|
15
|
+
"resolutions": {
|
|
16
|
+
"**/canvas": "^3.2.0"
|
|
17
|
+
},
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "MIT",
|
|
20
|
+
"keywords": [
|
|
21
|
+
"poster",
|
|
22
|
+
"banner",
|
|
23
|
+
"design",
|
|
24
|
+
"canvas",
|
|
25
|
+
"paper.js",
|
|
26
|
+
"foliko"
|
|
27
|
+
]
|
|
28
|
+
}
|