foliko 1.1.93 → 2.0.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/.claude/settings.local.json +2 -1
- package/CLAUDE.md +56 -30
- package/REFACTORING_PLAN.md +645 -0
- package/docs/architecture.md +131 -0
- package/docs/migration.md +57 -0
- package/docs/public-api.md +138 -0
- package/docs/usage.md +385 -0
- package/examples/ambient-example.js +20 -137
- package/examples/basic.js +21 -48
- package/examples/bootstrap.js +16 -74
- package/examples/mcp-example.js +6 -29
- package/examples/skill-example.js +6 -19
- package/examples/workflow.js +8 -56
- package/package.json +8 -4
- package/plugins/README.md +49 -0
- package/plugins/{ambient-agent → ambient}/EventWatcher.js +1 -1
- package/plugins/{ambient-agent → ambient}/ExplorerLoop.js +3 -3
- package/plugins/{ambient-agent → ambient}/GoalManager.js +2 -2
- package/plugins/ambient/README.md +14 -0
- package/plugins/{ambient-agent → ambient}/Reflector.js +1 -1
- package/plugins/{ambient-agent → ambient}/StateStore.js +1 -1
- package/plugins/{ambient-agent → ambient}/index.js +2 -2
- package/plugins/{ai-plugin.js → core/ai/index.js} +14 -30
- package/plugins/{audit-plugin.js → core/audit/index.js} +3 -30
- package/plugins/{coordinator-plugin.js → core/coordinator/index.js} +3 -35
- package/plugins/core/default/bootstrap.js +202 -0
- package/plugins/core/default/config.js +220 -0
- package/plugins/core/default/index.js +58 -0
- package/plugins/core/mcp/index.js +1 -0
- package/plugins/{python-plugin-loader.js → core/python-loader/index.js} +7 -187
- package/plugins/{rules-plugin.js → core/rules/index.js} +121 -64
- package/plugins/{scheduler-plugin.js → core/scheduler/index.js} +12 -114
- package/plugins/{session-plugin.js → core/session/index.js} +9 -73
- package/{src/capabilities/skill-manager.js → plugins/core/skill-manager/index.js} +64 -18
- package/plugins/{storage-plugin.js → core/storage/index.js} +5 -29
- package/plugins/{subagent-plugin.js → core/sub-agent/index.js} +10 -171
- package/plugins/{think-plugin.js → core/think/index.js} +24 -91
- package/{src/capabilities/workflow-engine.js → plugins/core/workflow/index.js} +87 -85
- package/plugins/default-plugins.js +6 -720
- package/plugins/{data-splitter-plugin.js → executors/data-splitter/index.js} +9 -83
- package/plugins/{extension-executor-plugin.js → executors/extension/index.js} +13 -97
- package/plugins/{python-executor-plugin.js → executors/python/index.js} +6 -31
- package/plugins/{shell-executor-plugin.js → executors/shell/index.js} +2 -5
- package/plugins/install/README.md +9 -0
- package/plugins/{install-plugin.js → install/index.js} +3 -3
- package/plugins/{file-system-plugin.js → io/file-system/index.js} +34 -236
- package/plugins/{web-plugin.js → io/web/index.js} +11 -113
- package/plugins/memory/README.md +13 -0
- package/plugins/{memory-plugin.js → memory/index.js} +4 -18
- package/plugins/messaging/email/README.md +19 -0
- package/plugins/{email → messaging/email}/index.js +2 -2
- package/plugins/{feishu-plugin.js → messaging/feishu/index.js} +3 -3
- package/plugins/{qq-plugin.js → messaging/qq/index.js} +5 -16
- package/plugins/{telegram-plugin.js → messaging/telegram/index.js} +3 -3
- package/plugins/{weixin-plugin.js → messaging/weixin/index.js} +15 -15
- package/plugins/{plugin-manager-plugin.js → plugin-manager/index.js} +36 -180
- package/plugins/{tools-plugin.js → tools/index.js} +68 -116
- package/plugins/trading/README.md +15 -0
- package/plugins/{gate-trading.js → trading/index.js} +8 -8
- package/{examples → sandbox}/test-concurrent-chat.js +2 -2
- package/{examples → sandbox}/test-long-chat.js +2 -2
- package/{examples → sandbox}/test-session-chat.js +2 -2
- package/{examples → sandbox}/test-web-plugin.js +1 -1
- package/{examples → sandbox}/test-weixin-feishu.js +2 -2
- package/src/agent/base.js +56 -0
- package/src/{core/agent-chat.js → agent/chat.js} +11 -11
- package/src/{core/coordinator-manager.js → agent/coordinator.js} +3 -3
- package/src/agent/index.js +111 -0
- package/src/agent/main.js +337 -0
- package/src/agent/prompt.js +78 -0
- package/src/agent/sub.js +198 -0
- package/src/agent/worker.js +104 -0
- package/{cli/bin/foliko.js → src/cli/bin.js} +1 -1
- package/{cli/src → src/cli}/commands/chat.js +25 -21
- package/{cli/src → src/cli}/index.js +1 -0
- package/{cli/src → src/cli}/ui/chat-ui-old.js +40 -178
- package/{cli/src → src/cli}/ui/chat-ui.js +3 -3
- package/{cli/src → src/cli}/ui/components/footer-bar.js +1 -1
- package/src/common/errors.js +402 -0
- package/src/{utils → common}/logger.js +33 -0
- package/src/{utils/chat-queue.js → common/queue.js} +2 -2
- package/src/config/plugin-config.js +50 -0
- package/src/context/agent.js +32 -0
- package/src/context/compaction-prompts.js +170 -0
- package/src/context/compaction-utils.js +191 -0
- package/src/context/compressor.js +413 -0
- package/src/context/index.js +9 -0
- package/src/{core/context-manager.js → context/manager.js} +1 -1
- package/src/context/request.js +50 -0
- package/src/context/session.js +33 -0
- package/src/context/storage.js +30 -0
- package/src/executors/mcp-client.js +153 -0
- package/src/executors/mcp-desc.js +236 -0
- package/src/executors/mcp-executor.js +91 -956
- package/src/{core → framework}/command-registry.js +1 -1
- package/src/framework/framework.js +300 -0
- package/src/framework/index.js +18 -0
- package/src/framework/lifecycle.js +203 -0
- package/src/framework/loader.js +78 -0
- package/src/framework/registry.js +86 -0
- package/src/{core/ui-extension-context.js → framework/ui-extension.js} +1 -1
- package/src/index.js +130 -15
- package/src/llm/index.js +26 -0
- package/src/llm/provider.js +212 -0
- package/src/llm/registry.js +11 -0
- package/src/{core/token-counter.js → llm/tokens.js} +4 -37
- package/src/{core/plugin-base.js → plugin/base.js} +10 -136
- package/src/plugin/index.js +14 -0
- package/src/plugin/loader.js +101 -0
- package/src/plugin/manager.js +261 -0
- package/src/{core → session}/branch-summary-auto.js +2 -2
- package/src/{core/chat-session.js → session/chat.js} +2 -2
- package/src/session/index.js +7 -0
- package/src/{core/session-manager.js → session/session.js} +2 -2
- package/src/session/ttl.js +92 -0
- package/src/{core/jsonl-storage.js → storage/jsonl.js} +1 -1
- package/src/tool/executor.js +85 -0
- package/src/tool/index.js +15 -0
- package/src/tool/registry.js +143 -0
- package/src/{core/tool-router.js → tool/router.js} +17 -124
- package/src/tool/schema.js +108 -0
- package/src/utils/data-splitter.js +1 -1
- package/src/utils/download.js +1 -1
- package/src/utils/index.js +6 -6
- package/src/utils/message-validator.js +1 -1
- package/tests/core/context-storage.test.js +46 -0
- package/tests/core/llm.test.js +54 -0
- package/tests/core/plugin.test.js +42 -0
- package/tests/core/tool.test.js +60 -0
- package/tests/setup.js +10 -0
- package/tests/smoke.test.js +58 -0
- package/vitest.config.js +9 -0
- package/cli/src/daemon.js +0 -149
- package/docs/CONTEXT_DESIGN.md +0 -1596
- package/docs/ai-sdk-optimization.md +0 -655
- package/docs/features.md +0 -120
- package/docs/qq-bot.md +0 -976
- package/docs/quick-reference.md +0 -160
- package/docs/user-manual.md +0 -1391
- package/images/geometric_shapes.jpg +0 -0
- package/images/sunset_mountain_lake.jpg +0 -0
- package/skills/poster-guide/SKILL.md +0 -792
- package/src/capabilities/index.js +0 -11
- package/src/core/agent.js +0 -808
- package/src/core/context-compressor.js +0 -959
- package/src/core/enhanced-context-compressor.js +0 -210
- package/src/core/framework.js +0 -1422
- package/src/core/index.js +0 -30
- package/src/core/plugin-manager.js +0 -961
- package/src/core/provider-registry.js +0 -159
- package/src/core/provider.js +0 -156
- package/src/core/request-context.js +0 -98
- package/src/core/subagent.js +0 -442
- package/src/core/system-prompt-builder.js +0 -120
- package/src/core/tool-executor.js +0 -202
- package/src/core/tool-registry.js +0 -517
- package/src/core/worker-agent.js +0 -192
- package/src/executors/executor-base.js +0 -58
- package/src/utils/error-boundary.js +0 -363
- package/src/utils/error.js +0 -374
- package/system.md +0 -1645
- package/website_v2/README.md +0 -57
- package/website_v2/SPEC.md +0 -1
- package/website_v2/docs/api.html +0 -128
- package/website_v2/docs/configuration.html +0 -147
- package/website_v2/docs/plugin-development.html +0 -129
- package/website_v2/docs/project-structure.html +0 -89
- package/website_v2/docs/skill-development.html +0 -85
- package/website_v2/index.html +0 -489
- package/website_v2/scripts/main.js +0 -93
- package/website_v2/styles/animations.css +0 -8
- package/website_v2/styles/docs.css +0 -83
- package/website_v2/styles/main.css +0 -417
- package/xhs_auth.json +0 -268
- package//346/265/267/346/212/245/346/217/222/344/273/266.md +0 -621
- /package/plugins/{ambient-agent → ambient}/constants.js +0 -0
- /package/plugins/{email → messaging/email}/constants.js +0 -0
- /package/plugins/{email → messaging/email}/handlers.js +0 -0
- /package/plugins/{email → messaging/email}/monitor.js +0 -0
- /package/plugins/{email → messaging/email}/parser.js +0 -0
- /package/plugins/{email → messaging/email}/reply.js +0 -0
- /package/plugins/{email → messaging/email}/utils.js +0 -0
- /package/{examples → sandbox}/test-chat.js +0 -0
- /package/{examples → sandbox}/test-mcp.js +0 -0
- /package/{examples → sandbox}/test-reload.js +0 -0
- /package/{examples → sandbox}/test-telegram.js +0 -0
- /package/{examples → sandbox}/test-tg-bot.js +0 -0
- /package/{examples → sandbox}/test-tg-simple.js +0 -0
- /package/{examples → sandbox}/test-tg.js +0 -0
- /package/{examples → sandbox}/test-think.js +0 -0
- /package/src/{core/sub-agent-config.js → agent/sub-config.js} +0 -0
- /package/{cli/src → src/cli}/commands/daemon.js +0 -0
- /package/{cli/src → src/cli}/commands/list.js +0 -0
- /package/{cli/src → src/cli}/commands/plugin.js +0 -0
- /package/{cli/src → src/cli}/ui/components/agent-mention-provider.js +0 -0
- /package/{cli/src → src/cli}/ui/components/chained-autocomplete-provider.js +0 -0
- /package/{cli/src → src/cli}/ui/components/message-bubble.js +0 -0
- /package/{cli/src → src/cli}/ui/components/status-bar.js +0 -0
- /package/{cli/src → src/cli}/utils/ansi.js +0 -0
- /package/{cli/src → src/cli}/utils/config.js +0 -0
- /package/{cli/src → src/cli}/utils/markdown.js +0 -0
- /package/{cli/src → src/cli}/utils/plugin-config.js +0 -0
- /package/{cli/src → src/cli}/utils/render-diff.js +0 -0
- /package/src/{utils/circuit-breaker.js → common/circuit.js} +0 -0
- /package/src/{core → common}/constants.js +0 -0
- /package/src/{utils/edit-diff.js → common/diff.js} +0 -0
- /package/src/{utils/event-emitter.js → common/events.js} +0 -0
- /package/src/{utils → common}/id.js +0 -0
- /package/src/{utils → common}/retry.js +0 -0
- /package/src/{core/notification-manager.js → notification/manager.js} +0 -0
- /package/src/{core/session-entry.js → session/entry.js} +0 -0
- /package/src/{core/storage-manager.js → storage/manager.js} +0 -0
package/website_v2/index.html
DELETED
|
@@ -1,489 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="zh-CN">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<meta name="description" content="Foliko - 简约的插件化 Agent 框架,支持多 AI、流式输出、子 Agent 系统">
|
|
7
|
-
<title>Foliko - 简约的插件化 Agent 框架</title>
|
|
8
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
-
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
11
|
-
<link rel="stylesheet" href="styles/main.css">
|
|
12
|
-
<link rel="stylesheet" href="styles/animations.css">
|
|
13
|
-
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><defs><linearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'><stop offset='0%25' stop-color='%236366F1'/><stop offset='100%25' stop-color='%238B5CF6'/></linearGradient></defs><circle cx='50' cy='50' r='45' fill='url(%23g)'/><path d='M30 50 L45 65 L70 35' stroke='white' stroke-width='8' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>">
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<!-- Navigation -->
|
|
17
|
-
<nav class="nav">
|
|
18
|
-
<div class="nav-inner">
|
|
19
|
-
<a href="#" class="nav-logo">
|
|
20
|
-
<svg viewBox="0 0 100 100" width="32" height="32" fill="none">
|
|
21
|
-
<defs><linearGradient id="logoGrad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="#6366F1"/><stop offset="100%" stop-color="#8B5CF6"/></linearGradient></defs>
|
|
22
|
-
<circle cx="50" cy="50" r="45" fill="url(#logoGrad)"/>
|
|
23
|
-
<path d="M30 50 L45 65 L70 35" stroke="white" stroke-width="8" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
|
24
|
-
</svg>
|
|
25
|
-
Foliko
|
|
26
|
-
</a>
|
|
27
|
-
<div class="nav-links">
|
|
28
|
-
<a href="#features" class="nav-link">核心特性</a>
|
|
29
|
-
<a href="#architecture" class="nav-link">架构设计</a>
|
|
30
|
-
<a href="#plugins" class="nav-link">插件生态</a>
|
|
31
|
-
<a href="#examples" class="nav-link">示例</a>
|
|
32
|
-
<a href="#quickstart" class="nav-link">快速开始</a>
|
|
33
|
-
<a href="docs/configuration.html" class="nav-link">文档</a>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="nav-actions">
|
|
36
|
-
<a href="#quickstart" class="btn btn-primary">立即开始</a>
|
|
37
|
-
<button class="nav-toggle" aria-label="菜单"><span></span><span></span><span></span></button>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
</nav>
|
|
41
|
-
|
|
42
|
-
<!-- Hero Section -->
|
|
43
|
-
<section class="hero">
|
|
44
|
-
<div class="hero-bg"></div>
|
|
45
|
-
<div class="hero-glow"></div>
|
|
46
|
-
<div class="hero-grid"></div>
|
|
47
|
-
<div class="hero-content">
|
|
48
|
-
<div class="hero-badge">v2.0 发布 - 全新 Ambient Agent</div>
|
|
49
|
-
<h1 class="hero-title">轻松构建<span class="text-gradient">智能 Agent</span></h1>
|
|
50
|
-
<p class="hero-subtitle">纯 JavaScript 开发的简约插件化 Agent 框架。支持多 AI、流式输出、子 Agent 系统,40+ 内置插件,开箱即用。</p>
|
|
51
|
-
|
|
52
|
-
<div class="install-box">
|
|
53
|
-
<div class="install-tabs">
|
|
54
|
-
<button class="tab active" data-cmd="irm https://folikoai.com/install.ps1 | iex">Windows</button>
|
|
55
|
-
<button class="tab" data-cmd="curl -fsSL https://folikoai.com/install.sh | bash">Mac / Linux</button>
|
|
56
|
-
<button class="tab" data-cmd="npm install -g foliko">npm</button>
|
|
57
|
-
</div>
|
|
58
|
-
<div class="install-cmd">
|
|
59
|
-
<code id="install-cmd">irm https://folikoai.com/install.ps1 | iex</code>
|
|
60
|
-
<button class="copy-btn" onclick="copyCmd()">复制</button>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
|
|
64
|
-
<div class="hero-links">
|
|
65
|
-
<a href="#features">核心特性</a>
|
|
66
|
-
<a href="#architecture">架构设计</a>
|
|
67
|
-
<a href="#plugins">插件生态</a>
|
|
68
|
-
<a href="#examples">示例</a>
|
|
69
|
-
<a href="#quickstart">快速开始</a>
|
|
70
|
-
</div>
|
|
71
|
-
|
|
72
|
-
<div class="hero-stats">
|
|
73
|
-
<div class="hero-stat"><div class="hero-stat-value">40+</div><div class="hero-stat-label">插件</div></div>
|
|
74
|
-
<div class="hero-stat"><div class="hero-stat-value">5+</div><div class="hero-stat-label">AI 提供商</div></div>
|
|
75
|
-
<div class="hero-stat"><div class="hero-stat-value">100%</div><div class="hero-stat-label">纯 JavaScript</div></div>
|
|
76
|
-
<div class="hero-stat"><div class="hero-stat-value">MIT</div><div class="hero-stat-label">开源协议</div></div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
</section>
|
|
80
|
-
|
|
81
|
-
<!-- Features Section -->
|
|
82
|
-
<section id="features" class="section">
|
|
83
|
-
<div class="container">
|
|
84
|
-
<div class="section-header">
|
|
85
|
-
<div class="section-label">
|
|
86
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/></svg>
|
|
87
|
-
核心特性
|
|
88
|
-
</div>
|
|
89
|
-
<h2 class="section-title">构建 AI Agent 所需的一切</h2>
|
|
90
|
-
<p class="section-subtitle">Foliko 提供完整的工具包,从简单的聊天机器人到复杂的多 Agent 系统,都能轻松实现。</p>
|
|
91
|
-
</div>
|
|
92
|
-
<div class="features-grid">
|
|
93
|
-
<div class="feature-card">
|
|
94
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M12 2L2 7l10 5 10-5-10-5z"/><path d="M2 17l10 5 10-5"/><path d="M2 12l10 5 10-5"/></svg></div>
|
|
95
|
-
<h3 class="feature-title">插件系统</h3>
|
|
96
|
-
<p class="feature-desc">可扩展的插件架构,40+ 内置插件,覆盖工具、消息、数据处理等场景。</p>
|
|
97
|
-
</div>
|
|
98
|
-
<div class="feature-card">
|
|
99
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/><path d="M12 6v6l4 2"/></svg></div>
|
|
100
|
-
<h3 class="feature-title">多 AI 支持</h3>
|
|
101
|
-
<p class="feature-desc">无缝切换 Anthropic、DeepSeek、MiniMax 等多种 AI 提供商,统一 API 接口。</p>
|
|
102
|
-
</div>
|
|
103
|
-
<div class="feature-card">
|
|
104
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M13 2L3 14h9l-1 8 10-12h-9l1-8z"/></svg></div>
|
|
105
|
-
<h3 class="feature-title">流式输出</h3>
|
|
106
|
-
<p class="feature-desc">实时流式响应,即时反馈。完美适配交互式应用和聊天界面。</p>
|
|
107
|
-
</div>
|
|
108
|
-
<div class="feature-card">
|
|
109
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="21" x2="9" y2="9"/></svg></div>
|
|
110
|
-
<h3 class="feature-title">子 Agent 系统</h3>
|
|
111
|
-
<p class="feature-desc">创建层级式 Agent 结构,主 Agent 可将任务委托给专业子 Agent。</p>
|
|
112
|
-
</div>
|
|
113
|
-
<div class="feature-card">
|
|
114
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/></svg></div>
|
|
115
|
-
<h3 class="feature-title">Ambient Agent</h3>
|
|
116
|
-
<p class="feature-desc">持续后台运行的 Agent,支持目标管理、主动监控和定时任务。</p>
|
|
117
|
-
</div>
|
|
118
|
-
<div class="feature-card">
|
|
119
|
-
<div class="feature-icon"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg></div>
|
|
120
|
-
<h3 class="feature-title">记忆系统</h3>
|
|
121
|
-
<p class="feature-desc">持久化对话历史,支持语义搜索。Agent 可跨会话记忆和召回信息。</p>
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</section>
|
|
126
|
-
|
|
127
|
-
<!-- Architecture Section -->
|
|
128
|
-
<section id="architecture" class="section architecture">
|
|
129
|
-
<div class="container">
|
|
130
|
-
<div class="section-header">
|
|
131
|
-
<div class="section-label"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>架构设计</div>
|
|
132
|
-
<h2 class="section-title">简洁而强大</h2>
|
|
133
|
-
<p class="section-subtitle">基于清晰架构构建,分离关注点,同时保持灵活性和可扩展性。</p>
|
|
134
|
-
</div>
|
|
135
|
-
|
|
136
|
-
<div class="arch-grid">
|
|
137
|
-
<div class="arch-card">
|
|
138
|
-
<h3>分层上下文</h3>
|
|
139
|
-
<p class="arch-subtitle">三层隔离,互不干扰</p>
|
|
140
|
-
<ul class="arch-list">
|
|
141
|
-
<li><strong>Request Context</strong> - 请求级链路追踪、超时控制</li>
|
|
142
|
-
<li><strong>Session Context</strong> - 会话级消息、变量、元数据</li>
|
|
143
|
-
<li><strong>Agent Context</strong> - Agent 级工具、技能、系统提示</li>
|
|
144
|
-
</ul>
|
|
145
|
-
</div>
|
|
146
|
-
<div class="arch-card">
|
|
147
|
-
<h3>Framework 层</h3>
|
|
148
|
-
<p class="arch-subtitle">容器层,核心管理</p>
|
|
149
|
-
<ul class="arch-list">
|
|
150
|
-
<li><strong>pluginManager</strong> - 插件生命周期管理</li>
|
|
151
|
-
<li><strong>toolRegistry</strong> - 工具注册与执行</li>
|
|
152
|
-
<li><strong>skillManager</strong> - 技能加载与管理</li>
|
|
153
|
-
<li><strong>eventEmitter</strong> - 事件总线</li>
|
|
154
|
-
</ul>
|
|
155
|
-
</div>
|
|
156
|
-
<div class="arch-card">
|
|
157
|
-
<h3>Agent 层</h3>
|
|
158
|
-
<p class="arch-subtitle">对话层,AI 交互</p>
|
|
159
|
-
<ul class="arch-list">
|
|
160
|
-
<li><strong>chat()</strong> - 发送消息</li>
|
|
161
|
-
<li><strong>chatStream()</strong> - 流式响应</li>
|
|
162
|
-
<li><strong>工具调用</strong> - 来自 Framework</li>
|
|
163
|
-
<li><strong>事件系统</strong> - 消息/工具事件</li>
|
|
164
|
-
</ul>
|
|
165
|
-
</div>
|
|
166
|
-
</div>
|
|
167
|
-
|
|
168
|
-
<div class="code-block">
|
|
169
|
-
<div class="code-header"><span class="code-dot red"></span><span class="code-dot yellow"></span><span class="code-dot green"></span></div>
|
|
170
|
-
<div class="code-content"><pre><code>src/
|
|
171
|
-
├── core/ # Framework、Agent、PluginManager、ToolRegistry
|
|
172
|
-
├── capabilities/ # SkillManager、WorkflowEngine
|
|
173
|
-
├── executors/ # MCPExecutor MCP 服务器集成
|
|
174
|
-
└── utils/ # EventEmitter、logger
|
|
175
|
-
|
|
176
|
-
plugins/ # 内置插件(40+ 插件)
|
|
177
|
-
cli/bin/ # CLI 入口
|
|
178
|
-
examples/ # 示例代码
|
|
179
|
-
.foliko/ # 用户配置(插件、技能、子 Agent)
|
|
180
|
-
skills/ # 技能目录
|
|
181
|
-
docs/ # 文档</code></pre></div>
|
|
182
|
-
</div>
|
|
183
|
-
</div>
|
|
184
|
-
</section>
|
|
185
|
-
|
|
186
|
-
<!-- Plugins Section -->
|
|
187
|
-
<section id="plugins" class="section">
|
|
188
|
-
<div class="container">
|
|
189
|
-
<div class="section-header">
|
|
190
|
-
<div class="section-label"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"/><line x1="7" y1="7" x2="7.01" y2="7"/></svg>插件生态</div>
|
|
191
|
-
<h2 class="section-title">40+ 内置插件</h2>
|
|
192
|
-
<p class="section-subtitle">全面的插件生态系统,覆盖工具、消息、数据处理和热门服务集成。</p>
|
|
193
|
-
</div>
|
|
194
|
-
<div class="plugin-category">
|
|
195
|
-
<h3>核心系统</h3>
|
|
196
|
-
<div class="plugins-grid">
|
|
197
|
-
<div class="plugin-card"><div class="plugin-name">ai</div><div class="plugin-desc">AI 对话能力,多提供商支持</div><span class="plugin-tag">核心</span></div>
|
|
198
|
-
<div class="plugin-card"><div class="plugin-name">session</div><div class="plugin-desc">多会话管理、隔离、历史</div><span class="plugin-tag">核心</span></div>
|
|
199
|
-
<div class="plugin-card"><div class="plugin-name">storage</div><div class="plugin-desc">键值对持久化存储</div><span class="plugin-tag">核心</span></div>
|
|
200
|
-
<div class="plugin-card"><div class="plugin-name">scheduler</div><div class="plugin-desc">定时任务调度,Cron 表达式</div><span class="plugin-tag">核心</span></div>
|
|
201
|
-
</div>
|
|
202
|
-
</div>
|
|
203
|
-
<div class="plugin-category">
|
|
204
|
-
<h3>执行工具</h3>
|
|
205
|
-
<div class="plugins-grid">
|
|
206
|
-
<div class="plugin-card"><div class="plugin-name">shell</div><div class="plugin-desc">Shell 命令执行</div><span class="plugin-tag">工具</span></div>
|
|
207
|
-
<div class="plugin-card"><div class="plugin-name">python</div><div class="plugin-desc">Python 代码执行</div><span class="plugin-tag">工具</span></div>
|
|
208
|
-
<div class="plugin-card"><div class="plugin-name">mcp</div><div class="plugin-desc">Model Context Protocol</div><span class="plugin-tag">工具</span></div>
|
|
209
|
-
<div class="plugin-card"><div class="plugin-name">file-system</div><div class="plugin-desc">文件系统操作</div><span class="plugin-tag">工具</span></div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
<div class="plugin-category">
|
|
213
|
-
<h3>即时通讯</h3>
|
|
214
|
-
<div class="plugins-grid">
|
|
215
|
-
<div class="plugin-card"><div class="plugin-name">telegram</div><div class="plugin-desc">Telegram Bot 对话</div><span class="plugin-tag">通讯</span></div>
|
|
216
|
-
<div class="plugin-card"><div class="plugin-name">feishu</div><div class="plugin-desc">飞书 WebSocket 消息</div><span class="plugin-tag">通讯</span></div>
|
|
217
|
-
<div class="plugin-card"><div class="plugin-name">weixin</div><div class="plugin-desc">微信网页账号对话</div><span class="plugin-tag">通讯</span></div>
|
|
218
|
-
<div class="plugin-card"><div class="plugin-name">email</div><div class="plugin-desc">SMTP/IMAP 邮件收发</div><span class="plugin-tag">通讯</span></div>
|
|
219
|
-
</div>
|
|
220
|
-
</div>
|
|
221
|
-
<div class="plugin-category">
|
|
222
|
-
<h3>智能代理</h3>
|
|
223
|
-
<div class="plugins-grid">
|
|
224
|
-
<div class="plugin-card"><div class="plugin-name">subagent</div><div class="plugin-desc">子 Agent 隔离管理</div><span class="plugin-tag">代理</span></div>
|
|
225
|
-
<div class="plugin-card"><div class="plugin-name">ambient-agent</div><div class="plugin-desc">持续后台运行、目标管理</div><span class="plugin-tag">代理</span></div>
|
|
226
|
-
<div class="plugin-card"><div class="plugin-name">think</div><div class="plugin-desc">LLM 自我唤醒、持续思考</div><span class="plugin-tag">代理</span></div>
|
|
227
|
-
<div class="plugin-card"><div class="plugin-name">memory</div><div class="plugin-desc">四层记忆系统</div><span class="plugin-tag">代理</span></div>
|
|
228
|
-
</div>
|
|
229
|
-
</div>
|
|
230
|
-
<div class="plugin-category">
|
|
231
|
-
<h3>服务与扩展</h3>
|
|
232
|
-
<div class="plugins-grid">
|
|
233
|
-
<div class="plugin-card"><div class="plugin-name">web</div><div class="plugin-desc">HTTP 服务、Webhook 接收</div><span class="plugin-tag">服务</span></div>
|
|
234
|
-
<div class="plugin-card"><div class="plugin-name">gate-trading</div><div class="plugin-desc">Gate.io 加密货币交易</div><span class="plugin-tag">交易</span></div>
|
|
235
|
-
<div class="plugin-card"><div class="plugin-name">audit</div><div class="plugin-desc">日志记录、审计统计</div><span class="plugin-tag">运维</span></div>
|
|
236
|
-
<div class="plugin-card"><div class="plugin-name">rules</div><div class="plugin-desc">行为规则引擎</div><span class="plugin-tag">规则</span></div>
|
|
237
|
-
</div>
|
|
238
|
-
</div>
|
|
239
|
-
<div class="plugin-category">
|
|
240
|
-
<h3>高级功能</h3>
|
|
241
|
-
<div class="plugins-grid">
|
|
242
|
-
<div class="plugin-card"><div class="plugin-name">coordinator</div><div class="plugin-desc">多 Worker 协作调度</div><span class="plugin-tag">高级</span></div>
|
|
243
|
-
<div class="plugin-card"><div class="plugin-name">python-plugin-loader</div><div class="plugin-desc">Python 插件加载器</div><span class="plugin-tag">高级</span></div>
|
|
244
|
-
<div class="plugin-card"><div class="plugin-name">extension-executor</div><div class="plugin-desc">扩展插件执行器</div><span class="plugin-tag">高级</span></div>
|
|
245
|
-
<div class="plugin-card"><div class="plugin-name">plugin-manager</div><div class="plugin-desc">插件生命周期管理</div><span class="plugin-tag">核心</span></div>
|
|
246
|
-
</div>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
</section>
|
|
250
|
-
|
|
251
|
-
<!-- Quick Start Section -->
|
|
252
|
-
<section id="quickstart" class="section quickstart">
|
|
253
|
-
<div class="container">
|
|
254
|
-
<div class="section-header">
|
|
255
|
-
<div class="section-label"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/></svg>快速开始</div>
|
|
256
|
-
<h2 class="section-title">几分钟内快速上手</h2>
|
|
257
|
-
<p class="section-subtitle">安装 Foliko,创建你的第一个 Agent,只需几分钟。</p>
|
|
258
|
-
</div>
|
|
259
|
-
|
|
260
|
-
<div class="code-block">
|
|
261
|
-
<h3>安装</h3>
|
|
262
|
-
<pre><code>npm install -g foliko</code></pre>
|
|
263
|
-
</div>
|
|
264
|
-
|
|
265
|
-
<div class="code-block">
|
|
266
|
-
<h3>配置 AI</h3>
|
|
267
|
-
<pre><code># 创建 .env 文件
|
|
268
|
-
touch .env
|
|
269
|
-
|
|
270
|
-
# MiniMax 配置
|
|
271
|
-
FOLIKO_PROVIDER=minimax
|
|
272
|
-
MINIMAX_API_KEY=sk-your-api-key
|
|
273
|
-
|
|
274
|
-
# DeepSeek 配置
|
|
275
|
-
FOLIKO_PROVIDER=deepseek
|
|
276
|
-
DEEPSEEK_API_KEY=sk-your-api-key</code></pre>
|
|
277
|
-
</div>
|
|
278
|
-
|
|
279
|
-
<div class="code-block">
|
|
280
|
-
<h3>启动对话</h3>
|
|
281
|
-
<pre><code>foliko chat</code></pre>
|
|
282
|
-
</div>
|
|
283
|
-
|
|
284
|
-
<div class="code-block">
|
|
285
|
-
<h3>编程使用</h3>
|
|
286
|
-
<pre><code>const { Framework } = require('foliko')
|
|
287
|
-
|
|
288
|
-
const framework = new Framework()
|
|
289
|
-
framework.loadPlugin('ai')
|
|
290
|
-
|
|
291
|
-
const agent = framework.createAgent({
|
|
292
|
-
systemPrompt: '你是一个有帮助的助手'
|
|
293
|
-
})
|
|
294
|
-
|
|
295
|
-
const result = await agent.chat('你好')
|
|
296
|
-
console.log(result.message)</code></pre>
|
|
297
|
-
</div>
|
|
298
|
-
</div>
|
|
299
|
-
</section>
|
|
300
|
-
|
|
301
|
-
<!-- Examples Section -->
|
|
302
|
-
<section id="examples" class="section examples-section">
|
|
303
|
-
<div class="container">
|
|
304
|
-
<div class="section-header">
|
|
305
|
-
<div class="section-label"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>代码示例</div>
|
|
306
|
-
<h2 class="section-title">丰富的示例代码</h2>
|
|
307
|
-
<p class="section-subtitle\">从基础到高级,19+ 示例覆盖各种使用场景。</p>
|
|
308
|
-
</div>
|
|
309
|
-
<div class="examples-grid">
|
|
310
|
-
<div class="example-card">
|
|
311
|
-
<div class="example-header">
|
|
312
|
-
<span class="example-tag">基础</span>
|
|
313
|
-
<h4>basic.js</h4>
|
|
314
|
-
</div>
|
|
315
|
-
<p class="example-desc">最简单的基础示例,展示 Foliko 的核心用法</p>
|
|
316
|
-
<div class="example-code"><pre><code>const { Framework } = require('foliko')
|
|
317
|
-
const framework = new Framework()
|
|
318
|
-
const agent = framework.createAgent()
|
|
319
|
-
const result = await agent.chat('Hello')</code></pre></div>
|
|
320
|
-
</div>
|
|
321
|
-
<div class="example-card">
|
|
322
|
-
<div class="example-header">
|
|
323
|
-
<span class="example-tag">高级</span>
|
|
324
|
-
<h4>ambient-example.js</h4>
|
|
325
|
-
</div>
|
|
326
|
-
<p class="example-desc">Ambient Agent 完整示例,目标管理与持续运行</p>
|
|
327
|
-
<div class="example-code"><pre><code>// 创建持续运行的目标
|
|
328
|
-
const goal = await ambient.goals({
|
|
329
|
-
action: 'create',
|
|
330
|
-
title: '监控新邮件',
|
|
331
|
-
description: '每小时检查新邮件'
|
|
332
|
-
})</code></pre></div>
|
|
333
|
-
</div>
|
|
334
|
-
<div class="example-card">
|
|
335
|
-
<div class="example-header">
|
|
336
|
-
<span class="example-tag">集成</span>
|
|
337
|
-
<h4>test-telegram.js</h4>
|
|
338
|
-
</div>
|
|
339
|
-
<p class="example-desc">Telegram Bot 集成示例</p>
|
|
340
|
-
<div class="example-code"><pre><code>framework.loadPlugin('telegram', {
|
|
341
|
-
botToken: process.env.TELEGRAM_BOT_TOKEN
|
|
342
|
-
})</code></pre></div>
|
|
343
|
-
</div>
|
|
344
|
-
<div class="example-card">
|
|
345
|
-
<div class="example-header">
|
|
346
|
-
<span class="example-tag">集成</span>
|
|
347
|
-
<h4>test-weixin-feishu.js</h4>
|
|
348
|
-
</div>
|
|
349
|
-
<p class="example-desc">微信和飞书消息推送集成</p>
|
|
350
|
-
<div class="example-code"><pre><code>framework.loadPlugin('weixin')
|
|
351
|
-
framework.loadPlugin('feishu')</code></pre></div>
|
|
352
|
-
</div>
|
|
353
|
-
<div class="example-card">
|
|
354
|
-
<div class="example-header">
|
|
355
|
-
<span class="example-tag">工作流</span>
|
|
356
|
-
<h4>workflow.js</h4>
|
|
357
|
-
</div>
|
|
358
|
-
<p class="example-desc">多步骤工作流编排示例</p>
|
|
359
|
-
<div class="example-code"><pre><code>const workflow = await agent.workflow([
|
|
360
|
-
{ task: '分析需求' },
|
|
361
|
-
{ task: '生成代码' },
|
|
362
|
-
{ task: '执行测试' }
|
|
363
|
-
])</code></pre></div>
|
|
364
|
-
</div>
|
|
365
|
-
<div class="example-card">
|
|
366
|
-
<div class="example-header">
|
|
367
|
-
<span class="example-tag">技能</span>
|
|
368
|
-
<h4>skill-example.js</h4>
|
|
369
|
-
</div>
|
|
370
|
-
<p class="example-desc">自定义技能加载与使用</p>
|
|
371
|
-
<div class="example-code"><pre><code>await agent.loadSkill('my-skill')
|
|
372
|
-
const result = await agent.chat('使用技能')</code></pre></div>
|
|
373
|
-
</div>
|
|
374
|
-
<div class="example-card">
|
|
375
|
-
<div class="example-header">
|
|
376
|
-
<span class="example-tag">MCP</span>
|
|
377
|
-
<h4>mcp-example.js</h4>
|
|
378
|
-
</div>
|
|
379
|
-
<p class="example-desc">Model Context Protocol 服务器集成</p>
|
|
380
|
-
<div class="example-code"><pre><code>framework.loadPlugin('mcp', {
|
|
381
|
-
servers: ['fetch', 'filesystem']
|
|
382
|
-
})</code></pre></div>
|
|
383
|
-
</div>
|
|
384
|
-
<div class="example-card">
|
|
385
|
-
<div class="example-header">
|
|
386
|
-
<span class="example-tag">Web</span>
|
|
387
|
-
<h4>test-web-plugin.js</h4>
|
|
388
|
-
</div>
|
|
389
|
-
<p class="example-desc">Web 服务与 Webhook 接收</p>
|
|
390
|
-
<div class="example-code"><pre><code>framework.loadPlugin('web', { port: 3000 })
|
|
391
|
-
framework.web.registerWebhook('/hook', handler)</code></pre></div>
|
|
392
|
-
</div>
|
|
393
|
-
</div>
|
|
394
|
-
<!-- 更多示例已隐藏
|
|
395
|
-
<div class="examples-more">
|
|
396
|
-
<p>更多示例:test-session-chat.js, test-concurrent-chat.js, test-long-chat.js, test-reload.js, test-think.js 等</p>
|
|
397
|
-
<a href="https://github.com/your-repo/foliko/tree/main/examples" class="btn btn-outline">查看所有示例</a>
|
|
398
|
-
</div>
|
|
399
|
-
-->
|
|
400
|
-
</div>
|
|
401
|
-
</section>
|
|
402
|
-
|
|
403
|
-
<!-- Docker Section (已隐藏)
|
|
404
|
-
<section id="docker" class="section docker-section" style="display: none;">
|
|
405
|
-
<div class="container">
|
|
406
|
-
<div class="section-header">
|
|
407
|
-
<div class="section-label"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z"/><polyline points="3.27 6.96 12 12.01 20.73 6.96"/><line x1="12" y1="22.08" x2="12" y2="12"/></svg>Docker 部署</div>
|
|
408
|
-
<h2 class="section-title">一行命令快速部署</h2>
|
|
409
|
-
<p class="section-subtitle">支持 Docker Compose 一键部署,开箱即用。</p>
|
|
410
|
-
</div>
|
|
411
|
-
<div class="code-block">
|
|
412
|
-
<h3>1. 克隆项目</h3>
|
|
413
|
-
<pre><code>git clone https://github.com/your-repo/foliko.git
|
|
414
|
-
cd foliko</code></pre>
|
|
415
|
-
</div>
|
|
416
|
-
<div class="code-block">
|
|
417
|
-
<h3>2. 配置环境变量</h3>
|
|
418
|
-
<pre><code># 复制环境变量模板
|
|
419
|
-
cp .env.example .env
|
|
420
|
-
|
|
421
|
-
# 编辑 .env 填入你的 API Key
|
|
422
|
-
vim .env</code></pre>
|
|
423
|
-
</div>
|
|
424
|
-
<div class="code-block">
|
|
425
|
-
<h3>3. 启动服务</h3>
|
|
426
|
-
<pre><code># 启动所有服务(Agent + Web 服务)
|
|
427
|
-
docker-compose up -d
|
|
428
|
-
|
|
429
|
-
# 查看运行状态
|
|
430
|
-
docker-compose ps</code></pre>
|
|
431
|
-
</div>
|
|
432
|
-
<div class="docker-features">
|
|
433
|
-
<div class="docker-feature">
|
|
434
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
|
|
435
|
-
<span>自动安装依赖</span>
|
|
436
|
-
</div>
|
|
437
|
-
<div class="docker-feature">
|
|
438
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
|
|
439
|
-
<span>持久化数据卷</span>
|
|
440
|
-
</div>
|
|
441
|
-
<div class="docker-feature">
|
|
442
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
|
|
443
|
-
<span>Web 服务默认端口 8088</span>
|
|
444
|
-
</div>
|
|
445
|
-
<div class="docker-feature">
|
|
446
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
|
|
447
|
-
<span>支持自定义域名</span>
|
|
448
|
-
</div>
|
|
449
|
-
</div>
|
|
450
|
-
</div>
|
|
451
|
-
</section-->
|
|
452
|
-
|
|
453
|
-
<!-- Footer -->
|
|
454
|
-
<footer class="footer">
|
|
455
|
-
<div class="container">
|
|
456
|
-
<div class="footer-grid">
|
|
457
|
-
<div class="footer-brand">
|
|
458
|
-
<div class="footer-logo">
|
|
459
|
-
<svg viewBox="0 0 100 100" width="32" height="32" fill="none"><defs><linearGradient id="fGrad" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="#6366F1"/><stop offset="100%" stop-color="#8B5CF6"/></linearGradient></defs><circle cx="50" cy="50" r="45" fill="url(#fGrad)"/><path d="M30 50 L45 65 L70 35" stroke="white" stroke-width="8" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>
|
|
460
|
-
Foliko
|
|
461
|
-
</div>
|
|
462
|
-
<p class="footer-desc">纯 JavaScript 开发的简约插件化 Agent 框架。开源免费,MIT 协议。</p>
|
|
463
|
-
</div>
|
|
464
|
-
<div>
|
|
465
|
-
<h4 class="footer-title">产品</h4>
|
|
466
|
-
<div class="footer-links"><a href="#features" class="footer-link">核心特性</a><a href="#plugins" class="footer-link">插件生态</a><a href="#examples" class="footer-link">代码示例</a><a href="#quickstart" class="footer-link">快速开始</a></div>
|
|
467
|
-
</div>
|
|
468
|
-
<div>
|
|
469
|
-
<h4 class="footer-title">资源</h4>
|
|
470
|
-
<div class="footer-links"><a href="#examples" class="footer-link">代码示例</a><a href="docs/configuration.html" class="footer-link">文档</a><a href="docs/api.html" class="footer-link">API 参考</a></div>
|
|
471
|
-
</div>
|
|
472
|
-
<div>
|
|
473
|
-
<h4 class="footer-title">社区</h4>
|
|
474
|
-
<div class="footer-links"><a href="#" class="footer-link">GitHub</a><a href="#" class="footer-link">Discord</a><a href="#" class="footer-link">Twitter</a></div>
|
|
475
|
-
</div>
|
|
476
|
-
</div>
|
|
477
|
-
<div class="footer-bottom">
|
|
478
|
-
<p class="footer-copy">2024 Foliko. MIT 开源协议。</p>
|
|
479
|
-
<div class="footer-social">
|
|
480
|
-
<a href="#" class="social-link" aria-label="GitHub"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg></a>
|
|
481
|
-
<a href="#" class="social-link" aria-label="Twitter"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M23 3a10.9 10.9 0 0 1-3.14 1.53 4.48 4.48 0 0 0-7.86 3v1A10.66 10.66 0 0 1 3 4s-4 9 5 13a11.64 11.64 0 0 1-7 2c9 5 20 0 20-11.5a4.5 4.5 0 0 0-.08-.83A7.72 7.72 0 0 0 23 3z"/></svg></a>
|
|
482
|
-
</div>
|
|
483
|
-
</div>
|
|
484
|
-
</div>
|
|
485
|
-
</footer>
|
|
486
|
-
|
|
487
|
-
<script src="scripts/main.js"></script>
|
|
488
|
-
</body>
|
|
489
|
-
</html>
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
// Foliko v2 - Main JavaScript
|
|
2
|
-
|
|
3
|
-
// Mobile navigation toggle
|
|
4
|
-
document.addEventListener('DOMContentLoaded', () => {
|
|
5
|
-
const navToggle = document.querySelector('.nav-toggle');
|
|
6
|
-
const navLinks = document.querySelector('.nav-links');
|
|
7
|
-
|
|
8
|
-
if (navToggle && navLinks) {
|
|
9
|
-
navToggle.addEventListener('click', () => {
|
|
10
|
-
navLinks.classList.toggle('active');
|
|
11
|
-
navToggle.classList.toggle('active');
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
// Smooth scroll for anchor links
|
|
16
|
-
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
|
17
|
-
anchor.addEventListener('click', function(e) {
|
|
18
|
-
e.preventDefault();
|
|
19
|
-
const target = document.querySelector(this.getAttribute('href'));
|
|
20
|
-
if (target) {
|
|
21
|
-
target.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
|
22
|
-
// Close mobile menu if open
|
|
23
|
-
if (navLinks) navLinks.classList.remove('active');
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
// Copy install command
|
|
29
|
-
window.copyCmd = function() {
|
|
30
|
-
const code = document.getElementById('install-cmd');
|
|
31
|
-
if (code) {
|
|
32
|
-
navigator.clipboard.writeText(code.textContent).then(() => {
|
|
33
|
-
const btn = document.querySelector('.copy-btn');
|
|
34
|
-
if (btn) {
|
|
35
|
-
const originalText = btn.textContent;
|
|
36
|
-
btn.textContent = '已复制!';
|
|
37
|
-
btn.style.background = '#10B981';
|
|
38
|
-
setTimeout(() => {
|
|
39
|
-
btn.textContent = originalText;
|
|
40
|
-
btn.style.background = '';
|
|
41
|
-
}, 2000);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
// Install tabs
|
|
48
|
-
const tabs = document.querySelectorAll('.tab');
|
|
49
|
-
const installCmd = document.getElementById('install-cmd');
|
|
50
|
-
|
|
51
|
-
tabs.forEach(tab => {
|
|
52
|
-
tab.addEventListener('click', () => {
|
|
53
|
-
tabs.forEach(t => t.classList.remove('active'));
|
|
54
|
-
tab.classList.add('active');
|
|
55
|
-
if (installCmd) {
|
|
56
|
-
installCmd.textContent = tab.dataset.cmd;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
// Intersection Observer for animations
|
|
62
|
-
const observerOptions = {
|
|
63
|
-
threshold: 0.1,
|
|
64
|
-
rootMargin: '0px 0px -50px 0px'
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const observer = new IntersectionObserver((entries) => {
|
|
68
|
-
entries.forEach(entry => {
|
|
69
|
-
if (entry.isIntersecting) {
|
|
70
|
-
entry.target.classList.add('visible');
|
|
71
|
-
observer.unobserve(entry.target);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}, observerOptions);
|
|
75
|
-
|
|
76
|
-
// Observe elements for animation
|
|
77
|
-
document.querySelectorAll('.feature-card, .plugin-card, .arch-card, .code-block').forEach(el => {
|
|
78
|
-
el.style.opacity = '0';
|
|
79
|
-
el.style.transform = 'translateY(20px)';
|
|
80
|
-
el.style.transition = 'opacity 0.6s ease-out, transform 0.6s ease-out';
|
|
81
|
-
observer.observe(el);
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
// Add visible class styles dynamically
|
|
86
|
-
const style = document.createElement('style');
|
|
87
|
-
style.textContent = `
|
|
88
|
-
.visible {
|
|
89
|
-
opacity: 1 !important;
|
|
90
|
-
transform: translateY(0) !important;
|
|
91
|
-
}
|
|
92
|
-
`;
|
|
93
|
-
document.head.appendChild(style);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/* Foliko v2 - Animations */
|
|
2
|
-
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
|
|
3
|
-
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
|
-
@keyframes glow { 0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); } 50% { opacity: 0.7; transform: translateX(-50%) scale(1.1); } }
|
|
5
|
-
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.2); } }
|
|
6
|
-
.reveal { opacity: 0; transform: translateY(30px); transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
|
|
7
|
-
.reveal.visible { opacity: 1; transform: translateY(0); }
|
|
8
|
-
|