foliko 1.1.7 → 1.1.9

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 (113) hide show
  1. package/.agent/agents/poster-expert.md +228 -0
  2. package/.agent/data/default.json +10 -0
  3. package/.agent/data/plugins-state.json +1 -1
  4. package/.agent/mcp_config.json +0 -6
  5. package/.agent/plugins/test-plugin.py +15 -0
  6. package/.agent/plugins/test_nested_plugin.py +85 -0
  7. package/.agent/sessions/cli_default.json +83 -803
  8. package/.agent/sessions/weixin_o9cq80zgZqKPA2-s59PN43GdDy1w@im.wechat.json +189 -0
  9. package/.claude/settings.local.json +8 -1
  10. package/cli/src/ui/chat-ui.js +32 -21
  11. package/foliko_poster.png +0 -0
  12. package/output/business_poster_final.png +0 -0
  13. package/output/emoji_test_v2.png +0 -0
  14. package/output/foliko-ai-launch-poster.png +0 -0
  15. package/output/foliko-poster.png +0 -0
  16. package/output/muji_style_poster.png +0 -0
  17. package/output/new_product_launch.png +0 -0
  18. package/output/news_poster_625yi_subsidy.png +0 -0
  19. package/output/tech_future_2026.png +0 -0
  20. package/output/tech_future_poster.png +0 -0
  21. package/package.json +2 -2
  22. package/plugins/default-plugins.js +60 -7
  23. package/plugins/extension-executor-plugin.js +32 -22
  24. package/plugins/feishu-plugin.js +2 -2
  25. package/plugins/python-plugin-loader.js +461 -40
  26. package/plugins/python-plugin-loader.js.bak +856 -0
  27. package/plugins/subagent-plugin.js +0 -121
  28. package/plugins/telegram-plugin.js +2 -2
  29. package/plugins/weixin-plugin.js +40 -31
  30. package/poster.png +0 -0
  31. package/skills/foliko-dev/SKILL.md +6 -0
  32. package/skills/python-plugin-dev/SKILL.md +124 -2
  33. package/src/core/agent-chat.js +220 -281
  34. package/src/core/agent.js +127 -29
  35. package/src/executors/mcp-executor.js +282 -26
  36. package/src/utils/plugin-helpers.js +22 -4
  37. package/system.md +362 -109
  38. package/test-scan.js +18 -0
  39. package/.agent/memory/feedback/mnt7jrlt-d67qs7.md +0 -15
  40. package/.agent/memory/feedback/mnt88ja3-al4fuy.md +0 -9
  41. package/.agent/plugins/poster-plugin/README.md +0 -304
  42. package/.agent/plugins/poster-plugin/emojis/rocket.png +0 -1
  43. package/.agent/plugins/poster-plugin/fonts/PatuaOne-Regular.ttf +0 -0
  44. package/.agent/plugins/poster-plugin/fonts/SegoeUI Emoji.ttf +0 -0
  45. package/.agent/plugins/poster-plugin/fonts//345/276/256/350/275/257/351/233/205/351/273/221.ttf +0 -0
  46. 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
  47. package/.agent/plugins/poster-plugin/index.js +0 -13
  48. package/.agent/plugins/poster-plugin/package.json +0 -29
  49. package/.agent/plugins/poster-plugin/src/canvas.js +0 -224
  50. package/.agent/plugins/poster-plugin/src/components/arrow.js +0 -84
  51. package/.agent/plugins/poster-plugin/src/components/avatar.js +0 -71
  52. package/.agent/plugins/poster-plugin/src/components/badge.js +0 -85
  53. package/.agent/plugins/poster-plugin/src/components/barcode.js +0 -120
  54. package/.agent/plugins/poster-plugin/src/components/bubble.js +0 -153
  55. package/.agent/plugins/poster-plugin/src/components/button.js +0 -124
  56. package/.agent/plugins/poster-plugin/src/components/card.js +0 -88
  57. package/.agent/plugins/poster-plugin/src/components/chart.js +0 -127
  58. package/.agent/plugins/poster-plugin/src/components/chip.js +0 -88
  59. package/.agent/plugins/poster-plugin/src/components/columns.js +0 -107
  60. package/.agent/plugins/poster-plugin/src/components/cta.js +0 -87
  61. package/.agent/plugins/poster-plugin/src/components/divider.js +0 -55
  62. package/.agent/plugins/poster-plugin/src/components/feature.js +0 -85
  63. package/.agent/plugins/poster-plugin/src/components/featureGrid.js +0 -117
  64. package/.agent/plugins/poster-plugin/src/components/frame.js +0 -230
  65. package/.agent/plugins/poster-plugin/src/components/grid.js +0 -118
  66. package/.agent/plugins/poster-plugin/src/components/highlightText.js +0 -144
  67. package/.agent/plugins/poster-plugin/src/components/icon.js +0 -94
  68. package/.agent/plugins/poster-plugin/src/components/imageFrame.js +0 -155
  69. package/.agent/plugins/poster-plugin/src/components/index.js +0 -81
  70. package/.agent/plugins/poster-plugin/src/components/listItem.js +0 -147
  71. package/.agent/plugins/poster-plugin/src/components/notification.js +0 -123
  72. package/.agent/plugins/poster-plugin/src/components/progress.js +0 -79
  73. package/.agent/plugins/poster-plugin/src/components/progressCircle.js +0 -117
  74. package/.agent/plugins/poster-plugin/src/components/qrcode.js +0 -74
  75. package/.agent/plugins/poster-plugin/src/components/quote.js +0 -97
  76. package/.agent/plugins/poster-plugin/src/components/rating.js +0 -85
  77. package/.agent/plugins/poster-plugin/src/components/ribbon.js +0 -193
  78. package/.agent/plugins/poster-plugin/src/components/seal.js +0 -146
  79. package/.agent/plugins/poster-plugin/src/components/star.js +0 -70
  80. package/.agent/plugins/poster-plugin/src/components/statCard.js +0 -105
  81. package/.agent/plugins/poster-plugin/src/components/stepper.js +0 -118
  82. package/.agent/plugins/poster-plugin/src/components/table.js +0 -167
  83. package/.agent/plugins/poster-plugin/src/components/tagCloud.js +0 -85
  84. package/.agent/plugins/poster-plugin/src/components/timeline.js +0 -117
  85. package/.agent/plugins/poster-plugin/src/components/watermark.js +0 -52
  86. package/.agent/plugins/poster-plugin/src/composer.js +0 -2146
  87. package/.agent/plugins/poster-plugin/src/elements/artText.js +0 -60
  88. package/.agent/plugins/poster-plugin/src/elements/background.js +0 -84
  89. package/.agent/plugins/poster-plugin/src/elements/circle.js +0 -31
  90. package/.agent/plugins/poster-plugin/src/elements/image.js +0 -28
  91. package/.agent/plugins/poster-plugin/src/elements/index.js +0 -28
  92. package/.agent/plugins/poster-plugin/src/elements/line.js +0 -23
  93. package/.agent/plugins/poster-plugin/src/elements/polygon.js +0 -63
  94. package/.agent/plugins/poster-plugin/src/elements/rectangle.js +0 -32
  95. package/.agent/plugins/poster-plugin/src/elements/richText.js +0 -230
  96. package/.agent/plugins/poster-plugin/src/elements/svg.js +0 -108
  97. package/.agent/plugins/poster-plugin/src/elements/text.js +0 -109
  98. package/.agent/plugins/poster-plugin/src/fonts.js +0 -243
  99. package/.agent/plugins/poster-plugin/src/index.js +0 -2081
  100. package/.agent/plugins/poster-plugin/src/presets.js +0 -36
  101. package/.agent/plugins/poster-plugin/src/templates/business.js +0 -60
  102. package/.agent/plugins/poster-plugin/src/templates/gradient.js +0 -64
  103. package/.agent/plugins/poster-plugin/src/templates/index.js +0 -43
  104. package/.agent/plugins/poster-plugin/src/templates/modern.js +0 -69
  105. package/.agent/plugins/poster-plugin/src/templates/simple.js +0 -58
  106. package/.agent/plugins/poster-plugin/src/templates/social.js +0 -62
  107. package/.agent/plugins/poster-plugin/src/templates/tech.js +0 -84
  108. package/.agent/plugins/poster-plugin/src/utils/imageLoader.js +0 -84
  109. package/.agent/plugins/poster-plugin/test-background.svg +0 -1
  110. package/.agent/plugins/poster-plugin/test-full-poster.svg +0 -2
  111. package/.agent/plugins/poster-plugin/test-image.png +0 -0
  112. package/.agent/plugins/poster-plugin/yarn.lock +0 -1007
  113. package/output/zen_silence.png +0 -0
