openclaw-agent-dashboard 1.0.21 → 1.0.23
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/README.md +55 -321
- package/frontend-dist/assets/index-B7XqKAxm.css +1 -0
- package/frontend-dist/assets/index-CxJaSYyo.js +24 -0
- package/{frontend → frontend-dist}/index.html +2 -1
- package/{plugin/openclaw.plugin.json → openclaw.plugin.json} +2 -2
- package/package.json +21 -13
- package/.github/workflows/release.yml +0 -56
- package/VERSION_DISPLAY_delivery.md +0 -242
- package/VERSION_DISPLAY_implementation_summary.md +0 -315
- package/design_manifest.md +0 -100
- package/docs/CHANGELOG_AGENT_MODIFICATIONS.md +0 -132
- package/docs/MAINTAINER_RELEASE_WORKFLOW.md +0 -211
- package/docs/Openclaw-Agent-Dashboard/345/217/221/345/270/203/344/270/216/346/233/264/346/226/260.md +0 -147
- package/docs/RELEASE-LATEST.md +0 -189
- package/docs/RELEASE-MODEL-CONFIG.md +0 -95
- package/docs/WINDOWS_INSTALL_TROUBLESHOOTING.md +0 -171
- package/docs/design/.gitkeep +0 -0
- package/docs/design/VERSION_DISPLAY_design.md +0 -1236
- package/docs/release-guide.md +0 -259
- package/docs/release-operations-manual.md +0 -167
- package/docs/reviews/.gitkeep +0 -0
- package/docs/reviews/approval_history.json +0 -14
- package/docs/reviews/cr_VERSION_DISPLAY.md +0 -397
- package/docs/reviews/traceability_manifest.json +0 -279
- package/docs/specs/VERSION_DISPLAY_spec.md +0 -371
- package/docs/specs/tr3-install-system.md +0 -580
- package/docs/windows-collaboration-model-paths-troubleshooting.md +0 -0
- package/frontend/package-lock.json +0 -1240
- package/frontend/package.json +0 -19
- package/frontend/src/App.vue +0 -355
- package/frontend/src/components/AgentCard.vue +0 -796
- package/frontend/src/components/AgentConfigPanel.vue +0 -539
- package/frontend/src/components/AgentDetailPanel.vue +0 -738
- package/frontend/src/components/ErrorAnalysisView.vue +0 -546
- package/frontend/src/components/ErrorCenterPanel.vue +0 -844
- package/frontend/src/components/PerformanceMonitor.vue +0 -515
- package/frontend/src/components/SettingsPanel.vue +0 -236
- package/frontend/src/components/TokenAnalysisPanel.vue +0 -683
- package/frontend/src/components/chain/ChainEdge.vue +0 -85
- package/frontend/src/components/chain/ChainNode.vue +0 -166
- package/frontend/src/components/chain/TaskChainView.vue +0 -425
- package/frontend/src/components/chain/index.ts +0 -3
- package/frontend/src/components/chain/types.ts +0 -70
- package/frontend/src/components/collaboration/CollaborationFlowSection.vue +0 -1032
- package/frontend/src/components/collaboration/CollaborationFlowWrapper.vue +0 -113
- package/frontend/src/components/common/VersionDisplay.vue +0 -187
- package/frontend/src/components/performance/PerformancePanel.vue +0 -119
- package/frontend/src/components/performance/PerformanceSection.vue +0 -1137
- package/frontend/src/components/tasks/TaskStatusSection.vue +0 -973
- package/frontend/src/components/timeline/TimelineConnector.vue +0 -31
- package/frontend/src/components/timeline/TimelineRound.vue +0 -135
- package/frontend/src/components/timeline/TimelineStep.vue +0 -691
- package/frontend/src/components/timeline/TimelineToolLink.vue +0 -109
- package/frontend/src/components/timeline/TimelineView.vue +0 -540
- package/frontend/src/components/timeline/index.ts +0 -5
- package/frontend/src/components/timeline/types.ts +0 -120
- package/frontend/src/composables/index.ts +0 -7
- package/frontend/src/composables/useDebounce.ts +0 -48
- package/frontend/src/composables/useRealtime.ts +0 -52
- package/frontend/src/composables/useState.ts +0 -52
- package/frontend/src/composables/useThrottle.ts +0 -46
- package/frontend/src/composables/useVirtualScroll.ts +0 -106
- package/frontend/src/main.ts +0 -4
- package/frontend/src/managers/EventDispatcher.ts +0 -127
- package/frontend/src/managers/RealtimeDataManager.ts +0 -302
- package/frontend/src/managers/StateManager.ts +0 -128
- package/frontend/src/managers/index.ts +0 -5
- package/frontend/src/types/collaboration.ts +0 -135
- package/frontend/src/types/index.ts +0 -20
- package/frontend/src/types/performance.ts +0 -105
- package/frontend/src/types/task.ts +0 -38
- package/frontend/vite.config.ts +0 -18
- package/legacy_code_anatomy.md +0 -518
- package/plugin/README.md +0 -99
- package/plugin/config.json.example +0 -1
- package/plugin/package.json +0 -26
- package/scripts/build-plugin.js +0 -81
- package/scripts/bundle.sh +0 -62
- package/scripts/install-plugin.sh +0 -162
- package/scripts/install-python-deps.sh +0 -226
- package/scripts/install.js +0 -684
- package/scripts/install.sh +0 -367
- package/scripts/lib/common.sh +0 -137
- package/scripts/release-pack.sh +0 -110
- package/scripts/start.js +0 -50
- package/scripts/test_available_models.py +0 -284
- package/scripts/test_version_display.sh +0 -128
- package/scripts/test_websocket_ping.py +0 -44
- package/session_registry.json +0 -58
- package/tests/.gitkeep +0 -0
- package/tests/qa_regression_report.md +0 -359
- package/tests/qa_version_display_report.md +0 -598
- /package/{src/backend → dashboard}/agents.py +0 -0
- /package/{src/backend → dashboard}/api/__init__.py +0 -0
- /package/{src/backend → dashboard}/api/agent_config_api.py +0 -0
- /package/{src/backend → dashboard}/api/agents.py +0 -0
- /package/{src/backend → dashboard}/api/agents_config.py +0 -0
- /package/{src/backend → dashboard}/api/chains.py +0 -0
- /package/{src/backend → dashboard}/api/collaboration.py +0 -0
- /package/{src/backend → dashboard}/api/debug_paths.py +0 -0
- /package/{src/backend → dashboard}/api/error_analysis.py +0 -0
- /package/{src/backend → dashboard}/api/errors.py +0 -0
- /package/{src/backend → dashboard}/api/performance.py +0 -0
- /package/{src/backend → dashboard}/api/subagents.py +0 -0
- /package/{src/backend → dashboard}/api/timeline.py +0 -0
- /package/{src/backend → dashboard}/api/version.py +0 -0
- /package/{src/backend → dashboard}/api/websocket.py +0 -0
- /package/{src/backend → dashboard}/collaboration.py +0 -0
- /package/{src/backend → dashboard}/data/__init__.py +0 -0
- /package/{src/backend → dashboard}/data/agent_config_manager.py +0 -0
- /package/{src/backend → dashboard}/data/chain_reader.py +0 -0
- /package/{src/backend → dashboard}/data/config_reader.py +0 -0
- /package/{src/backend → dashboard}/data/error_analyzer.py +0 -0
- /package/{src/backend → dashboard}/data/session_reader.py +0 -0
- /package/{src/backend → dashboard}/data/subagent_reader.py +0 -0
- /package/{src/backend → dashboard}/data/task_history.py +0 -0
- /package/{src/backend → dashboard}/data/timeline_reader.py +0 -0
- /package/{src/backend → dashboard}/data/version_info_reader.py +0 -0
- /package/{src/backend → dashboard}/errors.py +0 -0
- /package/{src/backend → dashboard}/main.py +0 -0
- /package/{src/backend → dashboard}/mechanism_reader.py +0 -0
- /package/{src/backend → dashboard}/mechanisms.py +0 -0
- /package/{src/backend → dashboard}/performance.py +0 -0
- /package/{src/backend → dashboard}/requirements.txt +0 -0
- /package/{src/backend → dashboard}/session_reader.py +0 -0
- /package/{src/backend → dashboard}/status/__init__.py +0 -0
- /package/{src/backend → dashboard}/status/change_tracker.py +0 -0
- /package/{src/backend → dashboard}/status/error_detector.py +0 -0
- /package/{src/backend → dashboard}/status/status_cache.py +0 -0
- /package/{src/backend → dashboard}/status/status_calculator.py +0 -0
- /package/{src/backend → dashboard}/status_calculator.py +0 -0
- /package/{src/backend → dashboard}/subagent_reader.py +0 -0
- /package/{src/backend → dashboard}/watchers/__init__.py +0 -0
- /package/{src/backend → dashboard}/watchers/file_watcher.py +0 -0
- /package/{plugin/index.js → index.js} +0 -0
package/design_manifest.md
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# Design Manifest - VERSION_DISPLAY
|
|
2
|
-
|
|
3
|
-
> **项目名称**: OpenClaw Agent Dashboard
|
|
4
|
-
> **特性标识**: VERSION_DISPLAY
|
|
5
|
-
> **编写日期**: 2026-03-19
|
|
6
|
-
> **编写人员**: 架构师 (SA)
|
|
7
|
-
> **项目模式**: 增量开发(Incremental Mode)
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 需求到设计的映射表
|
|
12
|
-
|
|
13
|
-
| Requirement ID | Target File (Planned) | Change Intent | Allowed Symbols |
|
|
14
|
-
|----------------|----------------------|---------------|-----------------|
|
|
15
|
-
| [REQ_VERSION_DISPLAY_001] | src/backend/data/version_info_reader.py | CREATE | VersionInfoReader class, readVersionInfo(), _readBuildDate(), _readGitCommit() |
|
|
16
|
-
| [REQ_VERSION_DISPLAY_001] | src/backend/api/version.py | CREATE | router, VersionInfo(BaseModel), get_version_info() |
|
|
17
|
-
| [REQ_VERSION_DISPLAY_001] | src/backend/main.py | MODIFY | app.include_router(version_router) |
|
|
18
|
-
| [REQ_VERSION_DISPLAY_002] | frontend/src/components/common/VersionDisplay.vue | CREATE | VersionDisplay component, setup(), fetchVersionInfo() |
|
|
19
|
-
| [REQ_VERSION_DISPLAY_002] | frontend/src/composables/useVersionInfo.ts | CREATE (OPTIONAL) | useVersionInfo() |
|
|
20
|
-
| [REQ_VERSION_DISPLAY_002] | frontend/src/App.vue | MODIFY | import VersionDisplay, <VersionDisplay /> |
|
|
21
|
-
| [REQ_VERSION_DISPLAY_003] | frontend/src/managers/StateManager.ts | MODIFY | versionInfo field, setVersionInfo(), getVersionInfo() |
|
|
22
|
-
| [REQ_VERSION_DISPLAY_003] | frontend/src/managers/RealtimeDataManager.ts | MODIFY | loadVersionInfo(), getVersionInfo() |
|
|
23
|
-
| [REQ_VERSION_DISPLAY_004] | src/backend/data/version_info_reader.py | MODIFY | 环境变量读取逻辑 (DASHBOARD_VERSION, DASHBOARD_BUILD_DATE, DASHBOARD_GIT_COMMIT) |
|
|
24
|
-
| [REQ_VERSION_DISPLAY_004] | scripts/build-plugin.js | MODIFY (OPTIONAL) | 构建时间注入逻辑 |
|
|
25
|
-
|
|
26
|
-
---
|
|
27
|
-
|
|
28
|
-
## 变更类型统计
|
|
29
|
-
|
|
30
|
-
- **CREATE(新增文件)**: 4 个
|
|
31
|
-
- **MODIFY(修改文件)**: 4 个
|
|
32
|
-
|
|
33
|
-
## 文件清单
|
|
34
|
-
|
|
35
|
-
### 新增文件(4个)
|
|
36
|
-
1. `src/backend/data/version_info_reader.py` - 版本信息读取器
|
|
37
|
-
2. `src/backend/api/version.py` - 版本信息 API 路由
|
|
38
|
-
3. `frontend/src/components/common/VersionDisplay.vue` - 版本显示组件
|
|
39
|
-
4. `frontend/src/composables/useVersionInfo.ts` - 版本信息组合式函数(可选)
|
|
40
|
-
|
|
41
|
-
### 修改文件(4个)
|
|
42
|
-
1. `src/backend/main.py` - 注册版本信息路由
|
|
43
|
-
2. `frontend/src/App.vue` - 集成版本显示组件
|
|
44
|
-
3. `frontend/src/managers/StateManager.ts` - 新增版本信息状态缓存
|
|
45
|
-
4. `frontend/src/managers/RealtimeDataManager.ts` - 新增版本信息加载逻辑
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## 优先级说明
|
|
50
|
-
|
|
51
|
-
### P0(必须实现)
|
|
52
|
-
- [REQ_VERSION_DISPLAY_001]: 后端版本信息 API
|
|
53
|
-
- [REQ_VERSION_DISPLAY_002]: 前端版本信息组件
|
|
54
|
-
|
|
55
|
-
### P1(建议实现)
|
|
56
|
-
- [REQ_VERSION_DISPLAY_003]: 实时数据管理器集成
|
|
57
|
-
|
|
58
|
-
### P2(可选优化)
|
|
59
|
-
- [REQ_VERSION_DISPLAY_004]: 版本信息配置(环境变量支持)
|
|
60
|
-
- `frontend/src/composables/useVersionInfo.ts`: 组合式函数(可选,取决于是否需要复用逻辑)
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## 实施检查清单
|
|
65
|
-
|
|
66
|
-
### 阶段 1: 后端 API 实现
|
|
67
|
-
- [ ] 创建 `src/backend/data/version_info_reader.py`
|
|
68
|
-
- [ ] 创建 `src/backend/api/version.py`
|
|
69
|
-
- [ ] 修改 `src/backend/main.py` 注册路由
|
|
70
|
-
- [ ] 单元测试:验证 API 返回正确的版本信息
|
|
71
|
-
|
|
72
|
-
### 阶段 2: 前端组件实现
|
|
73
|
-
- [ ] 创建 `frontend/src/components/common/VersionDisplay.vue`
|
|
74
|
-
- [ ] 修改 `frontend/src/App.vue` 集成组件
|
|
75
|
-
- [ ] 本地测试:验证组件渲染和版本号显示
|
|
76
|
-
|
|
77
|
-
### 阶段 3: 实时数据管理集成
|
|
78
|
-
- [ ] 修改 `frontend/src/managers/StateManager.ts` 新增状态缓存
|
|
79
|
-
- [ ] 修改 `frontend/src/managers/RealtimeDataManager.ts` 实现自动加载
|
|
80
|
-
- [ ] 集成测试:验证应用启动时自动加载
|
|
81
|
-
|
|
82
|
-
### 阶段 4: 配置和构建优化(可选)
|
|
83
|
-
- [ ] 修改 `scripts/build-plugin.js` 确保版本信息正确注入
|
|
84
|
-
- [ ] 测试环境变量覆盖功能
|
|
85
|
-
- [ ] 端到端测试:验证从构建到部署的完整流程
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## 设计文档交叉引用
|
|
90
|
-
|
|
91
|
-
本 manifest 与以下设计文档配套使用:
|
|
92
|
-
- **设计文档**: `.staging/design/VERSION_DISPLAY_design.md`
|
|
93
|
-
- **需求文档**: `docs/specs/VERSION_DISPLAY_spec.md`
|
|
94
|
-
- **存量代码解剖**: `.staging/legacy_code_anatomy.md`
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
**文档版本**: 1.0.0
|
|
99
|
-
**最后更新**: 2026-03-19
|
|
100
|
-
**审核状态**: 待审核
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
# OpenClaw Agent Dashboard — 修改点汇总
|
|
2
|
-
|
|
3
|
-
本文档汇总近期对 **openclaw-agent-dashboard** 工程的修改,便于他人评审与追溯。
|
|
4
|
-
修改范围:TPM/RPM 统计、连接状态、Windows 启动、调试能力及文档。
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## 一、TPM 趋势无值 / 多接口 usage 兼容
|
|
9
|
-
|
|
10
|
-
### 问题
|
|
11
|
-
- 性能监控中 **TPM 趋势** 一直为 0,RPM 趋势有值。
|
|
12
|
-
- 原因:TPM 仅依赖 `usage.totalTokens`,而不同大模型/网关返回的 usage 格式不一(如 `input`/`output`、`input_tokens`/`output_tokens` 等),或上游未写入 totalTokens 导致为 0。
|
|
13
|
-
|
|
14
|
-
### 修改策略
|
|
15
|
-
- **不再枚举字段名**:采用两段逻辑——
|
|
16
|
-
1. 若有明确总量字段(`totalTokens` / `total_tokens` / `total`)且 > 0,直接使用;
|
|
17
|
-
2. 否则对 `usage` 内**所有数值**求和作为总 token 数,兼容任意命名。
|
|
18
|
-
- 避免对同一用量重复计算:有总量时只返回总量,不再参与求和。
|
|
19
|
-
|
|
20
|
-
### 涉及文件
|
|
21
|
-
| 文件 | 修改内容 |
|
|
22
|
-
|------|----------|
|
|
23
|
-
| `plugin/dashboard/api/performance.py` | `_tokens_from_usage()` 重写;新增 `GET /api/performance/debug-usage` 调试接口 |
|
|
24
|
-
| `src/backend/api/performance.py` | 同上(与 plugin 保持一致的逻辑与调试接口) |
|
|
25
|
-
| `plugin/dashboard/performance.py` | `_tokens_from_usage()` 与 plugin api 一致 |
|
|
26
|
-
| `src/backend/performance.py` | 同上 |
|
|
27
|
-
|
|
28
|
-
### 调试接口
|
|
29
|
-
- **GET** `/api/performance/debug-usage?limit=5`
|
|
30
|
-
- 返回:`openclaw_path`、`agents_path_exists`、`samples[]`(含 `usage_raw`、`tokens_computed`)。
|
|
31
|
-
- 用于确认 session 中实际 usage 结构及 TPM 为 0 是否因上游未写入 token 数。
|
|
32
|
-
|
|
33
|
-
### 说明
|
|
34
|
-
- 若 session 中 `usage` 各字段均为 0(如部分 vLLM/本地模型未回传 token),TPM 仍会为 0,需在**写 session 的上游**(OpenClaw/网关/模型适配层)补齐 usage 写入。
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## 二、右上角「连接错误」与 WebSocket 回退
|
|
39
|
-
|
|
40
|
-
### 问题
|
|
41
|
-
- Dashboard 右上角连接状态显示「连接错误」。
|
|
42
|
-
- 原因:WebSocket `ws://localhost:38271/ws` 连接失败或建立后因发送初始状态异常而断开;前端未及时进入 HTTP 轮询。
|
|
43
|
-
|
|
44
|
-
### 后端修改
|
|
45
|
-
- **发送初始状态失败时**:捕获异常后仍发送最小 `full_state` payload(空列表/空对象),保持连接不因异常关闭。
|
|
46
|
-
- **心跳协议**:同时支持纯文本 `ping` 与 JSON `{"type":"ping",...}`,并统一以 JSON 回复 `{"type":"pong",...}`,与前端一致。
|
|
47
|
-
|
|
48
|
-
### 前端修改
|
|
49
|
-
- **WebSocket onerror**:除设置状态为 error 外,调用 `handleDisconnect()`,进入重连或 HTTP 轮询,避免一直停在「连接错误」。
|
|
50
|
-
- **重连次数**:默认由 5 次改为 3 次,更快 fallback 到 HTTP 轮询。
|
|
51
|
-
|
|
52
|
-
### 涉及文件
|
|
53
|
-
| 文件 | 修改内容 |
|
|
54
|
-
|------|----------|
|
|
55
|
-
| `plugin/dashboard/api/websocket.py` | 初始状态异常时发最小 payload;心跳支持 JSON ping/pong |
|
|
56
|
-
| `src/backend/api/websocket.py` | 同上 |
|
|
57
|
-
| `frontend/src/managers/RealtimeDataManager.ts` | onerror 时调用 handleDisconnect();reconnectMaxAttempts 默认 3 |
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## 三、Windows 下 `npm run start` 报错
|
|
62
|
-
|
|
63
|
-
### 问题
|
|
64
|
-
- 在 Windows PowerShell 执行 `npm run start` 报错:`'OPENCLAW_HOME' 不是内部或外部命令`。
|
|
65
|
-
- 原因:`package.json` 的 start 脚本使用 Linux/Mac 环境变量语法(`OPENCLAW_HOME=${OPENCLAW_HOME:-$HOME/.openclaw} ...`),在 Windows CMD 下无法解析。
|
|
66
|
-
|
|
67
|
-
### 修改
|
|
68
|
-
- 新增 **Node 跨平台启动脚本** `scripts/start.js`:
|
|
69
|
-
- 根据 `OPENCLAW_HOME`、`DASHBOARD_PORT` 环境变量或默认值设置;
|
|
70
|
-
- Windows 使用 `python`,非 Windows 使用 `python3`;
|
|
71
|
-
- 在 `src/backend` 目录下执行 `uvicorn main:app --host 0.0.0.0 --port <port>`。
|
|
72
|
-
- **package.json**:`start` 脚本改为 `node scripts/start.js`。
|
|
73
|
-
|
|
74
|
-
### 涉及文件
|
|
75
|
-
| 文件 | 修改内容 |
|
|
76
|
-
|------|----------|
|
|
77
|
-
| `scripts/start.js` | 新增,跨平台启动 Dashboard 后端 |
|
|
78
|
-
| `package.json` | `"start": "node scripts/start.js"` |
|
|
79
|
-
|
|
80
|
-
### 说明
|
|
81
|
-
- 不影响 Ubuntu/Debian 等 Linux 行为;若已设置 `OPENCLAW_HOME`、`DASHBOARD_PORT`,仍会生效。
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## 四、文档与运维
|
|
86
|
-
|
|
87
|
-
### 新增/更新文档
|
|
88
|
-
| 文件 | 用途 |
|
|
89
|
-
|------|------|
|
|
90
|
-
| `RESTART_AND_BUILD.md` | 重启服务、是否需重新打包、一条龙命令(含 Windows PowerShell);插件部署与独立运行两种方式 |
|
|
91
|
-
| `docs/CHANGELOG_AGENT_MODIFICATIONS.md` | 本修改汇总文档,供他人评审 |
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## 五、修改文件清单(便于 diff / code review)
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
openclaw-agent-dashboard-main/
|
|
99
|
-
├── package.json # start 改为 node scripts/start.js
|
|
100
|
-
├── RESTART_AND_BUILD.md # 新增:重启与打包说明
|
|
101
|
-
├── scripts/
|
|
102
|
-
│ └── start.js # 新增:跨平台启动脚本
|
|
103
|
-
├── docs/
|
|
104
|
-
│ └── CHANGELOG_AGENT_MODIFICATIONS.md # 本文件
|
|
105
|
-
├── frontend/src/managers/
|
|
106
|
-
│ └── RealtimeDataManager.ts # WebSocket 失败回退与重连次数
|
|
107
|
-
├── plugin/dashboard/api/
|
|
108
|
-
│ ├── performance.py # _tokens_from_usage + debug-usage
|
|
109
|
-
│ └── websocket.py # 初始状态容错 + JSON 心跳
|
|
110
|
-
├── plugin/dashboard/
|
|
111
|
-
│ └── performance.py # _tokens_from_usage 与 api 一致
|
|
112
|
-
├── src/backend/api/
|
|
113
|
-
│ ├── performance.py # 同 plugin/dashboard/api/performance
|
|
114
|
-
│ └── websocket.py # 同 plugin/dashboard/api/websocket
|
|
115
|
-
└── src/backend/
|
|
116
|
-
└── performance.py # _tokens_from_usage 与 api 一致
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
---
|
|
120
|
-
|
|
121
|
-
## 六、建议评审关注点
|
|
122
|
-
|
|
123
|
-
1. **TPM 逻辑**:`_tokens_from_usage` 先取总量、再对 usage 全数值求和的策略是否满足业务(有无误把非 token 数字加进去的风险)。
|
|
124
|
-
2. **WebSocket**:初始状态失败时发最小 payload 是否与前端约定一致;JSON ping/pong 与现有客户端兼容性。
|
|
125
|
-
3. **前端**:onerror 时立即 handleDisconnect 与 onclose 的重复调用是否会导致双重重连定时器(当前实现中 scheduleReconnect 会先 stopReconnect,一般只保留一个定时器)。
|
|
126
|
-
4. **Windows 启动**:`scripts/start.js` 中 `OPENCLAW_HOME` 默认路径、`python`/`python3` 选择在目标环境是否均可用。
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
**文档版本**:v1.0
|
|
131
|
-
**整理日期**:2026-03-13
|
|
132
|
-
**工程**:openclaw-agent-dashboard(含 plugin 与 src/backend 两套路径)
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
# 维护者全量发布流程
|
|
2
|
-
|
|
3
|
-
从「新增功能」到 **npm 发布**、**Git 推送与 GitHub Release**、**本机与其他环境更新插件** 的完整操作清单(与当前仓库结构一致:`plugin/` 为 npm 发布根、`npm run publish:npm`、推送 `v*` 标签触发 Release)。
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 一、开发阶段
|
|
8
|
-
|
|
9
|
-
1. 在仓库内修改代码(`frontend/`、`src/backend/`、`plugin/index.js` 等)。
|
|
10
|
-
2. 本地验证:
|
|
11
|
-
```bash
|
|
12
|
-
npm run pack
|
|
13
|
-
```
|
|
14
|
-
必要时使用 `npm run deploy` 装到本机 OpenClaw 做联调,并重启 Gateway 验证行为。
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 二、发版前:统一版本号
|
|
19
|
-
|
|
20
|
-
新版本号在三处保持一致(示例 `1.0.18`):
|
|
21
|
-
|
|
22
|
-
| 文件 | 字段 |
|
|
23
|
-
|------|------|
|
|
24
|
-
| `plugin/package.json` | `"version"` |
|
|
25
|
-
| `plugin/openclaw.plugin.json` | `"version"` |
|
|
26
|
-
| 根目录 `package.json` | `"version"`(与上保持一致,便于对照) |
|
|
27
|
-
|
|
28
|
-
> GitHub Actions 中 Release 使用的版本来自 **`plugin/openclaw.plugin.json`**。Git 标签建议使用 **`v` + 该版本号**(如 `v1.0.18`),与 CI 一致。
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 三、打包自检(发布前必跑)
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd /path/to/openclaw-agent-dashboard
|
|
36
|
-
npm run pack
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
确认无报错。`plugin/dashboard`、`plugin/frontend-dist`、`plugin/scripts` 由 `build-plugin.js` 生成;`plugin/scripts/` 已在 `.gitignore` 中,无需提交。
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## 四、发布到 npm
|
|
44
|
-
|
|
45
|
-
用户执行 `openclaw plugins install openclaw-agent-dashboard@…` 时,会从 **npm 公共仓库** 拉取已发布的包。
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm login # 若尚未登录
|
|
49
|
-
npm run publish:npm
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
等价于:先执行 `pack`,再 `npm publish --prefix plugin`。
|
|
53
|
-
|
|
54
|
-
发布后自检:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npm view openclaw-agent-dashboard version
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## 五、Git:推送代码 + 打标签(触发 GitHub Release)
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
git add -A
|
|
66
|
-
git commit -m "feat: 功能说明(v1.0.18)"
|
|
67
|
-
git push origin main
|
|
68
|
-
|
|
69
|
-
git tag -a v1.0.18 -m "Release 1.0.18"
|
|
70
|
-
git push origin v1.0.18
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
- **`main`**:保存源码与文档。
|
|
74
|
-
- **`v1.0.18`**:推送后触发 `.github/workflows/release.yml`,构建并上传 **GitHub Release** 及 `openclaw-agent-dashboard-v*.tgz`(以仓库内 workflow 为准)。
|
|
75
|
-
|
|
76
|
-
在 GitHub **Actions** 中确认 Release 工作流成功结束。
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 六、本机 / 服务器:更新已安装的插件
|
|
81
|
-
|
|
82
|
-
插件已通过 **npm** 安装到 `~/.openclaw/extensions/openclaw-agent-dashboard` 时,推荐:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
openclaw plugins update openclaw-agent-dashboard
|
|
86
|
-
# 若 CLI 支持更新全部 npm 插件:
|
|
87
|
-
# openclaw plugins update --all
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
然后重启 Gateway:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
openclaw gateway restart
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
若 **`requirements.txt` 有变更**,在扩展目录下再执行一次 Python 依赖安装:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
PLUGIN="$HOME/.openclaw/extensions/openclaw-agent-dashboard"
|
|
100
|
-
node "$PLUGIN/scripts/install-python-deps.js" "$PLUGIN"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Windows(PowerShell)**:
|
|
104
|
-
|
|
105
|
-
```powershell
|
|
106
|
-
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
107
|
-
node "$plugin\scripts\install-python-deps.js" $plugin
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
> **不要用** `openclaw plugins install …@latest` **代替**「升级」:已安装时可能被判定为全新安装且目录已存在而失败。升级以 `plugins update` 为准;若 CLI 不支持,再查阅 `openclaw plugins --help` 或 README「迁移 / 升级」章节。
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 七、一页顺序(速查)
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
改代码
|
|
118
|
-
→ 三处版本号 +1
|
|
119
|
-
→ npm run pack
|
|
120
|
-
→ npm run publish:npm
|
|
121
|
-
→ git commit & push main
|
|
122
|
-
→ git tag vX.Y.Z && git push origin vX.Y.Z
|
|
123
|
-
→ 确认 GitHub Actions Release 成功
|
|
124
|
-
→ 本机:plugins update + gateway restart +(必要时)install-python-deps
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## 八、其他环境下的安装与升级
|
|
130
|
-
|
|
131
|
-
- 在 **npm 已发布新版本** 之后,在其他机器上执行:
|
|
132
|
-
```bash
|
|
133
|
-
openclaw plugins update openclaw-agent-dashboard
|
|
134
|
-
```
|
|
135
|
-
或指定版本:
|
|
136
|
-
```bash
|
|
137
|
-
openclaw plugins install openclaw-agent-dashboard@1.0.18
|
|
138
|
-
```
|
|
139
|
-
然后重启 Gateway;依赖有变时同样执行 `install-python-deps.js`。
|
|
140
|
-
- **从 path 安装迁到 npm**、或出现 `plugin already exists` 时,见仓库根目录 **README**「从 path / 旧版安装迁移到 npm」。
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## 九、Windows 下怎么处理
|
|
145
|
-
|
|
146
|
-
开发与发布命令(`npm run pack`、`npm run publish:npm`、`git`、`openclaw`)在 **PowerShell** 或 **CMD** 中与 macOS/Linux **相同**,注意路径与删除方式即可。
|
|
147
|
-
|
|
148
|
-
### 9.1 环境
|
|
149
|
-
|
|
150
|
-
- 安装 [Node.js LTS](https://nodejs.org/),并确保 `node`、`npm` 在 PATH。
|
|
151
|
-
- 安装 [Python 3](https://www.python.org/downloads/),勾选 **Add python.exe to PATH**。
|
|
152
|
-
- 安装 [Git for Windows](https://git-scm.com/download/win),使用自带的 **Git Bash** 或系统里的 `git`。
|
|
153
|
-
- 全局安装 OpenClaw:`npm install -g openclaw`(保证 `openclaw` 在 PATH)。
|
|
154
|
-
|
|
155
|
-
### 9.2 插件目录位置
|
|
156
|
-
|
|
157
|
-
扩展目录一般为:
|
|
158
|
-
|
|
159
|
-
```text
|
|
160
|
-
%USERPROFILE%\.openclaw\extensions\openclaw-agent-dashboard
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
PowerShell 中:
|
|
164
|
-
|
|
165
|
-
```powershell
|
|
166
|
-
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### 9.3 安装 / 升级插件(与其他平台一致)
|
|
170
|
-
|
|
171
|
-
```powershell
|
|
172
|
-
openclaw plugins install openclaw-agent-dashboard@latest
|
|
173
|
-
# 或
|
|
174
|
-
openclaw plugins update openclaw-agent-dashboard
|
|
175
|
-
|
|
176
|
-
openclaw gateway restart
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
### 9.4 Python 依赖(venv 在 `dashboard\.venv`)
|
|
180
|
-
|
|
181
|
-
```powershell
|
|
182
|
-
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
183
|
-
node "$plugin\scripts\install-python-deps.js" $plugin --verbose
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
### 9.5 迁移时出现 `plugin already exists`(删扩展目录)
|
|
187
|
-
|
|
188
|
-
**PowerShell:**
|
|
189
|
-
|
|
190
|
-
```powershell
|
|
191
|
-
openclaw plugins uninstall openclaw-agent-dashboard --force
|
|
192
|
-
Remove-Item -Recurse -Force "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
193
|
-
openclaw plugins install openclaw-agent-dashboard@latest
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
### 9.6 仓库内 `npm run deploy` / `npm run pack`
|
|
197
|
-
|
|
198
|
-
在仓库根目录打开 PowerShell,`cd` 到项目路径后执行即可;**不要依赖 bash** 即可完成打包与发布。
|
|
199
|
-
|
|
200
|
-
- **`npm run bundle`** 若调用 `bash scripts/bundle.sh`,在 Windows 上可改用 **Git Bash** 执行,或仅用 `npm run pack` + `publish:npm`,由 **GitHub Actions** 生成 Release 压缩包。
|
|
201
|
-
|
|
202
|
-
### 9.7 可选:WSL
|
|
203
|
-
|
|
204
|
-
在 **WSL2(Ubuntu 等)** 里开发时,路径与 Linux 文档一致(`~/.openclaw/...`);注意 WSL 与 Windows 两套 OpenClaw 配置**不共用**同一 `~`,按你实际运行 Gateway 的环境选择一套即可。
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## 十、相关文档
|
|
209
|
-
|
|
210
|
-
- 用户安装与迁移:**[README.md](../README.md)**
|
|
211
|
-
- 历史发布说明:**[release-guide.md](./release-guide.md)**(若与本文冲突,以本文与当前 `package.json` / workflow 为准)
|
package/docs/Openclaw-Agent-Dashboard/345/217/221/345/270/203/344/270/216/346/233/264/346/226/260.md
DELETED
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# 维护者全量发布流程
|
|
2
|
-
|
|
3
|
-
从「新增功能」到 **npm 发布**、**Git 推送与 GitHub Release**、**本机与其他环境更新插件** 的完整操作清单(与当前仓库结构一致:`plugin/` 为 npm 发布根、`npm run publish:npm`、推送 `v*` 标签触发 Release)。
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## 一、开发阶段
|
|
8
|
-
|
|
9
|
-
1. 在仓库内修改代码(`frontend/`、`src/backend/`、`plugin/index.js` 等)。
|
|
10
|
-
2. 本地验证:
|
|
11
|
-
```bash
|
|
12
|
-
npm run pack
|
|
13
|
-
```
|
|
14
|
-
必要时使用 `npm run deploy` 装到本机 OpenClaw 做联调,并重启 Gateway 验证行为。
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
## 二、发版前:统一版本号
|
|
19
|
-
|
|
20
|
-
新版本号在三处保持一致(示例 `1.0.18`):
|
|
21
|
-
|
|
22
|
-
| 文件 | 字段 |
|
|
23
|
-
|------|------|
|
|
24
|
-
| `plugin/package.json` | `"version"` |
|
|
25
|
-
| `plugin/openclaw.plugin.json` | `"version"` |
|
|
26
|
-
| 根目录 `package.json` | `"version"`(与上保持一致,便于对照) |
|
|
27
|
-
|
|
28
|
-
> GitHub Actions 中 Release 使用的版本来自 **`plugin/openclaw.plugin.json`**。Git 标签建议使用 **`v` + 该版本号**(如 `v1.0.18`),与 CI 一致。
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
## 三、打包自检(发布前必跑)
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
cd /path/to/openclaw-agent-dashboard
|
|
36
|
-
npm run pack
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
确认无报错。`plugin/dashboard`、`plugin/frontend-dist`、`plugin/scripts` 由 `build-plugin.js` 生成;`plugin/scripts/` 已在 `.gitignore` 中,无需提交。
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## 四、发布到 npm
|
|
44
|
-
|
|
45
|
-
用户执行 `openclaw plugins install openclaw-agent-dashboard@…` 时,会从 **npm 公共仓库** 拉取已发布的包。
|
|
46
|
-
|
|
47
|
-
```bash
|
|
48
|
-
npm login # 若尚未登录
|
|
49
|
-
npm run publish:npm
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
等价于:先执行 `pack`,再 `npm publish --prefix plugin`。
|
|
53
|
-
|
|
54
|
-
发布后自检:
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npm view openclaw-agent-dashboard version
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
## 五、Git:推送代码 + 打标签(触发 GitHub Release)
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
git add -A
|
|
66
|
-
git commit -m "feat: 功能说明(v1.0.18)"
|
|
67
|
-
git push origin main
|
|
68
|
-
|
|
69
|
-
git tag -a v1.0.18 -m "Release 1.0.18"
|
|
70
|
-
git push origin v1.0.18
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
- **`main`**:保存源码与文档。
|
|
74
|
-
- **`v1.0.18`**:推送后触发 `.github/workflows/release.yml`,构建并上传 **GitHub Release** 及 `openclaw-agent-dashboard-v*.tgz`(以仓库内 workflow 为准)。
|
|
75
|
-
|
|
76
|
-
在 GitHub **Actions** 中确认 Release 工作流成功结束。
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 六、本机 / 服务器:更新已安装的插件
|
|
81
|
-
|
|
82
|
-
插件已通过 **npm** 安装到 `~/.openclaw/extensions/openclaw-agent-dashboard` 时,推荐:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
openclaw plugins update openclaw-agent-dashboard
|
|
86
|
-
# 若 CLI 支持更新全部 npm 插件:
|
|
87
|
-
# openclaw plugins update --all
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
然后重启 Gateway:
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
openclaw gateway restart
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
若 **`requirements.txt` 有变更**,在扩展目录下再执行一次 Python 依赖安装:
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
PLUGIN="$HOME/.openclaw/extensions/openclaw-agent-dashboard"
|
|
100
|
-
node "$PLUGIN/scripts/install-python-deps.js" "$PLUGIN"
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Windows(PowerShell)**:
|
|
104
|
-
|
|
105
|
-
```powershell
|
|
106
|
-
$plugin = "$env:USERPROFILE\.openclaw\extensions\openclaw-agent-dashboard"
|
|
107
|
-
node "$plugin\scripts\install-python-deps.js" $plugin
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
> **不要用** `openclaw plugins install …@latest` **代替**「升级」:已安装时可能被判定为全新安装且目录已存在而失败。升级以 `plugins update` 为准;若 CLI 不支持,再查阅 `openclaw plugins --help` 或 README「迁移 / 升级」章节。
|
|
111
|
-
|
|
112
|
-
---
|
|
113
|
-
|
|
114
|
-
## 七、一页顺序(速查)
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
改代码
|
|
118
|
-
→ 三处版本号 +1
|
|
119
|
-
→ npm run pack
|
|
120
|
-
→ npm run publish:npm
|
|
121
|
-
→ git commit & push main
|
|
122
|
-
→ git tag vX.Y.Z && git push origin vX.Y.Z
|
|
123
|
-
→ 确认 GitHub Actions Release 成功
|
|
124
|
-
→ 本机:plugins update + gateway restart +(必要时)install-python-deps
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
---
|
|
128
|
-
|
|
129
|
-
## 八、其他环境下的安装与升级
|
|
130
|
-
|
|
131
|
-
- 在 **npm 已发布新版本** 之后,在其他机器上执行:
|
|
132
|
-
```bash
|
|
133
|
-
openclaw plugins update openclaw-agent-dashboard
|
|
134
|
-
```
|
|
135
|
-
或指定版本:
|
|
136
|
-
```bash
|
|
137
|
-
openclaw plugins install openclaw-agent-dashboard@1.0.18
|
|
138
|
-
```
|
|
139
|
-
然后重启 Gateway;依赖有变时同样执行 `install-python-deps.js`。
|
|
140
|
-
- **从 path 安装迁到 npm**、或出现 `plugin already exists` 时,见仓库根目录 **README**「从 path / 旧版安装迁移到 npm」。
|
|
141
|
-
|
|
142
|
-
---
|
|
143
|
-
|
|
144
|
-
## 九、相关文档
|
|
145
|
-
|
|
146
|
-
- 用户安装与迁移:**[README.md](../README.md)**
|
|
147
|
-
- 历史发布说明:**[release-guide.md](./release-guide.md)**(若与本文冲突,以本文与当前 `package.json` / workflow 为准)
|