foliko 1.0.44 → 1.0.46

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/.env.example CHANGED
@@ -41,7 +41,7 @@ TELEGRAM_BOT_TOKEN=your-telegram-bot-token
41
41
 
42
42
  # ========== Web Server (optional) ==========
43
43
  # Web 服务端口,默认 8088
44
- WEB_PORT=8088
44
+ WEB_PORT=3000
45
45
 
46
46
  # Web 服务主机,默认 127.0.0.1
47
47
  WEB_HOST=127.0.0.1
package/Dockerfile CHANGED
@@ -1,7 +1,7 @@
1
1
  # ========== Foliko - 插件化 Agent 框架 ==========
2
2
  # 基于 Node.js 20 LTS
3
3
 
4
- FROM node:20-slim
4
+ FROM node:25-slim
5
5
 
6
6
  # 安装 Python 和构建工具(部分 npm 包需要编译)
7
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
@@ -14,7 +14,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
14
14
  && ln -sf /usr/bin/python3 /usr/bin/python
15
15
 
16
16
  # 安装 uv(快速的 Python 包管理器)
17
- RUN pip3 install uv
17
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
18
+ ENV PATH="/root/.local/bin:$PATH"
18
19
 
19
20
  # 设置工作目录
20
21
  WORKDIR /app
@@ -24,12 +25,11 @@ RUN npm install -g foliko
24
25
 
25
26
  # 暴露端口
26
27
  # 8088: Web 服务端口
27
- EXPOSE 8088
28
+ EXPOSE 3000
28
29
 
29
30
  # 环境变量(可以在 docker-compose 或运行时覆盖)
30
31
  ENV NODE_ENV=production
31
- ENV WEB_PORT=8088
32
- ENV WEB_HOST=127.0.0.1
32
+
33
33
 
34
34
  # 默认命令:运行聊天界面
35
35
  CMD ["foliko", "chat"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foliko",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
4
4
  "description": "简约的插件化 Agent 框架",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -19,9 +19,9 @@ class WebPlugin extends Plugin {
19
19
  this.priority = 50
20
20
 
21
21
  // 服务器配置
22
- this._port = config.port || process.env.WEB_PORT || 8088
23
- this._host = config.host || process.env.WEB_HOST || '127.0.0.1'
24
- this._baseUrl = config.baseUrl || process.env.WEB_BASE_URL || null // 公网可访问的域名
22
+ this._port = process.env.WEB_PORT || 3000
23
+ this._host = process.env.WEB_HOST || '127.0.0.1'
24
+ this._baseUrl = process.env.WEB_BASE_URL || null // 公网可访问的域名
25
25
 
26
26
  // 运行时状态
27
27
  this._server = null
@@ -157,12 +157,14 @@ class WebPlugin extends Plugin {
157
157
  port: this._port,
158
158
  hostname: this._host
159
159
  })
160
- console.log(`[Web] Server started on http://${this._host}:${this._port}`)
160
+ const serverUrl = this._getUrl()
161
+ console.log(`[Web] Server started on ${serverUrl}`)
161
162
  return {
162
163
  success: true,
163
- message: `Server started on http://${this._host}:${this._port}`,
164
+ message: `Server started on ${serverUrl}`,
164
165
  port: this._port,
165
- host: this._host
166
+ host: this._host,
167
+ url: serverUrl
166
168
  }
167
169
  } catch (err) {
168
170
  this._server = null
@@ -406,7 +408,7 @@ class WebPlugin extends Plugin {
406
408
  }
407
409
 
408
410
  _listRoutes() {
409
- const baseUrl = this._getUrl('')
411
+ const baseUrl = this._getUrl()
410
412
 
411
413
  return {
412
414
  success: true,
@@ -477,7 +479,7 @@ class WebPlugin extends Plugin {
477
479
  return query
478
480
  }
479
481
 
480
- _getUrl(path) {
482
+ _getUrl(path='') {
481
483
  if (this._baseUrl) {
482
484
  return `${this._baseUrl}${path}`
483
485
  }