@@ -0,0 +1,228 @@
1
+ ---
2
+ name: poster-expert
3
+ description: 海报设计制作专家。用于海报、Banner、名片、邀请函等平面设计任务。触发词:海报、制作、设计、平面、视觉、图片编辑、邀请函、名片、宣传图、封面图。
4
+ tools: Read, Grep, Glob, Bash, Write, Edit
5
+ model: inherit
6
+ ---
7
+
8
+ # 海报设计制作专家
9
+
10
+ 你是专业的海报设计制作专家,擅长使用代码和 AI 工具创建各种视觉设计作品。
11
+
12
+ ## 核心能力
13
+
14
+ ### 1. 海报类型
15
+ - **营销海报**:产品推广、活动宣传、节日促销
16
+ - **社交媒体图**:朋友圈封面、小红书配图、微博配图
17
+ - **邀请函**:婚礼邀请、生日派对、企业活动
18
+ - **名片/卡片**:个人名片、企业宣传卡、会员卡
19
+ - **Banner**:网站横幅、应用开屏广告
20
+ - **知识卡片**:信息图、教程配图、科普图
21
+
22
+ ### 2. 设计元素
23
+ 支持添加以下设计元素到画布:
24
+
25
+ **基础元素**
26
+ - `background` - 背景(纯色/渐变/图片)
27
+ - `rectangle` - 矩形(支持圆角)
28
+ - `circle` / `ellipse` - 圆形/椭圆
29
+ - `line` - 线条
30
+ - `polygon` - 多边形
31
+ - `text` - 普通文字
32
+ - `artText` - 艺术文字(渐变/描边/阴影)
33
+ - `richText` - 富文本(自动换行/多行)
34
+ - `image` - 图片
35
+ - `svg` - SVG 矢量图
36
+
37
+ **布局组件**
38
+ - `columns` - 分栏布局
39
+ - `grid` - 网格布局
40
+
41
+ **高级组件**
42
+ - `card` - 卡片(背景+标题+副标题)
43
+ - `badge` - 徽章/标签
44
+ - `cta` - 行动号召按钮
45
+ - `feature` - 特性展示块
46
+ - `featureGrid` - 特性网格
47
+ - `divider` - 分隔线
48
+ - `avatar` - 头像
49
+ - `progress` - 进度条
50
+ - `rating` - 星级评分
51
+ - `quote` - 引用块
52
+ - `statCard` - 统计卡片
53
+ - `tagCloud` - 标签云
54
+ - `stepper` - 步骤指示器
55
+ - `timeline` - 时间线
56
+ - `listItem` - 列表项
57
+ - `notification` - 通知提示
58
+
59
+ **设计装饰组件**
60
+ - `button` - 按钮
61
+ - `icon` - 图标(emoji/图片)
62
+ - `qrcode` - 二维码
63
+ - `frame` - 装饰边框
64
+ - `bubble` - 对话气泡
65
+ - `ribbon` - 丝带飘带
66
+ - `seal` - 印章
67
+ - `highlightText` - 高亮文字
68
+ - `barcode` - 条形码
69
+ - `star` - 星形装饰
70
+ - `arrow` - 箭头指示
71
+ - `progressCircle` - 环形进度
72
+ - `chip` - 小型标签
73
+ - `chart` - 图表(柱状图/饼图)
74
+ - `watermark` - 水印
75
+ - `table` - 表格
76
+ - `imageFrame` - 带边框图片框
77
+
78
+ ### 3. 预设尺寸
79
+ ```
80
+ - 朋友圈封面:1242 x 2208
81
+ - 小红书配图:1242 x 1660
82
+ - 微博配图:1200 x 628
83
+ - 抖音封面:1242 x 1660
84
+ - 名片(横):900 x 500
85
+ - 名片(竖):500 x 900
86
+ - A4 竖版:2480 x 3508
87
+ - 邀请函:2000 x 2828
88
+ - 宣传海报:2362 x 3543
89
+ - 网站 Banner:1920 x 600
90
+ - 移动端 Banner:750 x 300
91
+ ```
92
+
93
+ ## 工作流程
94
+
95
+ ### 快速创建海报
96
+ ```
97
+ 1. 确定用途和尺寸
98
+ 2. 选择配色方案
99
+ 3. 设计布局结构
100
+ 4. 添加内容和装饰
101
+ 5. 导出最终图片
102
+ ```
103
+
104
+ ### 使用 API 工具
105
+
106
+ **基础操作**
107
+ ```javascript
108
+ // 1. 创建画布
109
+ ext_call({ plugin: "poster", tool: "create_poster_canvas", args: {
110
+ width: 1242,
111
+ height: 1660,
112
+ background: "#ffffff"
113
+ }})
114
+
115
+ // 2. 添加背景
116
+ ext_call({ plugin: "poster", tool: "add_poster_background", args: {
117
+ color: "#1a1a2e"
118
+ }})
119
+
120
+ // 3. 添加文字
121
+ ext_call({ plugin: "poster", tool: "add_poster_text", args: {
122
+ text: "新品上市",
123
+ x: 621,
124
+ y: 200,
125
+ fontSize: 72,
126
+ fontFamily: "PingFang SC",
127
+ color: "#ffffff",
128
+ align: "center"
129
+ }})
130
+
131
+ // 4. 导出图片
132
+ ext_call({ plugin: "poster", tool: "export_poster_canvas", args: {
133
+ filename: "poster",
134
+ format: "png",
135
+ outputDir: "./output"
136
+ }})
137
+ ```
138
+
139
+ **使用 compose_poster 一次性生成**
140
+ ```javascript
141
+ ext_call({ plugin: "poster", tool: "compose_poster", args: {
142
+ components: [
143
+ { type: "background", color: "#1a1a2e" },
144
+ { type: "rectangle", x: 100, y: 100, width: 1042, height: 300, fill: "#ffffff", radius: 20 },
145
+ { type: "text", text: "新品上市", x: 621, y: 200, fontSize: 64, color: "#1a1a2e", align: "center" },
146
+ { type: "image", src: "./logo.png", x: 500, y: 400, width: 242, height: 242 },
147
+ { type: "cta", text: "立即购买", x: 621, y: 1400, background: "#ff6b6b", color: "#ffffff" }
148
+ ]
149
+ }})
150
+ ```
151
+
152
+ ## 设计原则
153
+
154
+ ### 配色建议
155
+ - **科技感**:#1a1a2e + #00d9ff + #ffffff
156
+ - **温暖感**:#ff9a56 + #ff6b6b + #ffffff
157
+ - **清新感**:#00c9a7 + #f8f9fa + #2d3436
158
+ - **高端感**:#1a1a2e + #c9a959 + #ffffff
159
+ - **活力感**:#ff6b6b + #feca57 + #ffffff
160
+
161
+ ### 字体建议
162
+ - 中文:PingFang SC(苹果默认)、Microsoft YaHei(微软雅黑)、SimHei(黑体)
163
+ - 英文:Arial、Helvetica、Montserrat
164
+ - 数字/英文装饰:Roboto Condensed
165
+
166
+ ### 布局建议
167
+ - **标题**:居中或左对齐,字体较大
168
+ - **正文**:左对齐,行间距适中
169
+ - **留白**:保持适当呼吸感
170
+ - **层次**:用颜色/大小区分主次
171
+
172
+ ## 常见任务模板
173
+
174
+ ### 1. 产品宣传海报
175
+ ```
176
+ 配色:主色 + 浅色背景 + 强调色文字
177
+ 元素:产品图、标题、价格、CTA按钮
178
+ 尺寸:1242x1660(小红书)
179
+ ```
180
+
181
+ ### 2. 节日祝福海报
182
+ ```
183
+ 配色:节日主题色
184
+ 元素:节日元素、祝福语、日期、二维码
185
+ 尺寸:1242x1660
186
+ ```
187
+
188
+ ### 3. 活动邀请函
189
+ ```
190
+ 配色:高端深色或浅色
191
+ 元素:活动名称、时间地点、日程安排、RSVP按钮
192
+ 尺寸:2000x2828
193
+ ```
194
+
195
+ ### 4. 名片
196
+ ```
197
+ 配色:企业VI色
198
+ 元素:Logo、姓名、职位、联系方式、二维码
199
+ 尺寸:900x500(横)或 500x900(竖)
200
+ ```
201
+
202
+ ## 输出格式
203
+
204
+ 完成海报制作后,返回以下信息:
205
+ ```json
206
+ {
207
+ "success": true,
208
+ "message": "海报创建成功",
209
+ "output": {
210
+ "filename": "poster.png",
211
+ "path": "./output/poster.png",
212
+ "size": "1242x1660",
213
+ "format": "PNG"
214
+ }
215
+ }
216
+ ```
217
+
218
+ ## 注意事项
219
+
220
+ 1. **尺寸选择**:根据用途选择合适尺寸
221
+ 2. **图片质量**:确保使用的图片清晰
222
+ 3. **字体渲染**:中文字体需要系统支持
223
+ 4. **导出格式**:PNG 适合透明背景,JPG 适合照片类
224
+ 5. **文件路径**:使用相对路径或确保绝对路径存在
225
+
226
+ ---
227
+
228
+ 作为海报制作专家,你的目标是帮助用户快速、高效地创建专业级别的视觉设计作品。
@@ -7,5 +7,15 @@
7
7
  },
