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
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 时间线组件
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const paper = require('paper')
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 创建时间线
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} project - Paper.js 项目
|
|
11
|
+
* @param {Object} canvas - 画布对象
|
|
12
|
+
* @param {Object} args - 组件参数
|
|
13
|
+
* @param {number} args.x - X坐标
|
|
14
|
+
* @param {number} args.y - Y坐标
|
|
15
|
+
* @param {number} args.width - 总宽度
|
|
16
|
+
* @param {Array} args.items - 时间线项目 [{date, title, description}]
|
|
17
|
+
* @param {string} args.lineColor - 线条颜色
|
|
18
|
+
* @param {string} args.dotColor - 点颜色
|
|
19
|
+
* @param {string} args.activeColor - 激活颜色
|
|
20
|
+
* @param {number} args.dotSize - 点大小
|
|
21
|
+
*/
|
|
22
|
+
function createTimeline(project, canvas, args) {
|
|
23
|
+
const {
|
|
24
|
+
x, y,
|
|
25
|
+
width = 500,
|
|
26
|
+
items = [],
|
|
27
|
+
lineColor = '#e2e8f0',
|
|
28
|
+
dotColor = '#6366f1',
|
|
29
|
+
activeColor = '#22c55e',
|
|
30
|
+
dotSize = 16,
|
|
31
|
+
gap = 60,
|
|
32
|
+
} = args
|
|
33
|
+
|
|
34
|
+
const elements = []
|
|
35
|
+
const centerX = x + 80
|
|
36
|
+
const contentX = x + 120
|
|
37
|
+
|
|
38
|
+
// 绘制主线
|
|
39
|
+
if (items.length > 1) {
|
|
40
|
+
const mainLine = new paper.Path.Line({
|
|
41
|
+
from: [centerX, y + dotSize / 2],
|
|
42
|
+
to: [centerX, y + (items.length - 1) * gap + dotSize / 2],
|
|
43
|
+
strokeColor: new paper.Color(lineColor),
|
|
44
|
+
strokeWidth: 2,
|
|
45
|
+
})
|
|
46
|
+
elements.push({ type: 'line', id: mainLine.id })
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// 绘制每个项目
|
|
50
|
+
for (let i = 0; i < items.length; i++) {
|
|
51
|
+
const item = items[i]
|
|
52
|
+
const itemY = y + i * gap
|
|
53
|
+
const isActive = item.active !== false
|
|
54
|
+
|
|
55
|
+
// 绘制时间线点
|
|
56
|
+
const dot = new paper.Path.Circle({
|
|
57
|
+
center: [centerX, itemY + dotSize / 2],
|
|
58
|
+
radius: dotSize / 2,
|
|
59
|
+
})
|
|
60
|
+
dot.fillColor = new paper.Color(isActive ? dotColor : lineColor)
|
|
61
|
+
elements.push({ type: 'circle', id: dot.id })
|
|
62
|
+
|
|
63
|
+
// 绘制日期
|
|
64
|
+
if (item.date) {
|
|
65
|
+
const dateText = new paper.PointText({
|
|
66
|
+
point: [x + 10, itemY + dotSize / 2 + 5],
|
|
67
|
+
content: item.date,
|
|
68
|
+
fontSize: 12,
|
|
69
|
+
fillColor: new paper.Color('#94a3b8'),
|
|
70
|
+
justification: 'left',
|
|
71
|
+
})
|
|
72
|
+
elements.push({ type: 'text', id: dateText.id })
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// 绘制标题
|
|
76
|
+
const titleText = new paper.PointText({
|
|
77
|
+
point: [contentX, itemY + dotSize / 2 + 5],
|
|
78
|
+
content: item.title || `Event ${i + 1}`,
|
|
79
|
+
fontSize: 16,
|
|
80
|
+
fillColor: new paper.Color(isActive ? '#1e293b' : '#94a3b8'),
|
|
81
|
+
justification: 'left',
|
|
82
|
+
})
|
|
83
|
+
elements.push({ type: 'text', id: titleText.id })
|
|
84
|
+
|
|
85
|
+
// 绘制描述
|
|
86
|
+
if (item.description) {
|
|
87
|
+
const descText = new paper.PointText({
|
|
88
|
+
point: [contentX, itemY + dotSize / 2 + 28],
|
|
89
|
+
content: item.description,
|
|
90
|
+
fontSize: 13,
|
|
91
|
+
fillColor: new paper.Color('#64748b'),
|
|
92
|
+
justification: 'left',
|
|
93
|
+
})
|
|
94
|
+
elements.push({ type: 'text', id: descText.id })
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
success: true,
|
|
100
|
+
elements,
|
|
101
|
+
height: items.length * gap,
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
module.exports = createTimeline
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 水印组件
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const paper = require('paper')
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 创建水印组件
|
|
9
|
+
*/
|
|
10
|
+
function createWatermark(project, canvas, params) {
|
|
11
|
+
const {
|
|
12
|
+
text,
|
|
13
|
+
cx,
|
|
14
|
+
cy,
|
|
15
|
+
color = 'rgba(0,0,0,0.1)',
|
|
16
|
+
fontSize = 48,
|
|
17
|
+
fontFamily = 'sans-serif',
|
|
18
|
+
opacity = 0.1,
|
|
19
|
+
rotation = 0,
|
|
20
|
+
align = 'center'
|
|
21
|
+
} = params
|
|
22
|
+
|
|
23
|
+
const elements = []
|
|
24
|
+
|
|
25
|
+
const label = new paper.PointText({
|
|
26
|
+
point: [cx, cy],
|
|
27
|
+
content: text,
|
|
28
|
+
fontSize: fontSize,
|
|
29
|
+
fontFamily: fontFamily,
|
|
30
|
+
fillColor: new paper.Color(color),
|
|
31
|
+
justification: align,
|
|
32
|
+
opacity: opacity
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
// 应用旋转
|
|
36
|
+
if (rotation !== 0) {
|
|
37
|
+
label.rotate(rotation, new paper.Point(cx, cy))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (project && project.activeLayer) {
|
|
41
|
+
project.activeLayer.addChild(label)
|
|
42
|
+
}
|
|
43
|
+
elements.push({ type: 'text', id: label.id })
|
|
44
|
+
|
|
45
|
+
return {
|
|
46
|
+
success: true,
|
|
47
|
+
elements,
|
|
48
|
+
type: 'watermark'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
module.exports = createWatermark
|