foliko 2.0.30 → 2.0.32
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/.editorconfig +56 -56
- package/.lintstagedrc +7 -7
- package/.prettierignore +29 -29
- package/.prettierrc +11 -11
- package/Dockerfile +63 -63
- package/docs/plugin-dev-guide.md +850 -0
- package/install.ps1 +129 -129
- package/install.sh +121 -121
- package/package.json +1 -1
- package/plugins/core/workflow/context.js +941 -941
- package/plugins/core/workflow/engine.js +66 -66
- package/plugins/core/workflow/js-runner.js +318 -318
- package/plugins/core/workflow/json-runner.js +323 -323
- package/plugins/core/workflow/stages/choice.js +74 -74
- package/plugins/core/workflow/stages/each.js +123 -123
- package/plugins/core/workflow/stages/parallel.js +69 -69
- package/skills/find-skills/SKILL.md +133 -133
- package/src/agent/chat.js +31 -9
- package/src/agent/sub.js +17 -3
- package/src/agent/tool-loop.js +132 -37
- package/src/common/atomic-write.js +33 -0
- package/src/context/compressor.js +22 -18
- package/src/framework/framework.js +19 -1
- package/src/plugin/manager.js +12 -2
- package/src/session/session.js +9 -4
- package/src/storage/manager.js +3 -1
- package/tests/core/chat-tool.test.js +187 -187
- package/tests/core/latest-message-not-filtered.test.js +143 -0
- package/tests/core/p0-fixes.test.js +129 -0
- package/tests/core/p1-fixes.test.js +76 -0
package/.editorconfig
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
-
|
|
3
|
-
# top-most EditorConfig file
|
|
4
|
-
root = true
|
|
5
|
-
|
|
6
|
-
# 代码文件
|
|
7
|
-
[*]
|
|
8
|
-
charset = utf-8
|
|
9
|
-
end_of_line = lf
|
|
10
|
-
insert_final_newline = true
|
|
11
|
-
trim_trailing_whitespace = true
|
|
12
|
-
|
|
13
|
-
# JavaScript / Node.js
|
|
14
|
-
[*.{js,jsx,mjs,cjs}]
|
|
15
|
-
indent_style = space
|
|
16
|
-
indent_size = 2
|
|
17
|
-
|
|
18
|
-
# TypeScript
|
|
19
|
-
[*.{ts,tsx}]
|
|
20
|
-
indent_style = space
|
|
21
|
-
indent_size = 2
|
|
22
|
-
|
|
23
|
-
# JSON
|
|
24
|
-
[*.json]
|
|
25
|
-
indent_style = space
|
|
26
|
-
indent_size = 2
|
|
27
|
-
|
|
28
|
-
# YAML
|
|
29
|
-
[*.{yaml,yml}]
|
|
30
|
-
indent_style = space
|
|
31
|
-
indent_size = 2
|
|
32
|
-
|
|
33
|
-
# Markdown
|
|
34
|
-
[*.md]
|
|
35
|
-
trim_trailing_whitespace = false
|
|
36
|
-
indent_style = space
|
|
37
|
-
indent_size = 2
|
|
38
|
-
|
|
39
|
-
# Shell
|
|
40
|
-
[*.sh]
|
|
41
|
-
indent_style = space
|
|
42
|
-
indent_size = 2
|
|
43
|
-
|
|
44
|
-
# PowerShell
|
|
45
|
-
[*.ps1]
|
|
46
|
-
indent_style = space
|
|
47
|
-
indent_size = 4
|
|
48
|
-
|
|
49
|
-
# Dockerfile
|
|
50
|
-
[Dockerfile]
|
|
51
|
-
indent_style = space
|
|
52
|
-
indent_size = 4
|
|
53
|
-
|
|
54
|
-
# Makefile
|
|
55
|
-
[Makefile]
|
|
56
|
-
indent_style = tab
|
|
1
|
+
# EditorConfig is awesome: https://EditorConfig.org
|
|
2
|
+
|
|
3
|
+
# top-most EditorConfig file
|
|
4
|
+
root = true
|
|
5
|
+
|
|
6
|
+
# 代码文件
|
|
7
|
+
[*]
|
|
8
|
+
charset = utf-8
|
|
9
|
+
end_of_line = lf
|
|
10
|
+
insert_final_newline = true
|
|
11
|
+
trim_trailing_whitespace = true
|
|
12
|
+
|
|
13
|
+
# JavaScript / Node.js
|
|
14
|
+
[*.{js,jsx,mjs,cjs}]
|
|
15
|
+
indent_style = space
|
|
16
|
+
indent_size = 2
|
|
17
|
+
|
|
18
|
+
# TypeScript
|
|
19
|
+
[*.{ts,tsx}]
|
|
20
|
+
indent_style = space
|
|
21
|
+
indent_size = 2
|
|
22
|
+
|
|
23
|
+
# JSON
|
|
24
|
+
[*.json]
|
|
25
|
+
indent_style = space
|
|
26
|
+
indent_size = 2
|
|
27
|
+
|
|
28
|
+
# YAML
|
|
29
|
+
[*.{yaml,yml}]
|
|
30
|
+
indent_style = space
|
|
31
|
+
indent_size = 2
|
|
32
|
+
|
|
33
|
+
# Markdown
|
|
34
|
+
[*.md]
|
|
35
|
+
trim_trailing_whitespace = false
|
|
36
|
+
indent_style = space
|
|
37
|
+
indent_size = 2
|
|
38
|
+
|
|
39
|
+
# Shell
|
|
40
|
+
[*.sh]
|
|
41
|
+
indent_style = space
|
|
42
|
+
indent_size = 2
|
|
43
|
+
|
|
44
|
+
# PowerShell
|
|
45
|
+
[*.ps1]
|
|
46
|
+
indent_style = space
|
|
47
|
+
indent_size = 4
|
|
48
|
+
|
|
49
|
+
# Dockerfile
|
|
50
|
+
[Dockerfile]
|
|
51
|
+
indent_style = space
|
|
52
|
+
indent_size = 4
|
|
53
|
+
|
|
54
|
+
# Makefile
|
|
55
|
+
[Makefile]
|
|
56
|
+
indent_style = tab
|
package/.lintstagedrc
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
{
|
|
2
|
-
"*.{js,jsx,ts,tsx}": ["prettier --write", "git add"],
|
|
3
|
-
"*.{json,yaml,yml}": ["prettier --write", "git add"],
|
|
4
|
-
"*.{md,mdx}": ["prettier --write", "git add"],
|
|
5
|
-
"*.{css,scss,less}": ["prettier --write", "git add"],
|
|
6
|
-
"*.{html,svg}": ["prettier --write", "git add"]
|
|
7
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"*.{js,jsx,ts,tsx}": ["prettier --write", "git add"],
|
|
3
|
+
"*.{json,yaml,yml}": ["prettier --write", "git add"],
|
|
4
|
+
"*.{md,mdx}": ["prettier --write", "git add"],
|
|
5
|
+
"*.{css,scss,less}": ["prettier --write", "git add"],
|
|
6
|
+
"*.{html,svg}": ["prettier --write", "git add"]
|
|
7
|
+
}
|
package/.prettierignore
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
# 依赖
|
|
2
|
-
node_modules/
|
|
3
|
-
pnpm-lock.yaml
|
|
4
|
-
yarn.lock
|
|
5
|
-
package-lock.json
|
|
6
|
-
|
|
7
|
-
# 构建输出
|
|
8
|
-
dist/
|
|
9
|
-
build/
|
|
10
|
-
out/
|
|
11
|
-
|
|
12
|
-
# 插件目录(第三方代码)
|
|
13
|
-
plugins/
|
|
14
|
-
|
|
15
|
-
# 测试报告
|
|
16
|
-
reports/
|
|
17
|
-
test_report.md
|
|
18
|
-
|
|
19
|
-
# 配置文件(不需要格式化)
|
|
20
|
-
.env
|
|
21
|
-
.env.example
|
|
22
|
-
|
|
23
|
-
# 静态资源
|
|
24
|
-
images/
|
|
25
|
-
audio/
|
|
26
|
-
public/
|
|
27
|
-
|
|
28
|
-
# 锁文件
|
|
29
|
-
*.lock
|
|
1
|
+
# 依赖
|
|
2
|
+
node_modules/
|
|
3
|
+
pnpm-lock.yaml
|
|
4
|
+
yarn.lock
|
|
5
|
+
package-lock.json
|
|
6
|
+
|
|
7
|
+
# 构建输出
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
out/
|
|
11
|
+
|
|
12
|
+
# 插件目录(第三方代码)
|
|
13
|
+
plugins/
|
|
14
|
+
|
|
15
|
+
# 测试报告
|
|
16
|
+
reports/
|
|
17
|
+
test_report.md
|
|
18
|
+
|
|
19
|
+
# 配置文件(不需要格式化)
|
|
20
|
+
.env
|
|
21
|
+
.env.example
|
|
22
|
+
|
|
23
|
+
# 静态资源
|
|
24
|
+
images/
|
|
25
|
+
audio/
|
|
26
|
+
public/
|
|
27
|
+
|
|
28
|
+
# 锁文件
|
|
29
|
+
*.lock
|
package/.prettierrc
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"semi": true,
|
|
3
|
-
"singleQuote": true,
|
|
4
|
-
"tabWidth": 2,
|
|
5
|
-
"trailingComma": "es5",
|
|
6
|
-
"printWidth": 100,
|
|
7
|
-
"bracketSpacing": true,
|
|
8
|
-
"arrowParens": "always",
|
|
9
|
-
"endOfLine": "lf",
|
|
10
|
-
"plugins": []
|
|
11
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"semi": true,
|
|
3
|
+
"singleQuote": true,
|
|
4
|
+
"tabWidth": 2,
|
|
5
|
+
"trailingComma": "es5",
|
|
6
|
+
"printWidth": 100,
|
|
7
|
+
"bracketSpacing": true,
|
|
8
|
+
"arrowParens": "always",
|
|
9
|
+
"endOfLine": "lf",
|
|
10
|
+
"plugins": []
|
|
11
|
+
}
|
package/Dockerfile
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
# ========== Foliko - 插件化 Agent 框架 ==========
|
|
2
|
-
# 基于 Node.js 20 LTS
|
|
3
|
-
|
|
4
|
-
FROM node:25-slim
|
|
5
|
-
|
|
6
|
-
# 安装无头浏览器(Chromium)和构建工具
|
|
7
|
-
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
8
|
-
build-essential \
|
|
9
|
-
python3 \
|
|
10
|
-
python3-pip \
|
|
11
|
-
curl \
|
|
12
|
-
git \
|
|
13
|
-
wget \
|
|
14
|
-
gnupg \
|
|
15
|
-
# Chromium 及依赖
|
|
16
|
-
chromium \
|
|
17
|
-
chromium-sandbox \
|
|
18
|
-
libnss3 \
|
|
19
|
-
libatk1.0-0 \
|
|
20
|
-
libatk-bridge2.0-0 \
|
|
21
|
-
libcups2 \
|
|
22
|
-
libdrm2 \
|
|
23
|
-
libxkbcommon0 \
|
|
24
|
-
libxcomposite1 \
|
|
25
|
-
libxdamage1 \
|
|
26
|
-
libxfixes3 \
|
|
27
|
-
libxrandr2 \
|
|
28
|
-
libgbm1 \
|
|
29
|
-
libasound2 \
|
|
30
|
-
libpango-1.0-0 \
|
|
31
|
-
libpangocairo-1.0-0 \
|
|
32
|
-
libgtk-3-0 \
|
|
33
|
-
fonts-liberation \
|
|
34
|
-
xdg-utils \
|
|
35
|
-
&& rm -rf /var/lib/apt/lists/* \
|
|
36
|
-
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
|
37
|
-
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
38
|
-
|
|
39
|
-
# 设置 Chromium 环境变量(无头模式运行)
|
|
40
|
-
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
41
|
-
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
42
|
-
ENV CHROME_BIN=/usr/bin/chromium
|
|
43
|
-
|
|
44
|
-
# 安装 uv(快速的 Python 包管理器)
|
|
45
|
-
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
46
|
-
ENV PATH="/root/.local/bin:$PATH"
|
|
47
|
-
|
|
48
|
-
# 设置工作目录
|
|
49
|
-
WORKDIR /app
|
|
50
|
-
|
|
51
|
-
# 全局安装 foliko CLI
|
|
52
|
-
# RUN npm install -g foliko
|
|
53
|
-
|
|
54
|
-
# 暴露端口
|
|
55
|
-
# 3000: Web 服务端口
|
|
56
|
-
EXPOSE 3000
|
|
57
|
-
|
|
58
|
-
# 环境变量(可以在 docker-compose 或运行时覆盖)
|
|
59
|
-
ENV NODE_ENV=production
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# 默认命令:运行聊天界面
|
|
63
|
-
# CMD ["foliko", "chat"]
|
|
1
|
+
# ========== Foliko - 插件化 Agent 框架 ==========
|
|
2
|
+
# 基于 Node.js 20 LTS
|
|
3
|
+
|
|
4
|
+
FROM node:25-slim
|
|
5
|
+
|
|
6
|
+
# 安装无头浏览器(Chromium)和构建工具
|
|
7
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
8
|
+
build-essential \
|
|
9
|
+
python3 \
|
|
10
|
+
python3-pip \
|
|
11
|
+
curl \
|
|
12
|
+
git \
|
|
13
|
+
wget \
|
|
14
|
+
gnupg \
|
|
15
|
+
# Chromium 及依赖
|
|
16
|
+
chromium \
|
|
17
|
+
chromium-sandbox \
|
|
18
|
+
libnss3 \
|
|
19
|
+
libatk1.0-0 \
|
|
20
|
+
libatk-bridge2.0-0 \
|
|
21
|
+
libcups2 \
|
|
22
|
+
libdrm2 \
|
|
23
|
+
libxkbcommon0 \
|
|
24
|
+
libxcomposite1 \
|
|
25
|
+
libxdamage1 \
|
|
26
|
+
libxfixes3 \
|
|
27
|
+
libxrandr2 \
|
|
28
|
+
libgbm1 \
|
|
29
|
+
libasound2 \
|
|
30
|
+
libpango-1.0-0 \
|
|
31
|
+
libpangocairo-1.0-0 \
|
|
32
|
+
libgtk-3-0 \
|
|
33
|
+
fonts-liberation \
|
|
34
|
+
xdg-utils \
|
|
35
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
36
|
+
&& ln -sf /usr/bin/python3 /usr/bin/python \
|
|
37
|
+
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
|
38
|
+
|
|
39
|
+
# 设置 Chromium 环境变量(无头模式运行)
|
|
40
|
+
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
|
41
|
+
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
|
|
42
|
+
ENV CHROME_BIN=/usr/bin/chromium
|
|
43
|
+
|
|
44
|
+
# 安装 uv(快速的 Python 包管理器)
|
|
45
|
+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
46
|
+
ENV PATH="/root/.local/bin:$PATH"
|
|
47
|
+
|
|
48
|
+
# 设置工作目录
|
|
49
|
+
WORKDIR /app
|
|
50
|
+
|
|
51
|
+
# 全局安装 foliko CLI
|
|
52
|
+
# RUN npm install -g foliko
|
|
53
|
+
|
|
54
|
+
# 暴露端口
|
|
55
|
+
# 3000: Web 服务端口
|
|
56
|
+
EXPOSE 3000
|
|
57
|
+
|
|
58
|
+
# 环境变量(可以在 docker-compose 或运行时覆盖)
|
|
59
|
+
ENV NODE_ENV=production
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# 默认命令:运行聊天界面
|
|
63
|
+
# CMD ["foliko", "chat"]
|