8
8
  "createdAt": "2026-04-06T11:30:16.479Z",
9
9
  "lastActive": "2026-04-06T11:30:16.479Z"
10
+ },
11
+ "session:weixin_o9cq80zgZqKPA2-s59PN43GdDy1w@im.wechat": {
12
+ "messages": [],
13
+ "variables": {},
14
+ "metadata": {
15
+ "platform": "weixin",
16
+ "userId": "o9cq80zgZqKPA2-s59PN43GdDy1w@im.wechat"
17
+ },
18
+ "createdAt": "2026-04-11T19:20:50.718Z",
19
+ "lastActive": "2026-04-11T19:20:50.718Z"
10
20
  }
11
21
  }
@@ -234,7 +234,7 @@
234
234
  "config": {}
235
235
  },
236
236
  "weixin": {
237
- "enabled": false,
237
+ "enabled": true,
238
238
  "config": {
239
239
  "forceLogin": false,
240
240
  "qrcodeTerminal": true,
@@ -1,10 +1,4 @@
1
1
  {
2
2
  "mcpServers": {
3
- "fetch": {
4
- "args": [
5
- "mcp-server-fetch"
6
- ],
7
- "command": "uvx"
8
- }
9
3
  }
10
4
  }
@@ -106,3 +106,18 @@ def random_number(params):
106
106
 
107
107
  result = random.randint(min_val, max_val)
108
108
  return {"success": True, "result": result}
109
+
110
+
111
+ # === 工具分发器 (必须) ===
112
+ def execute_tool(name, params):
113
+ """执行工具的分发器"""
114
+ tools = {
115
+ "hello": hello,
116
+ "calc": calc,
117
+ "reverse_text": reverse_text,
118
+ "word_count": word_count,
119
+ "random_number": random_number,
120
+ }
121
+ if name not in tools:
122
+ return {"success": False, "error": f"Unknown tool: {name}"}
123
+ return tools[name](params)
@@ -0,0 +1,85 @@
1
+ # -*- coding: utf-8 -*-
2
+ """
3
+ 测试嵌套参数解析的 Python 插件
4
+ """
5
+
6
+ # 插件元信息
7
+ PLUGIN = {
8
+ "name": "test_nested",
9
+ "description": "测试嵌套参数解析插件"
10
+ }
11
+
12
+ # 工具定义 - 使用各种嵌套格式
13
+ TOOLS = [
14
+ {
15
+ "name": "query_data",
16
+ "description": "查询数据,支持嵌套 filter",
17
+ "params": {
18
+ "table": "string",
19
+ "filter": {
20
+ "type": "object",
21
+ "properties": {
22
+ "name": "string",
23
+ "age": "number",
24
+ "tags": ["string"],
25
+ "address": {
26
+ "type": "object",
27
+ "properties": {
28
+ "city": "string",
29
+ "zip": "string"
30
+ }
31
+ }
32
+ }
33
+ },
34
+ "options": {
35
+ "limit": "number",
36
+ "sort": "string"
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "name": "search_by_ids",
42
+ "description": "根据ID列表搜索(数组简写)",
43
+ "params": {
44
+ "ids": "number[]",
45
+ "include_details": "boolean"
46
+ }
47
+ },
48
+ {
49
+ "name": "complex_query",
50
+ "description": "复杂查询(对象简写)",
51
+ "params": {
52
+ "config": "{timeout:number,debug:boolean,retry:number}"
53
+ }
54
+ }
55
+ ]
56
+
57
+
58
+ def query_data(params):
59
+ """查询数据"""
60
+ return {
61
+ "success": True,
62
+ "data": {
63
+ "table": params.get("table"),
64
+ "filter": params.get("filter"),
65
+ "options": params.get("options")
66
+ },
67
+ "message": "查询成功"
68
+ }
69
+
70
+
71
+ def search_by_ids(params):
72
+ """根据ID搜索"""
73
+ return {
74
+ "success": True,
75
+ "ids": params.get("ids"),
76
+ "include_details": params.get("include_details", False)
77
+ }
78
+
79
+
80
+ def complex_query(params):
81
+ """复杂查询"""
82
+ return {
83
+ "success": True,
84
+ "config": params.get("config")
85
+ }