foliko 1.1.3 → 1.1.5

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 (62) hide show
  1. package/.agent/memory/feedback/mnrdq5ps-ekch6c.md +9 -0
  2. package/.agent/memory/feedback/mnrdvj5i-ca3dkd.md +9 -0
  3. package/.agent/memory/feedback/mnre365e-7s4zax.md +9 -0
  4. package/.agent/memory/feedback/mnre36jn-nkfgmp.md +9 -0
  5. package/.agent/memory/feedback/mnre3805-kjiq6h.md +9 -0
  6. package/.agent/memory/feedback/test-1775733060827.md +6 -0
  7. package/.agent/memory/project/mnqx54u5-loqtoe.md +9 -0
  8. package/.agent/memory/project/mnqx84cv-mx6dmd.md +9 -0
  9. package/.agent/memory/reference/mnre3cww-penbo1.md +9 -0
  10. package/.agent/plugins/poster-plugin/fonts/SegoeUI Emoji.ttf +0 -0
  11. package/.agent/plugins/poster-plugin/fonts/Symbola_hint.ttf +0 -0
  12. package/.agent/plugins/poster-plugin/src/elements/text.js +3 -1
  13. package/.agent/plugins/poster-plugin/src/fonts.js +10 -0
  14. package/.agent/plugins/poster-plugin/src/index.js +30 -29
  15. package/.agent/sessions/cli_default.json +662 -681
  16. package/.agent/skills/poster-design/SKILL.md +385 -0
  17. package/.claude/settings.local.json +8 -20
  18. package/37ua31lq.png +0 -0
  19. package/4ru0h1yo.png +0 -0
  20. package/55c90rsx.png +0 -0
  21. package/cli/src/commands/chat.js +91 -14
  22. package/cli/src/index.js +11 -2
  23. package/cli/src/ui/chat-ui.js +50 -37
  24. package/gud2mnws.png +0 -0
  25. package/output/poster_business.png.png +0 -0
  26. package/output/poster_business_product.png.png +0 -0
  27. package/output/poster_cyberpunk_neon.png.png +0 -0
  28. package/output/poster_festival.png.png +0 -0
  29. package/output/poster_foliko_personal.png.png +0 -0
  30. package/output/poster_french_romance.png.png +0 -0
  31. package/output/poster_guochao_landscape.png.png +0 -0
  32. package/output/poster_japanese_zen.png.png +0 -0
  33. package/output/poster_kawaii.png.png +0 -0
  34. package/output/poster_kawaii_hello.png.png +0 -0
  35. package/output/poster_luxury_gradient.png.png +0 -0
  36. package/output/poster_magazine_vogue.png.png +0 -0
  37. package/output/poster_minimal.png.png +0 -0
  38. package/output/poster_minimal_bw.png.png +0 -0
  39. package/output/poster_minimal_geometry.png.png +0 -0
  40. package/output/poster_pop_art.png.png +0 -0
  41. package/output/poster_sakura.png.png +0 -0
  42. package/output/poster_tech.png.png +0 -0
  43. package/output/poster_trendy.png.png +0 -0
  44. package/output/poster_vintage.png.png +0 -0
  45. package/output/poster_vintage_coffee.png.png +0 -0
  46. package/package.json +1 -2
  47. package/plugins/default-plugins.js +4 -3
  48. package/plugins/extension-executor-plugin.js +38 -91
  49. package/plugins/file-system-plugin.js +19 -4
  50. package/plugins/memory-plugin.js +230 -36
  51. package/plugins/subagent-plugin.js +14 -37
  52. package/plugins/weixin-plugin.js +40 -168
  53. package/skills/poster-guide/SKILL.md +669 -1426
  54. package/src/core/agent-chat.js +595 -334
  55. package/src/core/agent.js +3 -6
  56. package/undefined.png +0 -0
  57. package/undefined.svg +1 -0
  58. package/xrrdyfr8.png +0 -0
  59. package/y9bfri9m.png +0 -0
  60. package/output/beef-love-poster.png +0 -0
  61. package/output/international-news-daily.png +0 -0
  62. package/poster-test-2.png +0 -0
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: ""
3
+ name: "【避免指南】测试保存"
4
+ type: "feedback"
5
+ project: null
6
+ tags: [error, avoid, test]
7
+ created: "2026-04-09"
8
+ ---
9
+ 【下次这样做】测试内容
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnrdvj5i-ca3dkd"
3
+ name: "避免传入无效的 side 参数"
4
+ type: "feedback"
5
+ project: "null"
6
+ tags: [error, avoid, gate-trading, 参数校验]
7
+ created: "2026-04-09"
8
+ ---
9
+ 【下次这样做】调用 gate_create_order 时,side 参数必须传入有效值 "buy" 或 "sell"。错误原因:传入 "invalid_side" 导致 API 返回 400 错误。建议在调用前校验 side 参数的合法性,或使用枚举类型限制可选值。
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnre365e-7s4zax"
3
+ name: "避免传入数组类型给期望字符串类型的参数"
4
+ type: "feedback"
5
+ project: "null"
6
+ tags: [error, avoid, gate-trading:gate_get_perpetual_open_orders, 参数类型错误]
7
+ created: "2026-04-09"
8
+ ---
9
+ 【下次这样做】调用 gate_get_perpetual_open_orders 时,settle 参数应传入字符串而非数组。错误原因:代码执行 `(args.settle || "USDT").toLowerCase()`,期望 settle 是字符串,但实际传入了数组 `["USDT"]`,导致 `.toLowerCase()` 方法调用失败。正确调用:`{"settle": "USDT"}`
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnre36jn-nkfgmp"
3
+ name: "【避免指南】避免在未创建画布时调用 poster:add_poster_ribbon"
4
+ type: "feedback"
5
+ project: "null"
6
+ tags: [error, avoid, poster:add_poster_ribbon]
7
+ created: "2026-04-09"
8
+ ---
9
+ 【下次这样做】调用 poster:add_poster_ribbon 前必须先创建画布。错误原因:未先调用 canvas 相关工具创建画布就直接使用 canvasId="test" 调用 add_poster_ribbon,导致系统报错 "No canvas created"。正确流程:1. 先调用 canvas 创建工具获得 canvasId;2. 确认画布创建成功后再调用 poster:add_poster_ribbon。
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnre3805-kjiq6h"
3
+ name: "【避免指南】避免在未创建 canvas 的情况下调用 poster:add_poster_seal"
4
+ type: "feedback"
5
+ project: "null"
6
+ tags: [error, avoid, poster:add_poster_seal, canvas]
7
+ created: "2026-04-09"
8
+ ---
9
+ 【下次这样做】调用 poster:add_poster_seal 前必须先确保 canvas 已创建。错误原因:仅传入 canvasId 参数但未实际创建对应 canvas,导致工具执行时找不到目标画布。正确流程:1) 先调用 poster:create_canvas 创建画布并获得 canvas 实例;2) 使用创建的 canvas 实例进行后续操作(如添加印章)。
@@ -0,0 +1,6 @@
1
+ ---
2
+ id: test
3
+ name: test
4
+ type: feedback
5
+ ---
6
+ test content
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnqx54u5-loqtoe"
3
+ name: "FOLIKO项目核心信息与设计规范"
4
+ type: "project"
5
+ project: "FOLIKO"
6
+ tags: [核心特性, 设计规范, 项目路径, 用户偏好]
7
+ created: "2026-04-09"
8
+ ---
9
+ FOLIKO项目核心特性为:插件化架构、多模型支持、流式实时响应。项目路径位于 D:\code\vb-agent\。项目视觉设计规范为:暗色科技风+赛博朋克霓虹(深蓝黑底+青绿渐变+紫色点缀),用户偏好精美且让AI自主决定的设计。Why: 明确项目核心卖点与视觉品牌基调,确保后续内容生成的一致性;记录用户偏好以优化交互体验。How to apply: 涉及FOLIKO的宣传、UI设计时,必须体现三大核心特性,并沿用科技风霓虹配色;对用户采取“直接出精美方案、少问细节”的交互策略。
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnqx84cv-mx6dmd"
3
+ name: "海报背景生成策略"
4
+ type: "project"
5
+ project: "海报生成"
6
+ tags: [海报, 背景, 渐变, bug修复]
7
+ created: "2026-04-09"
8
+ ---
9
+ 用户反馈海报没有背景。Why: 海报生成时可能遗漏背景设置,导致海报无背景。How to apply: 生成海报时必须确保添加背景;若需渐变背景,可采用先设置纯色背景,再用渐变矩形覆盖的方法来模拟实现。
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: "mnre3cww-penbo1"
3
+ name: "ext_call 参数约束"
4
+ type: "reference"
5
+ project: "null"
6
+ tags: [ext_call, 参数验证, 插件开发]
7
+ created: "2026-04-09"
8
+ ---
9
+ ext_call 调用时参数类型有约束:text 参数不能为数字或 null(需要字符串);settle 参数不能为数组(需要字符串如 'USDT')。Why:参数类型错误会导致调用失败,影响插件功能。How to apply:调用前确保参数类型符合规范,字符串参数用 .toLowerCase() 前需确认类型。
@@ -55,7 +55,9 @@ function getFontForText(requestedFont, text) {
55
55
  return (
56
56
  lower.includes('color emoji') || // Noto Color Emoji, Apple Color Emoji
57
57
  lower.includes('noto emoji') || // Noto Emoji
58
- lower.includes('segoe ui emoji') || // Windows emoji
58
+ lower.includes('segoe ui emoji') || // Windows Segoe UI Emoji
59
+ lower.includes('segoe ui symbol') || // Windows Segoe UI Symbol
60
+ lower.includes('segui') || // Windows Segoe UI 开头
59
61
  lower.includes('symbola') || // Symbola
60
62
  lower.includes('emoji') // 任何包含 emoji 的字体
61
63
  )
@@ -17,6 +17,7 @@ const emojiFontMappings = {
17
17
  'NotoEmoji-Regular': 'Noto Emoji',
18
18
  'Apple Color Emoji': 'Apple Color Emoji',
19
19
  'Segoe UI Emoji': 'Segoe UI Emoji',
20
+ 'SegoeUI Emoji': 'Segoe UI Emoji',
20
21
  'Symbola': 'Symbola',
21
22
  }
22
23
 
@@ -31,6 +32,11 @@ const systemFonts = [
31
32
  { path: 'C:\\Windows\\Fonts\\Times New Roman.ttf', family: 'Times New Roman' },
32
33
  { path: 'C:\\Windows\\Fonts\\Consolas.ttf', family: 'Consolas' },
33
34
  { path: 'C:\\Windows\\Fonts\\Georgia.ttf', family: 'Georgia' },
35
+ // Windows Emoji 字体
36
+ { path: 'C:\\Windows\\Fonts\\seguiemj.ttf', family: 'Segoe UI Emoji' },
37
+ { path: 'C:\\Windows\\Fonts\\seguisym.ttf', family: 'Segoe UI Symbol' },
38
+ { path: 'C:\\Windows\\Fonts\\seguisb.ttf', family: 'Segoe UI Symbol' },
39
+ { path: 'C:\\Windows\\Fonts\\EmojiOne Color.ttf', family: 'EmojiOne Color' },
34
40
  // Linux emoji 字体(扩展搜索路径)
35
41
  { path: '/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf', family: 'Noto Color Emoji' },
36
42
  { path: '/usr/share/fonts/truetype/noto/NotoEmoji-Regular.ttf', family: 'Noto Emoji' },
@@ -160,6 +166,10 @@ function initFonts() {
160
166
 
161
167
  // 注册系统 emoji 字体(用于支持 emoji 渲染)
162
168
  const emojiFonts = [
169
+ // Windows Emoji 字体(优先)
170
+ { path: 'C:\\Windows\\Fonts\\seguiemj.ttf', family: 'Segoe UI Emoji' },
171
+ { path: 'C:\\Windows\\Fonts\\seguisym.ttf', family: 'Segoe UI Symbol' },
172
+ { path: 'C:\\Windows\\Fonts\\seguisb.ttf', family: 'Segoe UI Symbol' },
163
173
  // Linux
164
174
  { path: '/usr/share/fonts/truetype/noto/NotoColorEmoji.ttf', family: 'Noto Color Emoji' },
165
175
  { path: '/usr/share/fonts/opentype/noto/NotoColorEmoji.ttf', family: 'Noto Color Emoji' },
@@ -1986,8 +1986,8 @@ module.exports = function (Plugin) {
1986
1986
  export_poster_canvas: {
1987
1987
  description: '导出画布为图片文件',
1988
1988
  inputSchema: z.object({
1989
- filename: z.string().describe('文件名(不含扩展名)'),
1990
- format: z.enum(['png', 'jpg']).optional().describe('格式,默认png'),
1989
+ //filename: z.string().describe('文件名(不含扩展名)'),
1990
+ format: z.enum(['png', 'jpg','svg']).default('png').describe('格式,默认png'),
1991
1991
  quality: z.number().optional().describe('JPEG质量'),
1992
1992
  outputDir: z.string().optional().describe('输出目录'),
1993
1993
  }),
@@ -1996,10 +1996,11 @@ module.exports = function (Plugin) {
1996
1996
  if (!this._canvasManager.isCreated()) {
1997
1997
  return { success: false, error: 'No canvas created' }
1998
1998
  }
1999
-
1999
+ const uid = () => Math.random().toString(36).substring(2, 10);
2000
+ const name=args.filename||uid()
2000
2001
  const format = args.format || 'png'
2001
2002
  const outputDir = args.outputDir || '.'
2002
- const filename = `${args.filename}.${format}`
2003
+ const filename = `${name}.${format}`
2003
2004
  await fs.promises.mkdir(outputDir, { recursive: true })
2004
2005
  const filepath = path.join(outputDir, filename)
2005
2006
  const buffer = this._canvasManager.toBuffer(format, args.quality)
@@ -2021,33 +2022,33 @@ module.exports = function (Plugin) {
2021
2022
  /**
2022
2023
  * 导出为 Base64
2023
2024
  */
2024
- export_poster_base64: {
2025
- description: '导出画布为 Base64 编码',
2026
- inputSchema: z.object({
2027
- format: z.enum(['png', 'jpg']).optional().describe('格式'),
2028
- quality: z.number().optional().describe('JPEG质量'),
2029
- }),
2030
- execute: async (args) => {
2031
- try {
2032
- if (!this._canvasManager.isCreated()) {
2033
- return { success: false, error: 'No canvas created' }
2034
- }
2025
+ // export_poster_base64: {
2026
+ // description: '导出画布为 Base64 编码',
2027
+ // inputSchema: z.object({
2028
+ // format: z.enum(['png', 'jpg']).optional().describe('格式'),
2029
+ // quality: z.number().optional().describe('JPEG质量'),
2030
+ // }),
2031
+ // execute: async (args) => {
2032
+ // try {
2033
+ // if (!this._canvasManager.isCreated()) {
2034
+ // return { success: false, error: 'No canvas created' }
2035
+ // }
2035
2036
 
2036
- const format = args.format || 'png'
2037
- const base64 = this._canvasManager.toBase64(format, args.quality)
2038
- const mimeType = format === 'jpg' ? 'image/jpeg' : 'image/png'
2037
+ // const format = args.format || 'png'
2038
+ // const base64 = this._canvasManager.toBase64(format, args.quality)
2039
+ // const mimeType = format === 'jpg' ? 'image/jpeg' : 'image/png'
2039
2040
 
2040
- return {
2041
- success: true,
2042
- base64,
2043
- format,
2044
- mimeType,
2045
- }
2046
- } catch (err) {
2047
- return { success: false, error: err.message }
2048
- }
2049
- },
2050
- },
2041
+ // return {
2042
+ // success: true,
2043
+ // base64,
2044
+ // format,
2045
+ // mimeType,
2046
+ // }
2047
+ // } catch (err) {
2048
+ // return { success: false, error: err.message }
2049
+ // }
2050
+ // },
2051
+ // },
2051
2052
  }
2052
2053
 
2053
2054