openclaw-agent-dashboard 1.0.26 → 1.0.27
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/.github/workflows/release.yml +56 -0
- package/README.md +321 -55
- package/docs/install-windows.zh-CN.md +76 -0
- package/docs/openclaw-slash-commands-reference.md +411 -0
- package/{frontend-dist → frontend}/index.html +1 -2
- package/frontend/package-lock.json +1240 -0
- package/frontend/package.json +19 -0
- package/frontend/src/App.vue +355 -0
- package/frontend/src/components/AgentCard.vue +796 -0
- package/frontend/src/components/AgentConfigPanel.vue +539 -0
- package/frontend/src/components/AgentDetailPanel.vue +738 -0
- package/frontend/src/components/ErrorAnalysisView.vue +546 -0
- package/frontend/src/components/ErrorCenterPanel.vue +844 -0
- package/frontend/src/components/PerformanceMonitor.vue +515 -0
- package/frontend/src/components/SettingsPanel.vue +236 -0
- package/frontend/src/components/TokenAnalysisPanel.vue +683 -0
- package/frontend/src/components/chain/ChainEdge.vue +85 -0
- package/frontend/src/components/chain/ChainNode.vue +166 -0
- package/frontend/src/components/chain/TaskChainView.vue +425 -0
- package/frontend/src/components/chain/index.ts +3 -0
- package/frontend/src/components/chain/types.ts +70 -0
- package/frontend/src/components/collaboration/CollaborationFlowSection.vue +1032 -0
- package/frontend/src/components/collaboration/CollaborationFlowWrapper.vue +113 -0
- package/frontend/src/components/common/VersionDisplay.vue +187 -0
- package/frontend/src/components/performance/PerformancePanel.vue +119 -0
- package/frontend/src/components/performance/PerformanceSection.vue +1137 -0
- package/frontend/src/components/tasks/TaskStatusSection.vue +973 -0
- package/frontend/src/components/timeline/TimelineConnector.vue +31 -0
- package/frontend/src/components/timeline/TimelineRound.vue +135 -0
- package/frontend/src/components/timeline/TimelineStep.vue +691 -0
- package/frontend/src/components/timeline/TimelineToolLink.vue +109 -0
- package/frontend/src/components/timeline/TimelineView.vue +540 -0
- package/frontend/src/components/timeline/index.ts +5 -0
- package/frontend/src/components/timeline/types.ts +120 -0
- package/frontend/src/composables/index.ts +7 -0
- package/frontend/src/composables/useDebounce.ts +48 -0
- package/frontend/src/composables/useRealtime.ts +52 -0
- package/frontend/src/composables/useState.ts +52 -0
- package/frontend/src/composables/useThrottle.ts +46 -0
- package/frontend/src/composables/useVirtualScroll.ts +106 -0
- package/frontend/src/main.ts +4 -0
- package/frontend/src/managers/EventDispatcher.ts +127 -0
- package/frontend/src/managers/RealtimeDataManager.ts +302 -0
- package/frontend/src/managers/StateManager.ts +128 -0
- package/frontend/src/managers/index.ts +5 -0
- package/frontend/src/types/collaboration.ts +135 -0
- package/frontend/src/types/index.ts +20 -0
- package/frontend/src/types/performance.ts +105 -0
- package/frontend/src/types/task.ts +38 -0
- package/frontend/vite.config.ts +18 -0
- package/npm +1028 -0
- package/package.json +15 -20
- package/plugin/README.md +99 -0
- package/plugin/config.json.example +1 -0
- package/plugin/package.json +33 -0
- package/scripts/build-plugin.js +81 -0
- package/scripts/bundle.sh +62 -0
- package/scripts/install-plugin.sh +162 -0
- package/scripts/install-python-deps.js +87 -13
- package/scripts/install-python-deps.sh +226 -0
- package/scripts/install.js +684 -0
- package/scripts/install.sh +367 -0
- package/scripts/lib/common.sh +137 -0
- package/scripts/release-pack.sh +110 -0
- package/scripts/start.js +50 -0
- package/scripts/test_available_models.py +284 -0
- package/scripts/test_version_display.sh +128 -0
- package/scripts/test_websocket_ping.py +44 -0
- package/src/backend/requirements.txt +6 -0
- package/dashboard/requirements.txt +0 -6
- package/frontend-dist/assets/index-B7XqKAxm.css +0 -1
- package/frontend-dist/assets/index-CxJaSYyo.js +0 -24
- /package/{index.js → plugin/index.js} +0 -0
- /package/{openclaw.plugin.json → plugin/openclaw.plugin.json} +0 -0
- /package/{dashboard → src/backend}/agents.py +0 -0
- /package/{dashboard → src/backend}/api/__init__.py +0 -0
- /package/{dashboard → src/backend}/api/agent_config_api.py +0 -0
- /package/{dashboard → src/backend}/api/agents.py +0 -0
- /package/{dashboard → src/backend}/api/agents_config.py +0 -0
- /package/{dashboard → src/backend}/api/chains.py +0 -0
- /package/{dashboard → src/backend}/api/collaboration.py +0 -0
- /package/{dashboard → src/backend}/api/debug_paths.py +0 -0
- /package/{dashboard → src/backend}/api/error_analysis.py +0 -0
- /package/{dashboard → src/backend}/api/errors.py +0 -0
- /package/{dashboard → src/backend}/api/performance.py +0 -0
- /package/{dashboard → src/backend}/api/subagents.py +0 -0
- /package/{dashboard → src/backend}/api/timeline.py +0 -0
- /package/{dashboard → src/backend}/api/version.py +0 -0
- /package/{dashboard → src/backend}/api/websocket.py +0 -0
- /package/{dashboard → src/backend}/collaboration.py +0 -0
- /package/{dashboard → src/backend}/data/__init__.py +0 -0
- /package/{dashboard → src/backend}/data/agent_config_manager.py +0 -0
- /package/{dashboard → src/backend}/data/chain_reader.py +0 -0
- /package/{dashboard → src/backend}/data/config_reader.py +0 -0
- /package/{dashboard → src/backend}/data/error_analyzer.py +0 -0
- /package/{dashboard → src/backend}/data/session_reader.py +0 -0
- /package/{dashboard → src/backend}/data/subagent_reader.py +0 -0
- /package/{dashboard → src/backend}/data/task_history.py +0 -0
- /package/{dashboard → src/backend}/data/timeline_reader.py +0 -0
- /package/{dashboard → src/backend}/data/version_info_reader.py +0 -0
- /package/{dashboard → src/backend}/errors.py +0 -0
- /package/{dashboard → src/backend}/main.py +0 -0
- /package/{dashboard → src/backend}/mechanism_reader.py +0 -0
- /package/{dashboard → src/backend}/mechanisms.py +0 -0
- /package/{dashboard → src/backend}/performance.py +0 -0
- /package/{dashboard → src/backend}/session_reader.py +0 -0
- /package/{dashboard → src/backend}/status/__init__.py +0 -0
- /package/{dashboard → src/backend}/status/change_tracker.py +0 -0
- /package/{dashboard → src/backend}/status/error_detector.py +0 -0
- /package/{dashboard → src/backend}/status/status_cache.py +0 -0
- /package/{dashboard → src/backend}/status/status_calculator.py +0 -0
- /package/{dashboard → src/backend}/status_calculator.py +0 -0
- /package/{dashboard → src/backend}/subagent_reader.py +0 -0
- /package/{dashboard → src/backend}/watchers/__init__.py +0 -0
- /package/{dashboard → src/backend}/watchers/file_watcher.py +0 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- 'v*'
|
|
7
|
+
workflow_dispatch:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
build-and-release:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- name: Checkout
|
|
17
|
+
uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: '20'
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: cd frontend && npm ci
|
|
26
|
+
|
|
27
|
+
- name: Build and pack plugin
|
|
28
|
+
run: npm run pack
|
|
29
|
+
|
|
30
|
+
- name: Generate release tgz
|
|
31
|
+
run: bash scripts/release-pack.sh
|
|
32
|
+
|
|
33
|
+
- name: Get version
|
|
34
|
+
id: version
|
|
35
|
+
run: |
|
|
36
|
+
VERSION=$(jq -r '.version' plugin/openclaw.plugin.json)
|
|
37
|
+
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
|
38
|
+
echo "tag=v$VERSION" >> $GITHUB_OUTPUT
|
|
39
|
+
|
|
40
|
+
- name: Upload artifact
|
|
41
|
+
uses: actions/upload-artifact@v4
|
|
42
|
+
with:
|
|
43
|
+
name: plugin-tgz
|
|
44
|
+
path: openclaw-agent-dashboard-v*.tgz
|
|
45
|
+
retention-days: 30
|
|
46
|
+
|
|
47
|
+
- name: Create Release
|
|
48
|
+
if: github.event_name == 'push'
|
|
49
|
+
uses: softprops/action-gh-release@v2
|
|
50
|
+
with:
|
|
51
|
+
tag_name: ${{ steps.version.outputs.tag }}
|
|
52
|
+
name: Release ${{ steps.version.outputs.tag }}
|
|
53
|
+
generate_release_notes: true
|
|
54
|
+
make_latest: true
|
|
55
|
+
files: |
|
|
56
|
+
openclaw-agent-dashboard-v*.tgz
|
package/README.md
CHANGED
|
@@ -1,99 +1,365 @@
|
|
|
1
|
-
# OpenClaw Agent Dashboard
|
|
1
|
+
# OpenClaw Agent Dashboard
|
|
2
2
|
|
|
3
|
-
多 Agent 可视化看板 -
|
|
3
|
+
多 Agent 可视化看板 - 实时展示 OpenClaw Agent 状态、任务进度和错误分析。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 功能特性
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **工位视图** - 以卡片形式展示主 Agent 和子 Agent 状态
|
|
8
|
+
- **时序视图** - 展示 Agent 执行步骤的时间线
|
|
9
|
+
- **链路视图** - 展示主 Agent 与子 Agent 的任务派发链路
|
|
10
|
+
- **Agent 配置** - 查看和修改 Agent 的模型配置
|
|
11
|
+
- **错误分析** - 错误根因分析、分类和修复建议
|
|
12
|
+
- **API 状态** - 展示 API 服务异常和限流情况
|
|
13
|
+
- **性能监控** - Token 使用、响应时间等
|
|
14
|
+
|
|
15
|
+
## 系统要求
|
|
16
|
+
|
|
17
|
+
| 组件 | 要求 |
|
|
18
|
+
|------|------|
|
|
19
|
+
| **openclaw** | 已安装 (`npm install -g openclaw`) |
|
|
20
|
+
| **Node.js** | 16+ |
|
|
21
|
+
| **Python** | 3.8+ |
|
|
22
|
+
| **pip** | python3-pip |
|
|
23
|
+
| **venv** | python3-venv(Linux 推荐) |
|
|
24
|
+
|
|
25
|
+
### 各系统依赖安装
|
|
26
|
+
|
|
27
|
+
**Debian / Ubuntu:**
|
|
28
|
+
```bash
|
|
29
|
+
sudo apt update
|
|
30
|
+
sudo apt install python3 python3-pip python3-venv
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Fedora / CentOS / RHEL:**
|
|
34
|
+
```bash
|
|
35
|
+
sudo dnf install python3 python3-pip
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
**macOS:**
|
|
39
|
+
```bash
|
|
40
|
+
brew install python3
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Windows:**
|
|
44
|
+
1. 安装 [Node.js](https://nodejs.org/)(LTS 版本)
|
|
45
|
+
2. 安装 [Python 3](https://www.python.org/downloads/)
|
|
46
|
+
- ⚠️ 安装时务必勾选 **"Add Python to PATH"**
|
|
47
|
+
3. 全局安装 OpenClaw:`npm install -g openclaw`
|
|
48
|
+
4. [Git for Windows](https://git-scm.com/download/win)(可选;仅 **方式一从 npm 安装** 时不需要 Git)
|
|
49
|
+
|
|
50
|
+
## 快速安装
|
|
51
|
+
|
|
52
|
+
### Windows 用户(仅安装,复制顺序执行)
|
|
53
|
+
|
|
54
|
+
在 **PowerShell** 中依次执行:
|
|
55
|
+
|
|
56
|
+
```powershell
|
|
57
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
58
|
+
|
|
59
|
+
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
60
|
+
node "$plugin\scripts\install-python-deps.js" $plugin --verbose
|
|
61
|
+
|
|
62
|
+
openclaw gateway restart
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
浏览器访问:`http://localhost:38271`。若出现 `plugin already exists`,见下文「从 path / 旧版安装迁移到 npm」一节。
|
|
66
|
+
|
|
67
|
+
安装成功时,终端会出现 **`Installed plugin: openclaw-agent-dashboard`**。过程中的 **`WARNING: ... dangerous code patterns ... child_process`** 为安全扫描提示,**可忽略**;**`plugins.allow is empty`** 为建议项,不阻止使用(可选在 `openclaw.json` 中配置 `plugins.allow` 消除提示)。
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### 方式一:OpenClaw 官方命令(推荐,全平台)
|
|
72
|
+
|
|
73
|
+
与 OpenClaw 其它 npm 插件一致,由 CLI 从 **npm** 下载并安装到 `extensions` 目录:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
指定版本(版本号以 npm 为准,可用 `npm view openclaw-agent-dashboard version` 查看):
|
|
8
80
|
|
|
9
81
|
```bash
|
|
82
|
+
openclaw plugins install openclaw-agent-dashboard@1.0.17
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
首次安装见上;**已安装后的升级**见下文 [升级插件(已用 npm 安装)](#升级插件已用-npm-安装)。
|
|
86
|
+
|
|
87
|
+
**安装 Python 依赖(首次或报错时执行一次)**
|
|
88
|
+
插件目录在 `~/.openclaw/extensions/openclaw-agent-dashboard`(Windows 为 `%USERPROFILE%\.openclaw\extensions\openclaw-agent-dashboard`)。打包时已包含跨平台的 `scripts/install-python-deps.js`,请用 **Node** 调用(勿依赖 bash):
|
|
89
|
+
|
|
90
|
+
**Linux / macOS:**
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
PLUGIN="$HOME/.openclaw/extensions/openclaw-agent-dashboard"
|
|
94
|
+
node "$PLUGIN/scripts/install-python-deps.js" "$PLUGIN" --verbose
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Windows(PowerShell):**
|
|
98
|
+
|
|
99
|
+
```powershell
|
|
100
|
+
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
101
|
+
node "$plugin\scripts\install-python-deps.js" $plugin --verbose
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
脚本会在 `dashboard/.venv` 下创建虚拟环境并安装 `requirements.txt`,避免 Debian/Ubuntu 上 PEP 668 限制。
|
|
105
|
+
|
|
106
|
+
**安装完成后请执行** `openclaw gateway restart` **重启网关**,再访问 Dashboard。
|
|
107
|
+
|
|
108
|
+
> 在 **Gateway 进程**中加载插件时会自动启动 Dashboard。访问地址默认: http://localhost:38271
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
### 方式二:从源码安装(开发者)
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
git clone https://github.com/Umarchen/openclaw-agent-dashboard.git
|
|
116
|
+
cd openclaw-agent-dashboard
|
|
10
117
|
npm run deploy
|
|
11
118
|
```
|
|
12
119
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
120
|
+
`npm run deploy` 会执行 `pack`(构建前端 + 写入 `plugin/`)并调用 `openclaw plugins install` 指向本地 `plugin` 目录。**Windows** 在 PowerShell / CMD 中同样可用。
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
### 方式三:GitHub Release 离线包
|
|
125
|
+
|
|
126
|
+
从 [GitHub Releases](https://github.com/Umarchen/openclaw-agent-dashboard/releases) 下载 `openclaw-agent-dashboard-v*.tgz` 后:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
openclaw plugins install ./openclaw-agent-dashboard-v1.0.0.tgz
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
再按 [方式一](#方式一openclaw-官方命令推荐全平台) 用 `node .../install-python-deps.js` 安装 Python 依赖。
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### 方式四:一键脚本(仅 Linux / macOS,可选)
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
curl -fsSL https://raw.githubusercontent.com/Umarchen/openclaw-agent-dashboard/main/scripts/install.sh | bash
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
更推荐优先使用 **方式一**,便于版本与 OpenClaw 配置一致。
|
|
143
|
+
|
|
144
|
+
---
|
|
18
145
|
|
|
19
|
-
|
|
20
|
-
- Node.js(构建前端)
|
|
21
|
-
- Python 3.10+
|
|
22
|
-
- OpenClaw(`npm install -g openclaw`)
|
|
146
|
+
### 关于旧版 `npx openclaw-agent-dashboard`
|
|
23
147
|
|
|
24
|
-
|
|
148
|
+
早期曾通过 `npx` 调用安装脚本;**当前推荐**使用 `openclaw plugins install` 安装插件本体。若仍需从 GitHub Release 拉取完整 tgz,请使用方式三或仓库内 `scripts/install.js`(开发者)。
|
|
25
149
|
|
|
26
150
|
---
|
|
27
151
|
|
|
152
|
+
### 从 path / 旧版安装迁移到 npm(迁移说明)
|
|
153
|
+
|
|
154
|
+
若此前使用 **`openclaw plugins install /某路径/plugin`**、手动拷贝到 `extensions`,或旧版安装方式,改用 **方式一** 时可能出现:
|
|
155
|
+
|
|
156
|
+
```text
|
|
157
|
+
plugin already exists: .../openclaw-agent-dashboard (delete it first)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**原因简述**:OpenClaw 对 **`source: "path"`** 的插件执行卸载时,**不会删除** `~/.openclaw/extensions/` 下对应目录(避免误删本机源码目录);配置已卸掉,但文件夹仍在,新的 `plugins install` 会拒绝覆盖。
|
|
161
|
+
|
|
162
|
+
**一次性处理(迁移只需做一次)**:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
openclaw plugins uninstall openclaw-agent-dashboard --force
|
|
166
|
+
rm -rf ~/.openclaw/extensions/openclaw-agent-dashboard
|
|
167
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Windows(PowerShell)**:
|
|
171
|
+
|
|
172
|
+
```powershell
|
|
173
|
+
openclaw plugins uninstall openclaw-agent-dashboard --force
|
|
174
|
+
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
175
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
然后按 [方式一](#方式一openclaw-官方命令推荐全平台) 安装 Python 依赖,并重启 Gateway。
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
### 升级插件(已用 npm 安装)
|
|
183
|
+
|
|
184
|
+
对已通过 **npm** 安装的副本,请使用 OpenClaw 的 **更新** 命令(会覆盖旧版本,**不会**出现上面的 `plugin already exists`):
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
openclaw plugins update openclaw-agent-dashboard
|
|
188
|
+
# 或按官方文档更新全部 npm 插件,例如:
|
|
189
|
+
# openclaw plugins update --all
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**不要**在已安装的情况下再跑 `openclaw plugins install openclaw-agent-dashboard@latest` 当作升级(可能被判定为「全新安装」且目录已存在而失败)。具体子命令以本机 `openclaw plugins --help` 为准。
|
|
193
|
+
|
|
28
194
|
## 命令说明
|
|
29
195
|
|
|
30
196
|
| 命令 | 说明 |
|
|
31
197
|
|------|------|
|
|
32
|
-
| `
|
|
33
|
-
| `npm run
|
|
34
|
-
| `npm run
|
|
198
|
+
| `openclaw plugins install openclaw-agent-dashboard@latest` | **用户推荐**:从 npm 安装插件到 OpenClaw |
|
|
199
|
+
| `npm run deploy` | 开发:打包 + `openclaw plugins install` 本地 `plugin/` |
|
|
200
|
+
| `npm run publish:npm` | 维护者:打包后 `npm publish --prefix plugin` 发布到 npm |
|
|
201
|
+
| 维护者全流程 | 见 [docs/MAINTAINER_RELEASE_WORKFLOW.md](docs/MAINTAINER_RELEASE_WORKFLOW.md)(npm + Git + Release + 本机更新) |
|
|
202
|
+
| `npm run upgrade` | 开发:拉取最新代码 + `deploy` |
|
|
203
|
+
| `npm run pack` | 仅打包 `plugin/`(不安装) |
|
|
35
204
|
| `npm run bundle` | 生成可分发的压缩包(离线分发) |
|
|
205
|
+
| `npm run start` | 独立启动 Dashboard(插件未自动启动时使用) |
|
|
206
|
+
|
|
207
|
+
## 离线分发
|
|
208
|
+
|
|
209
|
+
如果 git clone 失败,维护者可在开发机执行 `npm run bundle` 生成压缩包(文件名以终端输出为准)。
|
|
210
|
+
|
|
211
|
+
接收方解压并进入目录,执行 `npm run deploy`(需已安装 Node、openclaw、Python 等)。**更推荐直接使用 [方式一](#方式一openclaw-官方命令推荐全平台) 从 npm 安装**,无需 bundle。
|
|
212
|
+
|
|
213
|
+
## Python 依赖安装策略
|
|
36
214
|
|
|
37
|
-
|
|
215
|
+
安装脚本采用以下策略安装 Python 依赖:
|
|
216
|
+
|
|
217
|
+
1. **venv(推荐)** - 在插件目录下创建 `.venv`,隔离依赖,不受 PEP 668 影响;Debian/Ubuntu 下**必须**用此方式(系统禁止 pip 装到系统/用户目录)。
|
|
218
|
+
2. **pip --user(回退)** - 仅在不支持 venv 或非 Debian/Ubuntu 环境下尝试,安装到 `~/.local/`。
|
|
219
|
+
|
|
220
|
+
若安装失败,请确保已安装系统依赖(见 [系统要求](#系统要求))。
|
|
221
|
+
|
|
222
|
+
详见 [Python 环境兼容性](docs/python-environment-compatibility.md)。
|
|
223
|
+
|
|
224
|
+
## 独立运行(不作为插件)
|
|
225
|
+
|
|
226
|
+
如果需要独立运行(不作为插件):
|
|
38
227
|
|
|
39
228
|
```bash
|
|
40
|
-
|
|
41
|
-
|
|
229
|
+
# 1. 安装后端依赖(Debian/Ubuntu 建议用 venv:python3 -m venv .venv && .venv/bin/pip install -r requirements.txt)
|
|
230
|
+
cd src/backend
|
|
231
|
+
pip install -r requirements.txt
|
|
232
|
+
|
|
233
|
+
# 2. 构建前端
|
|
234
|
+
cd ../../frontend
|
|
235
|
+
npm install
|
|
236
|
+
npm run build
|
|
237
|
+
|
|
238
|
+
# 3. 启动后端
|
|
239
|
+
cd ../src/backend
|
|
240
|
+
uvicorn main:app --host 0.0.0.0 --port 38271
|
|
42
241
|
```
|
|
43
242
|
|
|
44
|
-
|
|
243
|
+
## 项目结构
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
openclaw-agent-dashboard/
|
|
247
|
+
├── frontend/ # Vue 3 前端
|
|
248
|
+
│ └── src/ # 组件源码
|
|
249
|
+
├── src/backend/ # FastAPI 后端
|
|
250
|
+
│ ├── api/ # API 路由
|
|
251
|
+
│ ├── data/ # 数据读取层
|
|
252
|
+
│ └── main.py # 入口
|
|
253
|
+
├── plugin/ # 插件打包配置
|
|
254
|
+
├── scripts/ # 安装与构建脚本
|
|
255
|
+
│ ├── lib/ # 公共函数库
|
|
256
|
+
│ ├── install.sh # 一键安装
|
|
257
|
+
│ └── install-plugin.sh # 源码安装
|
|
258
|
+
├── .github/workflows/ # CI/CD
|
|
259
|
+
└── docs/ # 设计文档
|
|
45
260
|
```
|
|
46
|
-
=== OpenClaw Agent Dashboard 插件升级 ===
|
|
47
261
|
|
|
48
|
-
|
|
262
|
+
## 主要 API
|
|
49
263
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
264
|
+
| 方法 | 路径 | 说明 |
|
|
265
|
+
|------|------|------|
|
|
266
|
+
| GET | `/api/agents` | Agent 列表及状态 |
|
|
267
|
+
| GET | `/api/agent-config/:id` | Agent 配置 |
|
|
268
|
+
| PUT | `/api/agent-config/:id/model` | 更新模型配置 |
|
|
269
|
+
| GET | `/api/error-analysis/:id` | 错误分析 |
|
|
270
|
+
| GET | `/api/timeline/:id` | 时序数据 |
|
|
271
|
+
| GET | `/api/chains` | 任务链路 |
|
|
57
272
|
|
|
58
|
-
|
|
59
|
-
```
|
|
273
|
+
完整 API 文档: http://localhost:38271/docs
|
|
60
274
|
|
|
61
|
-
|
|
275
|
+
## 数据源
|
|
62
276
|
|
|
63
|
-
|
|
277
|
+
- `~/.openclaw/openclaw.json` - Agent 配置(Windows:`%USERPROFILE%\.openclaw\openclaw.json`)
|
|
278
|
+
- `~/.openclaw/subagents/runs.json` - 子代理运行记录
|
|
279
|
+
- `~/.openclaw/agents/*/sessions/*.jsonl` - 会话消息
|
|
64
280
|
|
|
65
|
-
|
|
281
|
+
## 环境变量
|
|
66
282
|
|
|
67
|
-
|
|
283
|
+
| 变量 | 说明 | 默认值 |
|
|
284
|
+
|------|------|--------|
|
|
285
|
+
| `OPENCLAW_STATE_DIR` | OpenClaw 配置根目录(优先级最高) | - |
|
|
286
|
+
| `OPENCLAW_HOME` | 替代 HOME,用于解析 `~/.openclaw` | `$HOME` |
|
|
68
287
|
|
|
69
|
-
|
|
288
|
+
插件安装路径与 `openclaw` 命令一致:`$OPENCLAW_STATE_DIR/extensions/` 或 `$OPENCLAW_HOME/.openclaw/extensions/` 或 `~/.openclaw/extensions/`,确保 Gateway 能正确发现插件。
|
|
70
289
|
|
|
71
|
-
|
|
290
|
+
## 开发调试
|
|
72
291
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
3. **openclaw.json**:`plugins.entries.openclaw-agent-dashboard.config.port`
|
|
79
|
-
4. **默认**:38271
|
|
292
|
+
```bash
|
|
293
|
+
# 修改代码后重新部署
|
|
294
|
+
npm run deploy
|
|
295
|
+
openclaw gateway restart
|
|
296
|
+
```
|
|
80
297
|
|
|
81
|
-
|
|
298
|
+
## 故障排查
|
|
82
299
|
|
|
83
|
-
|
|
300
|
+
### Python 依赖安装失败
|
|
84
301
|
|
|
85
|
-
|
|
302
|
+
```
|
|
303
|
+
❌ Python 依赖安装失败
|
|
304
|
+
```
|
|
86
305
|
|
|
87
|
-
|
|
306
|
+
**解决方案:**
|
|
88
307
|
|
|
89
308
|
```bash
|
|
90
|
-
#
|
|
91
|
-
|
|
309
|
+
# Debian/Ubuntu(需安装 python3-venv)
|
|
310
|
+
sudo apt update && sudo apt install python3 python3-pip python3-venv
|
|
311
|
+
|
|
312
|
+
# 推荐:用插件自带的 Node 脚本安装 venv 依赖(跨平台)
|
|
313
|
+
PLUGIN="$HOME/.openclaw/extensions/openclaw-agent-dashboard"
|
|
314
|
+
node "$PLUGIN/scripts/install-python-deps.js" "$PLUGIN" --verbose
|
|
315
|
+
```
|
|
92
316
|
|
|
93
|
-
|
|
94
|
-
openclaw plugins install ./plugin
|
|
317
|
+
若仍失败,可手动在 `dashboard` 下创建 venv:
|
|
95
318
|
|
|
96
|
-
|
|
319
|
+
```bash
|
|
97
320
|
cd ~/.openclaw/extensions/openclaw-agent-dashboard/dashboard
|
|
98
|
-
python3 -m venv .venv
|
|
321
|
+
python3 -m venv .venv
|
|
322
|
+
# Linux/macOS:
|
|
323
|
+
.venv/bin/pip install -r requirements.txt
|
|
324
|
+
# Windows: .venv\Scripts\pip install -r requirements.txt
|
|
99
325
|
```
|
|
326
|
+
|
|
327
|
+
### 无法访问 Dashboard
|
|
328
|
+
|
|
329
|
+
若 http://localhost:38271 无法访问,可能是插件未随 Gateway 自动启动,可手动启动:
|
|
330
|
+
|
|
331
|
+
```bash
|
|
332
|
+
# 方式一:在项目目录下(需先 npm run deploy)
|
|
333
|
+
npm run start
|
|
334
|
+
|
|
335
|
+
# 方式二:使用已安装的插件目录(若有 .venv 可用 .venv/bin/python 替代 python3)
|
|
336
|
+
cd ~/.openclaw/extensions/openclaw-agent-dashboard/dashboard
|
|
337
|
+
OPENCLAW_HOME=~/.openclaw python3 -m uvicorn main:app --host 0.0.0.0 --port 38271
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
说明:`openclaw gateway restart` 重启的是 Gateway 网关(端口 18789),不是 Agent Dashboard(38271)。Dashboard 作为插件随 Gateway 加载,若 systemd 方式运行的 Gateway 未正确加载插件,需手动启动 Dashboard。
|
|
341
|
+
|
|
342
|
+
### 安装报错:plugin not found / Invalid config
|
|
343
|
+
|
|
344
|
+
若出现 `plugins.allow: plugin not found: openclaw-agent-dashboard` 或 `Invalid config`,说明配置中有脏数据(插件曾被加入 allow 但当前未被发现)。按以下步骤处理:
|
|
345
|
+
|
|
346
|
+
**方式一:先清理再安装(推荐)**
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
openclaw plugins uninstall openclaw-agent-dashboard
|
|
350
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
**方式二:手动编辑配置**
|
|
354
|
+
|
|
355
|
+
编辑 `~/.openclaw/openclaw.json`,在 `plugins` 下:
|
|
356
|
+
|
|
357
|
+
- 若存在 `allow` 数组且包含 `"openclaw-agent-dashboard"`,将其移除
|
|
358
|
+
- 若存在 `entries.openclaw-agent-dashboard`,可删除
|
|
359
|
+
- 若存在 `installs.openclaw-agent-dashboard` 且为 `source: "path"` 的旧记录,可删除后改为官方 `npm` 安装
|
|
360
|
+
|
|
361
|
+
保存后再执行 `openclaw plugins install openclaw-agent-dashboard@latest`。
|
|
362
|
+
|
|
363
|
+
## 许可证
|
|
364
|
+
|
|
365
|
+
MIT
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Windows 安装
|
|
2
|
+
|
|
3
|
+
按顺序做即可。全程用 **PowerShell**(开始菜单搜「PowerShell」打开)。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 第 0 步:第一次用电脑装这些(只做一次)
|
|
8
|
+
|
|
9
|
+
1. 安装 **[Node.js](https://nodejs.org/)**(选 LTS,一路下一步)。
|
|
10
|
+
2. 安装 **[Python 3](https://www.python.org/downloads/)**,**务必勾选「Add Python to PATH」**,再点安装。
|
|
11
|
+
3. 打开 PowerShell,装 OpenClaw:
|
|
12
|
+
```powershell
|
|
13
|
+
npm install -g openclaw
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
不确定装没装好?在 PowerShell 里分别执行 `node -v`、`python --version`、`openclaw --version`,都能出版本号就行。
|
|
17
|
+
若只有 `py -3 --version` 能用,可到「系统 → 环境变量」里加一个 **`PYTHON_CMD`**,值为 `py`(一般不必,多数人选对 PATH 即可)。
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 第 1~3 步:装插件(每次新装 / 换电脑按这个来)
|
|
22
|
+
|
|
23
|
+
**1. 装插件**
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
openclaw plugins install openclaw-agent-dashboard@latest
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
看到安装成功即可。过程中若有 **child_process**、**plugins.allow** 之类警告,**一般不用管**。
|
|
30
|
+
|
|
31
|
+
**2. 装 Python 依赖(必做,和 Linux 一样要多这一步)**
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
35
|
+
node "$plugin\scripts\install-python-deps.js" $plugin --verbose
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
等它跑完,不要报错就行。
|
|
39
|
+
|
|
40
|
+
**3. 重启网关**
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
openclaw gateway restart
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**4. 打开浏览器**
|
|
47
|
+
|
|
48
|
+
访问:**http://localhost:38271**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 还不行?
|
|
53
|
+
|
|
54
|
+
| 情况 | 怎么办 |
|
|
55
|
+
|------|--------|
|
|
56
|
+
| 第 2 步失败(网络、pip) | 看 [WINDOWS_INSTALL_TROUBLESHOOTING.md](./WINDOWS_INSTALL_TROUBLESHOOTING.md) |
|
|
57
|
+
| 提示 **plugin already exists** | 看仓库根目录 [README.md](../README.md) 里「从 path / 旧版安装迁移到 npm」 |
|
|
58
|
+
| 想手动装 Python 依赖 | 见下文 **cmd 三行** |
|
|
59
|
+
|
|
60
|
+
插件默认在:`C:\Users\你的用户名\.openclaw\extensions\openclaw-agent-dashboard`。
|
|
61
|
+
若你改过 OpenClaw 数据目录,把上面命令里的路径换成你机器上真实的 `extensions\openclaw-agent-dashboard`。
|
|
62
|
+
|
|
63
|
+
**cmd 三行(手动 Python 依赖):**
|
|
64
|
+
|
|
65
|
+
```cmd
|
|
66
|
+
cd %USERPROFILE%\.openclaw\extensions\openclaw-agent-dashboard\dashboard
|
|
67
|
+
python -m venv .venv
|
|
68
|
+
.venv\Scripts\pip install -r requirements.txt
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 开发者 / 其它方式(可选)
|
|
74
|
+
|
|
75
|
+
- **从源码**:`git clone` 后进目录执行 `npm run deploy`,再 `openclaw gateway restart`。
|
|
76
|
+
- **更多说明**:根目录 [README.md](../README.md)。
|