foliko 1.0.87 → 1.1.1
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/.shared/ui-ux-pro-max/data/charts.csv +26 -0
- package/.agent/.shared/ui-ux-pro-max/data/colors.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/icons.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/landing.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/data/products.csv +97 -0
- package/.agent/.shared/ui-ux-pro-max/data/prompts.csv +24 -0
- package/.agent/.shared/ui-ux-pro-max/data/react-performance.csv +45 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/flutter.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/html-tailwind.csv +56 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/jetpack-compose.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nextjs.csv +53 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxt-ui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/nuxtjs.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react-native.csv +52 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/react.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/shadcn.csv +61 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/svelte.csv +54 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/swiftui.csv +51 -0
- package/.agent/.shared/ui-ux-pro-max/data/stacks/vue.csv +50 -0
- package/.agent/.shared/ui-ux-pro-max/data/styles.csv +59 -0
- package/.agent/.shared/ui-ux-pro-max/data/typography.csv +58 -0
- package/.agent/.shared/ui-ux-pro-max/data/ui-reasoning.csv +101 -0
- package/.agent/.shared/ui-ux-pro-max/data/ux-guidelines.csv +100 -0
- package/.agent/.shared/ui-ux-pro-max/data/web-interface.csv +31 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/core.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-313.pyc +0 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/core.py +258 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/design_system.py +1067 -0
- package/.agent/.shared/ui-ux-pro-max/scripts/search.py +106 -0
- package/.agent/ARCHITECTURE.md +288 -0
- package/.agent/agents/ambient-agent.md +57 -0
- package/.agent/agents/debugger.md +55 -0
- package/.agent/agents/email-assistant.md +49 -0
- package/.agent/agents/file-manager.md +42 -0
- package/.agent/agents/python-developer.md +60 -0
- package/.agent/agents/scheduler.md +59 -0
- package/.agent/agents/web-developer.md +45 -0
- package/.agent/data/default.json +325 -21
- package/.agent/data/plugins-state.json +194 -162
- package/.agent/data/puppeteer-sessions/undefined.json +6 -0
- package/.agent/mcp_config.json +0 -1
- package/.agent/mcp_config_updated.json +12 -0
- package/.agent/plugins/poster-plugin/README.md +304 -0
- package/.agent/plugins/poster-plugin/fonts/NotoColorEmoji-Regular.ttf +0 -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 +63 -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 +107 -0
- package/.agent/plugins/poster-plugin/src/fonts.js +233 -0
- package/.agent/plugins/poster-plugin/src/index.js +1658 -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/plugins/{temp-repo/puppeteer-plugin → puppeteer-plugin}/index.js +1 -1
- package/.agent/plugins.json +5 -11
- package/.agent/rules/GEMINI.md +273 -0
- package/.agent/rules/allow-rule.md +77 -0
- package/.agent/rules/log-rule.md +83 -0
- package/.agent/rules/security-rule.md +93 -0
- package/.agent/scripts/auto_preview.py +148 -0
- package/.agent/scripts/checklist.py +217 -0
- package/.agent/scripts/session_manager.py +120 -0
- package/.agent/scripts/verify_all.py +327 -0
- package/.agent/sessions/cli_default.json +419 -0
- package/.agent/sessions/weixin_o9cq80zgZqKPA2-s59PN43GdDy1w@im.wechat.json +2195 -0
- package/.agent/skills/api-patterns/SKILL.md +81 -0
- package/.agent/skills/api-patterns/api-style.md +42 -0
- package/.agent/skills/api-patterns/auth.md +24 -0
- package/.agent/skills/api-patterns/documentation.md +26 -0
- package/.agent/skills/api-patterns/graphql.md +41 -0
- package/.agent/skills/api-patterns/rate-limiting.md +31 -0
- package/.agent/skills/api-patterns/response.md +37 -0
- package/.agent/skills/api-patterns/rest.md +40 -0
- package/.agent/skills/api-patterns/scripts/api_validator.py +211 -0
- package/.agent/skills/api-patterns/security-testing.md +122 -0
- package/.agent/skills/api-patterns/trpc.md +41 -0
- package/.agent/skills/api-patterns/versioning.md +22 -0
- package/.agent/skills/app-builder/SKILL.md +75 -0
- package/.agent/skills/app-builder/agent-coordination.md +71 -0
- package/.agent/skills/app-builder/feature-building.md +53 -0
- package/.agent/skills/app-builder/project-detection.md +34 -0
- package/.agent/skills/app-builder/scaffolding.md +118 -0
- package/.agent/skills/app-builder/tech-stack.md +40 -0
- package/.agent/skills/app-builder/templates/SKILL.md +39 -0
- package/.agent/skills/app-builder/templates/astro-static/TEMPLATE.md +76 -0
- package/.agent/skills/app-builder/templates/chrome-extension/TEMPLATE.md +92 -0
- package/.agent/skills/app-builder/templates/cli-tool/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/electron-desktop/TEMPLATE.md +88 -0
- package/.agent/skills/app-builder/templates/express-api/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/flutter-app/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/monorepo-turborepo/TEMPLATE.md +90 -0
- package/.agent/skills/app-builder/templates/nextjs-fullstack/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-saas/TEMPLATE.md +122 -0
- package/.agent/skills/app-builder/templates/nextjs-static/TEMPLATE.md +169 -0
- package/.agent/skills/app-builder/templates/nuxt-app/TEMPLATE.md +134 -0
- package/.agent/skills/app-builder/templates/python-fastapi/TEMPLATE.md +83 -0
- package/.agent/skills/app-builder/templates/react-native-app/TEMPLATE.md +119 -0
- package/.agent/skills/architecture/SKILL.md +55 -0
- package/.agent/skills/architecture/context-discovery.md +43 -0
- package/.agent/skills/architecture/examples.md +94 -0
- package/.agent/skills/architecture/pattern-selection.md +68 -0
- package/.agent/skills/architecture/patterns-reference.md +50 -0
- package/.agent/skills/architecture/trade-off-analysis.md +77 -0
- package/.agent/skills/clean-code/SKILL.md +201 -0
- package/.agent/skills/doc.md +177 -0
- package/.agent/skills/frontend-design/SKILL.md +418 -0
- package/.agent/skills/frontend-design/animation-guide.md +331 -0
- package/.agent/skills/frontend-design/color-system.md +311 -0
- package/.agent/skills/frontend-design/decision-trees.md +418 -0
- package/.agent/skills/frontend-design/motion-graphics.md +306 -0
- package/.agent/skills/frontend-design/scripts/accessibility_checker.py +183 -0
- package/.agent/skills/frontend-design/scripts/ux_audit.py +722 -0
- package/.agent/skills/frontend-design/typography-system.md +345 -0
- package/.agent/skills/frontend-design/ux-psychology.md +1116 -0
- package/.agent/skills/frontend-design/visual-effects.md +383 -0
- package/.agent/skills/i18n-localization/SKILL.md +154 -0
- package/.agent/skills/i18n-localization/scripts/i18n_checker.py +241 -0
- package/.agent/skills/mcp-builder/SKILL.md +176 -0
- package/.agent/skills/web-design-guidelines/SKILL.md +57 -0
- package/.agent/workflows/brainstorm.md +113 -0
- package/.agent/workflows/create.md +59 -0
- package/.agent/workflows/debug.md +103 -0
- package/.agent/workflows/deploy.md +176 -0
- package/.agent/workflows/enhance.md +63 -0
- package/.agent/workflows/orchestrate.md +237 -0
- package/.agent/workflows/plan.md +89 -0
- package/.agent/workflows/preview.md +81 -0
- package/.agent/workflows/simple-test.md +42 -0
- package/.agent/workflows/status.md +86 -0
- package/.agent/workflows/structured-orchestrate.md +180 -0
- package/.agent/workflows/test.md +144 -0
- package/.agent/workflows/ui-ux-pro-max.md +296 -0
- package/.claude/settings.local.json +20 -8
- package/.env.example +56 -56
- package/CLAUDE.md +144 -108
- package/README.md +441 -441
- package/calc_tokens_weixin.js +81 -0
- package/cli/src/commands/chat.js +2 -1
- package/docs/CONTEXT_DESIGN.md +1596 -0
- package/examples/test-concurrent-chat.js +60 -60
- package/foliko-creative-3.png +0 -0
- package/foliko-creative-4.png +0 -0
- package/foliko-creative-5.png +0 -0
- package/package.json +2 -2
- package/plugins/default-plugins.js +2 -1
- package/plugins/extension-executor-plugin.js +91 -2
- package/plugins/file-system-plugin.js +2 -2
- package/plugins/memory-plugin.js +984 -0
- package/plugins/session-plugin.js +57 -1
- package/plugins/weixin-plugin.js +33 -23
- package/skills/find-skills/AGENTS.md +162 -162
- package/skills/find-skills/SKILL.md +133 -133
- package/skills/poster-guide/SKILL.md +1059 -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 +620 -141
- 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/story-cover-book-v2.png +0 -0
- package/story-cover-japanese-1.png +0 -0
- package/story-cover-japanese-2.png +0 -0
- package/story-cover-japanese-3.png +0 -0
- package/story-cover-moran.png +0 -0
- package/undefined.png +0 -0
- package//346/265/267/346/212/245/346/217/222/344/273/266.md +621 -0
- package/.agent/agents/code-assistant.json +0 -14
- package/.agent/agents/email-assistant.json +0 -14
- package/.agent/agents/file-assistant.json +0 -15
- package/.agent/agents/system-assistant.json +0 -15
- package/.agent/agents/web-assistant.json +0 -12
- package/.agent/data/ambient/goals.json +0 -50
- package/.agent/data/ambient/memories.json +0 -7
- package/.agent/data/scheduler/tasks.json +0 -1
- package/.agent/package.json +0 -8
- package/.agent/plugins/__pycache__/test_plugin.cpython-312.pyc +0 -0
- package/.agent/plugins/daytona/README.md +0 -89
- package/.agent/plugins/daytona/index.js +0 -377
- package/.agent/plugins/daytona/package.json +0 -12
- package/.agent/plugins/marknative/README.md +0 -134
- package/.agent/plugins/marknative/index.js +0 -228
- package/.agent/plugins/marknative/package.json +0 -12
- package/.agent/plugins/marknative/update-readme.js +0 -134
- package/.agent/plugins/system-info/index.js +0 -387
- package/.agent/plugins/system-info/package.json +0 -4
- package/.agent/plugins/system-info/test.js +0 -40
- package/.agent/plugins/temp-repo/LICENSE +0 -201
- package/.agent/plugins/test_plugin.py +0 -304
- package/.agent/python-scripts/test_sample.py +0 -24
- package/.agent/skills/agent-browser/SKILL.md +0 -311
- package/.agent/skills/agent-browser/TEST_PLAN.md +0 -200
- package/.agent/skills/sysinfo/SKILL.md +0 -38
- package/.agent/skills/sysinfo/system-info.sh +0 -130
- package/.agent/skills/workflow/SKILL.md +0 -324
- package/.agent/workflows/email-digest.json +0 -50
- package/.agent/workflows/file-backup.json +0 -21
- package/.agent/workflows/get-ip-notify.json +0 -32
- package/.agent/workflows/news-aggregator.json +0 -93
- package/.agent/workflows/news-dashboard-v2.json +0 -94
- package/.agent/workflows/notification-batch.json +0 -32
- 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/plugins/{temp-repo/puppeteer-plugin → puppeteer-plugin}/README.md +0 -0
- /package/.agent/plugins/{temp-repo/puppeteer-plugin → puppeteer-plugin}/package.json +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 预设尺寸配置
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const PRESETS = {
|
|
6
|
+
// 海报
|
|
7
|
+
poster_a4: { width: 2480, height: 3508, name: 'A4海报 (300dpi)' },
|
|
8
|
+
poster_square: { width: 2000, height: 2000, name: '方形海报' },
|
|
9
|
+
poster_16_9: { width: 1920, height: 1080, name: '16:9海报' },
|
|
10
|
+
poster_4_3: { width: 1600, height: 1200, name: '4:3海报' },
|
|
11
|
+
poster_9_16: { width: 1080, height: 1920, name: '9:16竖版海报' },
|
|
12
|
+
|
|
13
|
+
// Banner
|
|
14
|
+
banner_1920x500: { width: 1920, height: 500, name: '网站Banner' },
|
|
15
|
+
banner_1200x400: { width: 1200, height: 400, name: '电商Banner' },
|
|
16
|
+
banner_750x300: { width: 750, height: 300, name: '移动端Banner' },
|
|
17
|
+
banner_468x60: { width: 468, height: 60, name: '小横幅' },
|
|
18
|
+
banner_twitter: { width: 1500, height: 500, name: 'Twitter封面' },
|
|
19
|
+
|
|
20
|
+
// 社交媒体
|
|
21
|
+
social_instagram: { width: 1080, height: 1080, name: 'Instagram正方形' },
|
|
22
|
+
social_story: { width: 1080, height: 1920, name: 'Instagram Story' },
|
|
23
|
+
social_facebook: { width: 1200, height: 630, name: 'Facebook封面' },
|
|
24
|
+
social_linkedin: { width: 1200, height: 627, name: 'LinkedIn封面' },
|
|
25
|
+
social_youtube: { width: 2560, height: 1440, name: 'YouTube封面' },
|
|
26
|
+
|
|
27
|
+
// 宣传图
|
|
28
|
+
promo_900x500: { width: 900, height: 500, name: '宣传图' },
|
|
29
|
+
promo_500x500: { width: 500, height: 500, name: '正方宣传图' },
|
|
30
|
+
promo_300x250: { width: 300, height: 250, name: '矩形广告' },
|
|
31
|
+
|
|
32
|
+
// 名片
|
|
33
|
+
card_standard: { width: 1058, height: 640, name: '标准名片 (300dpi)' },
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = PRESETS
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Business(商务专业风格)模板
|
|
3
|
+
* 使用组件化方式实现
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { createFromConfig } = require('../composer')
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 应用商务风格模板
|
|
10
|
+
*/
|
|
11
|
+
async function applyBusinessTemplate(project, canvas, args) {
|
|
12
|
+
const { title, subtitle, background, accentColor } = args
|
|
13
|
+
const cx = canvas.width / 2
|
|
14
|
+
|
|
15
|
+
const bg = background || '#1e3a5f'
|
|
16
|
+
const accent = accentColor || '#c9a227'
|
|
17
|
+
|
|
18
|
+
const titleFontSize = Math.min(100, canvas.width / 12)
|
|
19
|
+
const subtitleFontSize = Math.min(36, canvas.width / 28)
|
|
20
|
+
|
|
21
|
+
const components = [
|
|
22
|
+
// 背景
|
|
23
|
+
{ type: 'background', color: bg },
|
|
24
|
+
|
|
25
|
+
// 顶部装饰线
|
|
26
|
+
{ type: 'line', x1: 100, y1: 150, x2: canvas.width - 100, y2: 150, stroke: accent, strokeWidth: 4 },
|
|
27
|
+
|
|
28
|
+
// 左侧装饰条
|
|
29
|
+
{ type: 'rectangle', x: 80, y: 150, width: 8, height: canvas.height - 300, fill: accent },
|
|
30
|
+
|
|
31
|
+
// 主标题
|
|
32
|
+
{
|
|
33
|
+
type: 'artText',
|
|
34
|
+
text: title,
|
|
35
|
+
x: cx,
|
|
36
|
+
y: canvas.height / 2 - 20,
|
|
37
|
+
fontSize: titleFontSize,
|
|
38
|
+
gradient: { colors: ['#ffffff', '#e0e0e0'] },
|
|
39
|
+
shadow: { color: 'rgba(0,0,0,0.3)', blur: 10 }
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// 副标题
|
|
43
|
+
...(subtitle ? [{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: subtitle,
|
|
46
|
+
x: cx,
|
|
47
|
+
y: canvas.height / 2 + 60,
|
|
48
|
+
fontSize: subtitleFontSize,
|
|
49
|
+
color: '#cccccc',
|
|
50
|
+
align: 'center'
|
|
51
|
+
}] : []),
|
|
52
|
+
|
|
53
|
+
// 底部装饰线
|
|
54
|
+
{ type: 'line', x1: 100, y1: canvas.height - 150, x2: canvas.width - 100, y2: canvas.height - 150, stroke: accent, strokeWidth: 4 }
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
return await createFromConfig(project, canvas, { components })
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
module.exports = applyBusinessTemplate
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gradient(渐变风格)模板
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const { createFromConfig } = require('../composer')
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 应用渐变风格模板
|
|
9
|
+
*/
|
|
10
|
+
async function applyGradientTemplate(project, canvas, args) {
|
|
11
|
+
const { title, subtitle, background, accentColor } = args
|
|
12
|
+
const cx = canvas.width / 2
|
|
13
|
+
const cy = canvas.height / 2
|
|
14
|
+
|
|
15
|
+
const bg = background || '#667eea'
|
|
16
|
+
const accent = accentColor || '#764ba2'
|
|
17
|
+
|
|
18
|
+
const titleFontSize = Math.min(120, canvas.width / 10)
|
|
19
|
+
|
|
20
|
+
const components = [
|
|
21
|
+
// 渐变背景
|
|
22
|
+
{
|
|
23
|
+
type: 'background',
|
|
24
|
+
gradient: {
|
|
25
|
+
type: 'radial',
|
|
26
|
+
colors: [bg, accent, '#1a1a2e']
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
// 装饰圆形
|
|
31
|
+
{ type: 'circle', cx: canvas.width * 0.2, cy: canvas.height * 0.2, rx: 100, fill: '#ffffff', opacity: 0.1 },
|
|
32
|
+
{ type: 'circle', cx: canvas.width * 0.8, cy: canvas.height * 0.7, rx: 150, fill: '#ffffff', opacity: 0.08 },
|
|
33
|
+
{ type: 'circle', cx: canvas.width * 0.5, cy: canvas.height * 0.9, rx: 200, fill: '#000000', opacity: 0.2 },
|
|
34
|
+
|
|
35
|
+
// 主标题
|
|
36
|
+
{
|
|
37
|
+
type: 'artText',
|
|
38
|
+
text: title,
|
|
39
|
+
x: cx,
|
|
40
|
+
y: cy - 20,
|
|
41
|
+
fontSize: titleFontSize,
|
|
42
|
+
gradient: { colors: ['#ffffff', '#e0e0e0'] },
|
|
43
|
+
shadow: { color: 'rgba(0,0,0,0.5)', blur: 20 }
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
// 副标题
|
|
47
|
+
...(subtitle ? [{
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: subtitle,
|
|
50
|
+
x: cx,
|
|
51
|
+
y: cy + 80,
|
|
52
|
+
fontSize: 36,
|
|
53
|
+
color: '#ffffff',
|
|
54
|
+
align: 'center'
|
|
55
|
+
}] : []),
|
|
56
|
+
|
|
57
|
+
// 底部装饰线
|
|
58
|
+
{ type: 'line', x1: cx - 150, y1: cy + 150, x2: cx + 150, y2: cy + 150, stroke: '#ffffff', strokeWidth: 2, opacity: 0.5 }
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
return await createFromConfig(project, canvas, { components })
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
module.exports = applyGradientTemplate
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 模板模块导出
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const applyModernTemplate = require('./modern')
|
|
6
|
+
const applyBusinessTemplate = require('./business')
|
|
7
|
+
const applySocialTemplate = require('./social')
|
|
8
|
+
const applySimpleTemplate = require('./simple')
|
|
9
|
+
const applyTechTemplate = require('./tech')
|
|
10
|
+
const applyGradientTemplate = require('./gradient')
|
|
11
|
+
|
|
12
|
+
const TEMPLATES = {
|
|
13
|
+
modern: applyModernTemplate,
|
|
14
|
+
business: applyBusinessTemplate,
|
|
15
|
+
social: applySocialTemplate,
|
|
16
|
+
simple: applySimpleTemplate,
|
|
17
|
+
tech: applyTechTemplate,
|
|
18
|
+
gradient: applyGradientTemplate,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* 应用模板
|
|
23
|
+
*/
|
|
24
|
+
async function applyTemplate(project, canvas, templateName, args) {
|
|
25
|
+
const templateFn = TEMPLATES[templateName]
|
|
26
|
+
if (!templateFn) {
|
|
27
|
+
throw new Error(`Unknown template: ${templateName}. Available: ${Object.keys(TEMPLATES).join(', ')}`)
|
|
28
|
+
}
|
|
29
|
+
return await templateFn(project, canvas, args)
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 获取可用模板列表
|
|
34
|
+
*/
|
|
35
|
+
function getAvailableTemplates() {
|
|
36
|
+
return Object.keys(TEMPLATES)
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
applyTemplate,
|
|
41
|
+
getAvailableTemplates,
|
|
42
|
+
TEMPLATES,
|
|
43
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modern(现代科技风格)模板
|
|
3
|
+
* 使用组件化方式实现
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { createFromConfig } = require('../composer')
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 应用现代风格模板
|
|
10
|
+
*/
|
|
11
|
+
async function applyModernTemplate(project, canvas, args) {
|
|
12
|
+
const { title, subtitle, background, accentColor } = args
|
|
13
|
+
const cx = canvas.width / 2
|
|
14
|
+
const cy = canvas.height / 2
|
|
15
|
+
|
|
16
|
+
const bg = background || '#1a1a2e'
|
|
17
|
+
const accent = accentColor || '#00d9ff'
|
|
18
|
+
|
|
19
|
+
// 计算装饰圆形位置
|
|
20
|
+
const circle1X = canvas.width * 0.85
|
|
21
|
+
const circle1Y = canvas.height * 0.15
|
|
22
|
+
const circle2X = canvas.width * 0.1
|
|
23
|
+
const circle2Y = canvas.height * 0.85
|
|
24
|
+
const circle3X = canvas.width * 0.9
|
|
25
|
+
const circle3Y = canvas.height * 0.8
|
|
26
|
+
|
|
27
|
+
// 计算字体大小
|
|
28
|
+
const titleFontSize = Math.min(120, canvas.width / 10)
|
|
29
|
+
const subtitleFontSize = Math.min(40, canvas.width / 25)
|
|
30
|
+
|
|
31
|
+
const components = [
|
|
32
|
+
// 背景
|
|
33
|
+
{ type: 'background', color: bg },
|
|
34
|
+
|
|
35
|
+
// 装饰圆形
|
|
36
|
+
{ type: 'circle', cx: circle1X, cy: circle1Y, rx: 200, fill: accent, opacity: 0.2 },
|
|
37
|
+
{ type: 'circle', cx: circle2X, cy: circle2Y, rx: 150, fill: accent, opacity: 0.15 },
|
|
38
|
+
{ type: 'circle', cx: circle3X, cy: circle3Y, rx: 100, fill: '#00ff88', opacity: 0.1 },
|
|
39
|
+
|
|
40
|
+
// 艺术标题
|
|
41
|
+
{
|
|
42
|
+
type: 'artText',
|
|
43
|
+
text: title,
|
|
44
|
+
x: cx,
|
|
45
|
+
y: cy - 30,
|
|
46
|
+
fontSize: titleFontSize,
|
|
47
|
+
gradient: { colors: [accent, '#00ff88'] },
|
|
48
|
+
shadow: { color: accent, blur: 20 }
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
// 副标题
|
|
52
|
+
...(subtitle ? [{
|
|
53
|
+
type: 'text',
|
|
54
|
+
text: subtitle,
|
|
55
|
+
x: cx,
|
|
56
|
+
y: cy + 80,
|
|
57
|
+
fontSize: subtitleFontSize,
|
|
58
|
+
color: '#aaaaaa',
|
|
59
|
+
align: 'center'
|
|
60
|
+
}] : []),
|
|
61
|
+
|
|
62
|
+
// 分隔线
|
|
63
|
+
{ type: 'line', x1: cx - 200, y1: cy + 50, x2: cx + 200, y2: cy + 50, stroke: accent, strokeWidth: 2 }
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
return await createFromConfig(project, canvas, { components })
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = applyModernTemplate
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Simple(简约留白风格)模板
|
|
3
|
+
* 使用组件化方式实现
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { createFromConfig } = require('../composer')
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 应用简约风格模板
|
|
10
|
+
*/
|
|
11
|
+
async function applySimpleTemplate(project, canvas, args) {
|
|
12
|
+
const { title, subtitle, background, accentColor } = args
|
|
13
|
+
const cx = canvas.width / 2
|
|
14
|
+
const cy = canvas.height / 2
|
|
15
|
+
|
|
16
|
+
const bg = background || '#f5f5f5'
|
|
17
|
+
const accent = accentColor || '#333333'
|
|
18
|
+
|
|
19
|
+
const titleFontSize = Math.min(100, canvas.width / 12)
|
|
20
|
+
const subtitleFontSize = Math.min(36, canvas.width / 28)
|
|
21
|
+
|
|
22
|
+
const components = [
|
|
23
|
+
// 背景
|
|
24
|
+
{ type: 'background', color: bg },
|
|
25
|
+
|
|
26
|
+
// 装饰线条
|
|
27
|
+
{ type: 'line', x1: cx - 100, y1: cy - 80, x2: cx + 100, y2: cy - 80, stroke: accent, strokeWidth: 1 },
|
|
28
|
+
|
|
29
|
+
// 主标题
|
|
30
|
+
{
|
|
31
|
+
type: 'artText',
|
|
32
|
+
text: title,
|
|
33
|
+
x: cx,
|
|
34
|
+
y: cy - 20,
|
|
35
|
+
fontSize: titleFontSize,
|
|
36
|
+
gradient: { colors: [accent, '#666666'] },
|
|
37
|
+
shadow: { color: 'rgba(0,0,0,0.1)', blur: 5 }
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
// 副标题
|
|
41
|
+
...(subtitle ? [{
|
|
42
|
+
type: 'text',
|
|
43
|
+
text: subtitle,
|
|
44
|
+
x: cx,
|
|
45
|
+
y: cy + 60,
|
|
46
|
+
fontSize: subtitleFontSize,
|
|
47
|
+
color: '#666666',
|
|
48
|
+
align: 'center'
|
|
49
|
+
}] : []),
|
|
50
|
+
|
|
51
|
+
// 装饰线条
|
|
52
|
+
{ type: 'line', x1: cx - 100, y1: cy + 100, x2: cx + 100, y2: cy + 100, stroke: accent, strokeWidth: 1 }
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
return await createFromConfig(project, canvas, { components })
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = applySimpleTemplate
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Social(社交媒体风格)模板
|
|
3
|
+
* 使用组件化方式实现
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const { createFromConfig } = require('../composer')
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* 应用社交媒体风格模板
|
|
10
|
+
*/
|
|
11
|
+
async function applySocialTemplate(project, canvas, args) {
|
|
12
|
+
const { title, subtitle, background, accentColor } = args
|
|
13
|
+
const cx = canvas.width / 2
|
|
14
|
+
const cy = canvas.height / 2
|
|
15
|
+
|
|
16
|
+
const bg = background || '#2d3436'
|
|
17
|
+
const accent = accentColor || '#e84393'
|
|
18
|
+
|
|
19
|
+
const titleFontSize = Math.min(72, canvas.width / 14)
|
|
20
|
+
const subtitleFontSize = Math.min(32, canvas.width / 30)
|
|
21
|
+
const frameRadius = Math.min(250, canvas.width / 3)
|
|
22
|
+
|
|
23
|
+
const components = [
|
|
24
|
+
// 背景
|
|
25
|
+
{ type: 'background', color: bg },
|
|
26
|
+
|
|
27
|
+
// 中心圆形边框
|
|
28
|
+
{ type: 'circle', cx: cx, cy: cy - 50, rx: frameRadius, stroke: accent, strokeWidth: 6, fill: 'transparent' },
|
|
29
|
+
{ type: 'circle', cx: cx, cy: cy - 50, rx: frameRadius - 20, stroke: accent, strokeWidth: 1, opacity: 0.5, fill: 'transparent' },
|
|
30
|
+
|
|
31
|
+
// 主标题
|
|
32
|
+
{
|
|
33
|
+
type: 'artText',
|
|
34
|
+
text: title,
|
|
35
|
+
x: cx,
|
|
36
|
+
y: cy - 30,
|
|
37
|
+
fontSize: titleFontSize,
|
|
38
|
+
gradient: { colors: ['#ffffff', '#e0e0e0'] },
|
|
39
|
+
shadow: { color: accent, blur: 15 }
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
// 副标题
|
|
43
|
+
...(subtitle ? [{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: subtitle,
|
|
46
|
+
x: cx,
|
|
47
|
+
y: cy + 40,
|
|
48
|
+
fontSize: subtitleFontSize,
|
|
49
|
+
color: '#dddddd',
|
|
50
|
+
align: 'center'
|
|
51
|
+
}] : []),
|
|
52
|
+
|
|
53
|
+
// 底部装饰点
|
|
54
|
+
{ type: 'circle', cx: cx - 30, cy: cy + 120, rx: 5, fill: accent, opacity: 0.5 },
|
|
55
|
+
{ type: 'circle', cx: cx, cy: cy + 120, rx: 5, fill: accent, opacity: 0.7 },
|
|
56
|
+
{ type: 'circle', cx: cx + 30, cy: cy + 120, rx: 5, fill: accent, opacity: 0.9 }
|
|
57
|
+
]
|
|
58
|
+
|
|
59
|
+
return await createFromConfig(project, canvas, { components })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
module.exports = applySocialTemplate
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tech(科技感)模板
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
const { createFromConfig } = require('../composer')
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 应用科技风格模板
|
|
9
|
+
*/
|
|
10
|
+
async function applyTechTemplate(project, canvas, args) {
|
|
11
|
+
const { title, subtitle, background, accentColor } = args
|
|
12
|
+
const cx = canvas.width / 2
|
|
13
|
+
const cy = canvas.height / 2
|
|
14
|
+
|
|
15
|
+
const bg = background || '#0a0a0a'
|
|
16
|
+
const accent = accentColor || '#00ff00'
|
|
17
|
+
|
|
18
|
+
const titleFontSize = Math.min(100, canvas.width / 12)
|
|
19
|
+
const subtitleFontSize = Math.min(32, canvas.width / 28)
|
|
20
|
+
|
|
21
|
+
// 计算网格位置
|
|
22
|
+
const gridItems = []
|
|
23
|
+
const cols = 5
|
|
24
|
+
const rows = 3
|
|
25
|
+
const gridWidth = canvas.width * 0.8
|
|
26
|
+
const gridHeight = canvas.height * 0.3
|
|
27
|
+
const cellWidth = gridWidth / cols
|
|
28
|
+
const cellHeight = gridHeight / rows
|
|
29
|
+
const gridX = (canvas.width - gridWidth) / 2
|
|
30
|
+
const gridY = canvas.height * 0.7
|
|
31
|
+
|
|
32
|
+
for (let i = 0; i < cols; i++) {
|
|
33
|
+
for (let j = 0; j < rows; j++) {
|
|
34
|
+
gridItems.push({
|
|
35
|
+
type: 'rectangle',
|
|
36
|
+
x: gridX + i * cellWidth,
|
|
37
|
+
y: gridY + j * cellHeight,
|
|
38
|
+
width: cellWidth - 10,
|
|
39
|
+
height: cellHeight - 10,
|
|
40
|
+
stroke: accent,
|
|
41
|
+
strokeWidth: 0.5,
|
|
42
|
+
opacity: 0.3
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const components = [
|
|
48
|
+
// 背景
|
|
49
|
+
{ type: 'background', color: bg },
|
|
50
|
+
|
|
51
|
+
// 顶部装饰线
|
|
52
|
+
{ type: 'line', x1: 0, y1: 50, x2: canvas.width * 0.3, y2: 50, stroke: accent, strokeWidth: 2 },
|
|
53
|
+
{ type: 'line', x1: canvas.width * 0.7, y1: 50, x2: canvas.width, y2: 50, stroke: accent, strokeWidth: 2 },
|
|
54
|
+
|
|
55
|
+
// 主标题(霓虹效果)
|
|
56
|
+
{
|
|
57
|
+
type: 'artText',
|
|
58
|
+
text: title,
|
|
59
|
+
x: cx,
|
|
60
|
+
y: cy,
|
|
61
|
+
fontSize: titleFontSize,
|
|
62
|
+
gradient: { colors: [accent, '#00ffff'] },
|
|
63
|
+
shadow: { color: accent, blur: 30 }
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
// 副标题
|
|
67
|
+
...(subtitle ? [{
|
|
68
|
+
type: 'text',
|
|
69
|
+
text: subtitle,
|
|
70
|
+
x: cx,
|
|
71
|
+
y: cy + 80,
|
|
72
|
+
fontSize: subtitleFontSize,
|
|
73
|
+
color: '#888888',
|
|
74
|
+
align: 'center'
|
|
75
|
+
}] : []),
|
|
76
|
+
|
|
77
|
+
// 网格装饰
|
|
78
|
+
...gridItems
|
|
79
|
+
]
|
|
80
|
+
|
|
81
|
+
return await createFromConfig(project, canvas, { components })
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
module.exports = applyTechTemplate
|
|
@@ -325,7 +325,7 @@ module.exports = function (Plugin) {
|
|
|
325
325
|
const page = args.pageId && this.pages.has(args.pageId)
|
|
326
326
|
? this.pages.get(args.pageId)
|
|
327
327
|
: this.getCurrentPage();
|
|
328
|
-
|
|
328
|
+
args.toMarkdown=true
|
|
329
329
|
let html = args.contentOnly
|
|
330
330
|
? await page.evaluate(() => document.body ? document.body.innerHTML : '')
|
|
331
331
|
: await page.content();
|
package/.agent/plugins.json
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"enabled": true
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"secure": false
|
|
8
|
-
},
|
|
9
|
-
"imap": {
|
|
10
|
-
"host": "imap.gmail.com",
|
|
11
|
-
"port": 993
|
|
12
|
-
}
|
|
2
|
+
"weixin": {
|
|
3
|
+
"enabled": true
|
|
4
|
+
},
|
|
5
|
+
"poster-plugin": {
|
|
6
|
+
"enabled": true
|
|
13
7
|
}
|
|
14
8
|
}
|