agents-dojo 0.1.6 → 0.1.7
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/monitor/.env.development +1 -0
- package/monitor/.env.production +1 -0
- package/monitor/ANIMATION_REQUIREMENTS.md +118 -0
- package/monitor/index.html +12 -0
- package/monitor/package-lock.json +2160 -0
- package/monitor/package.json +25 -0
- package/monitor/public/bg.png +0 -0
- package/monitor/public/bg_clean.png +0 -0
- package/monitor/public/positions.json +215 -0
- package/monitor/public/sprites/agent_default.png +0 -0
- package/monitor/public/sprites/cushion_0.png +0 -0
- package/monitor/public/sprites/cushion_1.png +0 -0
- package/monitor/public/sprites/cushion_10.png +0 -0
- package/monitor/public/sprites/cushion_2.png +0 -0
- package/monitor/public/sprites/cushion_3.png +0 -0
- package/monitor/public/sprites/cushion_4.png +0 -0
- package/monitor/public/sprites/cushion_5.png +0 -0
- package/monitor/public/sprites/cushion_6.png +0 -0
- package/monitor/public/sprites/cushion_7.png +0 -0
- package/monitor/public/sprites/cushion_8.png +0 -0
- package/monitor/public/sprites/cushion_9.png +0 -0
- package/monitor/public/sprites/master.png +0 -0
- package/monitor/public/sprites/stake_0.png +0 -0
- package/monitor/public/sprites/stake_1.png +0 -0
- package/monitor/public/sprites/stake_10.png +0 -0
- package/monitor/public/sprites/stake_2.png +0 -0
- package/monitor/public/sprites/stake_3.png +0 -0
- package/monitor/public/sprites/stake_4.png +0 -0
- package/monitor/public/sprites/stake_5.png +0 -0
- package/monitor/public/sprites/stake_6.png +0 -0
- package/monitor/public/sprites/stake_7.png +0 -0
- package/monitor/public/sprites/stake_8.png +0 -0
- package/monitor/public/sprites/stake_9.png +0 -0
- package/monitor/scripts/record-gif.py +53 -0
- package/monitor/src/App.tsx +22 -0
- package/monitor/src/components/AgentMenu.tsx +67 -0
- package/monitor/src/components/ChatPanel.tsx +214 -0
- package/monitor/src/components/LogPage.tsx +173 -0
- package/monitor/src/components/Stage.tsx +39 -0
- package/monitor/src/components/StatusBar.tsx +50 -0
- package/monitor/src/lib/dojo-app.ts +799 -0
- package/monitor/src/lib/interactables.ts +162 -0
- package/monitor/src/lib/store.ts +352 -0
- package/monitor/src/lib/types.ts +72 -0
- package/monitor/src/lib/ws-client.ts +66 -0
- package/monitor/src/main.tsx +9 -0
- package/monitor/src/vite-env.d.ts +1 -0
- package/monitor/tsconfig.json +14 -0
- package/monitor/vite.config.ts +13 -0
- package/package.json +2 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_MONITOR_WS_URL=ws://localhost:41242/monitor
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_MONITOR_WS_URL=ws://localhost:41242/monitor
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Monitor GUI 动画需求清单
|
|
2
|
+
|
|
3
|
+
以下是从历史对话中提取的所有前端动画相关需求,按时间顺序排列。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. 场景背景
|
|
8
|
+
|
|
9
|
+
- **R1.1** 使用指定的像素风道场背景图 (`bg_clean.png`)
|
|
10
|
+
- **R1.2** 页面缩放时,背景与角色位置保持同步,不能错位
|
|
11
|
+
- **R1.3** 固定设计分辨率 960×600,所有元素在 Pixi.js 内渲染
|
|
12
|
+
|
|
13
|
+
## 2. 角色基本形象
|
|
14
|
+
|
|
15
|
+
- **R2.1** 角色使用像素风 sprite,风格与道场背景匹配
|
|
16
|
+
- **R2.2** 角色大小与木桩差不多高(约 60-64px)
|
|
17
|
+
- **R2.3** 角色头顶显示名字标签,名字要清晰可辨
|
|
18
|
+
- **R2.4** 角色活动范围限定在地板区域(不能跑到墙壁上)
|
|
19
|
+
|
|
20
|
+
## 3. 角色动作集
|
|
21
|
+
|
|
22
|
+
- **R3.1** idle(站立发呆):站立,眨眼动画
|
|
23
|
+
- **R3.2** walk(走路):四帧走路动画,移动时自动切换
|
|
24
|
+
- **R3.3** sit(坐在蒲团上):蒲团上的打坐动画
|
|
25
|
+
- **R3.4** attack(打木桩):击打木桩的攻击动画
|
|
26
|
+
- **R3.5** daydream(站着发呆):和 idle 不同的发呆动画
|
|
27
|
+
- **R3.6** chat(聊天):两个 agent 面对面聊天的动画
|
|
28
|
+
- **R3.7** ~~坐地发呆~~ 已移除(效果不佳)
|
|
29
|
+
- **R3.8** ~~躺下~~ 已移除(像素分辨率限制,效果不佳)
|
|
30
|
+
|
|
31
|
+
## 4. 闲置行为(Idle Behavior)
|
|
32
|
+
|
|
33
|
+
- **R4.1** 无任务时,角色在地图上随机游荡(wander)
|
|
34
|
+
- **R4.2** 随机切换站立发呆(pause)和 daydream
|
|
35
|
+
- **R4.3** 移动时自动切换朝向(面向移动方向)
|
|
36
|
+
|
|
37
|
+
## 5. 角色与物品交互
|
|
38
|
+
|
|
39
|
+
### 5.1 蒲团(Cushion)
|
|
40
|
+
|
|
41
|
+
- **R5.1** 每个 agent 有固定的 home 蒲团位置
|
|
42
|
+
- **R5.2** agent 只能坐在自己的蒲团上,不能随地坐
|
|
43
|
+
- **R5.3** agent 坐到蒲团上时,蒲团有被压扁的动画
|
|
44
|
+
- **R5.4** agent 与蒲团的位置要精准对齐,不能浮空
|
|
45
|
+
|
|
46
|
+
### 5.2 木桩(Stake)
|
|
47
|
+
|
|
48
|
+
- **R5.5** 每个 agent 有固定的木桩位置
|
|
49
|
+
- **R5.6** agent 击打木桩时,木桩有受击晃动动画
|
|
50
|
+
- **R5.7** 木桩晃动必须在 agent 出拳后才触发(不是提前晃)
|
|
51
|
+
- **R5.8** agent 应当和木桩保持平行,站在木桩侧面击打
|
|
52
|
+
|
|
53
|
+
### 5.3 碰撞与移动
|
|
54
|
+
|
|
55
|
+
- **R5.9** agent 与蒲团、木桩之间有碰撞体积,不能穿过去
|
|
56
|
+
- **R5.10** 碰撞不能卡住 agent 移动(绕行而不是卡死)
|
|
57
|
+
- **R5.11** 物品交互框架化设计,便于后续添加新物品
|
|
58
|
+
- A: agent 设计避让
|
|
59
|
+
- A: 在下面的任务、物品可以挡住上面的,符合人类的观感
|
|
60
|
+
|
|
61
|
+
## 6. 任务驱动动画
|
|
62
|
+
|
|
63
|
+
- **R6.1** 收到任务(receiving)→ agent 走向 Master 老师傅
|
|
64
|
+
- **R6.2** 到达 Master 后 → 走向自己的木桩
|
|
65
|
+
- **R6.3** 执行任务(working/tool_call)→ 在木桩前做 attack 动画
|
|
66
|
+
- **R6.4** 任务完成(completed/failed)→ 走回蒲团 home 位置
|
|
67
|
+
|
|
68
|
+
## 7. Agent 间交互(Peer Chat)
|
|
69
|
+
|
|
70
|
+
- **R7.1** agent 之间交流时,两人走到空地面对面
|
|
71
|
+
- **R7.2** 面对面聊天时显示 chat 动画
|
|
72
|
+
- **R7.3** 支持多于两人一起沟通(不限两人)
|
|
73
|
+
- **R7.4** 聊天时头顶显示聊天气泡,显示消息内容
|
|
74
|
+
|
|
75
|
+
## 8. Master 老师傅
|
|
76
|
+
|
|
77
|
+
- **R8.1** 新增一个 Master 角色,固定在场景中央
|
|
78
|
+
- **R8.2** Master 只有 idle 动画(不移动)
|
|
79
|
+
- **R8.3** 当 client 与 agent 交互时,Master 呼唤 agent 过来
|
|
80
|
+
|
|
81
|
+
## 9. 其他 UI
|
|
82
|
+
|
|
83
|
+
- **R9.1** StatusBar 显示连接状态、agent 数量
|
|
84
|
+
- **R9.2** Logs 按钮进入聊天记录页面
|
|
85
|
+
|
|
86
|
+
## 10. 状态机
|
|
87
|
+
|
|
88
|
+
人物状态机以如下要求为准。
|
|
89
|
+
|
|
90
|
+
### 10.1 Client → Agent(外部任务)
|
|
91
|
+
|
|
92
|
+
| 状态 | 动画表现 |
|
|
93
|
+
|------|----------|
|
|
94
|
+
| `idle` | 坐在蒲团上发呆(闲置行为:偶尔起身随机游荡、daydream) |
|
|
95
|
+
| `submitted` | 从蒲团起身,走向 Master 老师傅 |
|
|
96
|
+
| `working` | 从 Master 处走向自己的木桩,开始打桩(attack 动画) |
|
|
97
|
+
| `input-required` | 停下打桩,走回 Master 前等待;收到输入后再回木桩继续 |
|
|
98
|
+
| `auth-required` | 同 `input-required`,走回 Master 前等待 |
|
|
99
|
+
| `completed` | 停下打桩,走回蒲团坐下 |
|
|
100
|
+
| `failed` | 打桩手痛 → 甩手动画 → 走回蒲团坐下 |
|
|
101
|
+
| `canceled` | 被 Master 叫回 → 立即停下当前动作,走回蒲团坐下 |
|
|
102
|
+
| `rejected` | 在 Master 前摇头拒绝 → 气泡显示拒绝原因 → 走回蒲团坐下 |
|
|
103
|
+
|
|
104
|
+
### 10.2 Agent → Agent(内部调用)
|
|
105
|
+
|
|
106
|
+
当 Agent A(处于 working/打桩中)调用 Agent B 时:
|
|
107
|
+
|
|
108
|
+
| 角色 | 行为 |
|
|
109
|
+
|------|------|
|
|
110
|
+
| Agent A(发起方) | 停下打桩 → 走向空地等 B → 面对面 chat → B 回复后回木桩继续打桩 |
|
|
111
|
+
| Agent B(被调用方) | 从蒲团起身 → 走向 A → 面对面 chat → 回复完毕后走回蒲团 |
|
|
112
|
+
|
|
113
|
+
关键规则:
|
|
114
|
+
- **判断依据**:看任务的 `from` 是 client 还是 agent,决定 working 状态的动画是打桩还是聊天
|
|
115
|
+
- A 和 B 在对话过程中都处于 `working` 状态,但动画表现为聊天(chat),不是打桩
|
|
116
|
+
- B 回复完成后(B 的任务 completed),B 走回蒲团
|
|
117
|
+
- A 拿到回复后,A 回木桩继续打桩(A 的任务仍在 working)
|
|
118
|
+
- 支持多人同时聊天(参考第 7 节)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>AgentsDojo Monitor</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="root"></div>
|
|
10
|
+
<script type="module" src="/src/main.tsx"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|