feat(client): persist digital employee snapshots

This commit is contained in:
baiyanyun
2026-06-05 16:27:15 +08:00
parent 15a3285ed5
commit 40151c3902
5 changed files with 251 additions and 63 deletions

View File

@@ -313,6 +313,43 @@ window.QimingClawBridge.digital.getSnapshot()
- 将 bridge snapshot 写入 Run/Event而不是只作为页面即时 projection。
-`/computer/chat` 请求生成真实 Task / Run / Event。
## Phase 4qimingclaw 本地状态服务雏形(已开始)
目标:让数字员工能力不只是页面 projection而是开始拥有 qimingclaw 自己的本地状态沉淀。
当前 qimingclaw 已新增:
```text
crates/agent-electron-client/src/main/services/digitalEmployee/stateService.ts
crates/agent-electron-client/src/main/ipc/digitalEmployeeHandlers.ts
```
新增 IPC
```text
digitalEmployee:getSnapshot
digitalEmployee:getState
```
当前职责:
- 主进程统一采集 Agent / MCP / Computer Server / Lanproxy / File Server / GUI Server / Sessions。
- 每次 snapshot 写入 `digital_employee_state_v1`
- 状态服务生成轻量事件 `service_snapshot`
- webview bridge 改为调用 `digitalEmployee:getSnapshot`,不再自行聚合多个 IPC。
当前边界:
- 状态服务仍是轻量版本,先使用 settings 表持久化。
- Plan / Task / Run / Event 还没有独立 SQLite 表。
- 当前事件主要记录服务状态变化,还没有接入 `/computer/chat` 和 ACP token/event stream。
下一步:
- 新建正式 SQLite 表:`digital_plans``digital_tasks``digital_runs``digital_events``digital_artifacts``digital_approvals`
- 在 computer server 的 `/computer/chat` 入口创建 Task / Run。
- 在 ACP event forwarder 中写入 Run/Event。
### 产出
- 数字员工页面可以从源码重新构建。