evolclaw-web 1.0.0

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.
@@ -0,0 +1,251 @@
1
+ :root {
2
+ --bg: #0d1117;
3
+ --bg2: #161b22;
4
+ --bg3: #21262d;
5
+ --border: #30363d;
6
+ --fg: #e6edf3;
7
+ --dim: #8b949e;
8
+ --accent: #58a6ff;
9
+ --green: #3fb950;
10
+ --red: #f85149;
11
+ --orange: #db8e3c;
12
+ --blue: #58a6ff;
13
+ --magenta: #bc8cff;
14
+ }
15
+
16
+ * { box-sizing: border-box; margin: 0; padding: 0; }
17
+
18
+ body {
19
+ font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace;
20
+ background: var(--bg);
21
+ color: var(--fg);
22
+ font-size: 13px;
23
+ height: 100vh;
24
+ overflow: hidden;
25
+ }
26
+
27
+ /* ── 配对页 ── */
28
+ .pair-page {
29
+ display: flex; align-items: center; justify-content: center;
30
+ height: 100vh;
31
+ }
32
+ .pair-box {
33
+ background: var(--bg2);
34
+ border: 1px solid var(--border);
35
+ border-radius: 12px;
36
+ padding: 40px 48px;
37
+ text-align: center;
38
+ min-width: 320px;
39
+ }
40
+ .pair-box h1 { font-size: 22px; margin-bottom: 8px; }
41
+ .pair-hint { color: var(--dim); margin-bottom: 24px; }
42
+ .pair-box input {
43
+ width: 100%;
44
+ font-size: 28px;
45
+ letter-spacing: 12px;
46
+ text-align: center;
47
+ padding: 12px;
48
+ background: var(--bg);
49
+ border: 1px solid var(--border);
50
+ border-radius: 8px;
51
+ color: var(--fg);
52
+ margin-bottom: 16px;
53
+ }
54
+ .pair-box input:focus { outline: none; border-color: var(--accent); }
55
+ .pair-box button {
56
+ width: 100%;
57
+ padding: 12px;
58
+ font-size: 15px;
59
+ background: var(--accent);
60
+ color: #fff;
61
+ border: none;
62
+ border-radius: 8px;
63
+ cursor: pointer;
64
+ }
65
+ .pair-box button:hover { opacity: 0.9; }
66
+ .pair-error { color: var(--red); margin-top: 12px; min-height: 18px; }
67
+ .pair-code-display { font-size: 48px; font-weight: 700; letter-spacing: 8px; color: var(--accent); margin: 16px 0 4px; cursor: default; }
68
+ .pair-countdown { font-size: 12px; color: var(--dim); margin-bottom: 20px; }
69
+
70
+ /* ── 主面板布局 ── */
71
+ .app { display: flex; flex-direction: column; height: 100vh; }
72
+ .topbar {
73
+ display: flex; align-items: center; gap: 24px;
74
+ padding: 0 16px; height: 44px;
75
+ background: var(--bg2);
76
+ border-bottom: 1px solid var(--border);
77
+ flex-shrink: 0;
78
+ }
79
+ .brand { font-weight: 600; }
80
+ .tabs { display: flex; gap: 4px; }
81
+ .tab {
82
+ background: none; border: none; color: var(--dim);
83
+ padding: 6px 14px; cursor: pointer; border-radius: 6px;
84
+ font-size: 13px; font-family: inherit;
85
+ }
86
+ .tab:hover { color: var(--fg); background: var(--bg3); }
87
+ .tab.active { color: var(--accent); background: var(--bg3); }
88
+ .conn-status { margin-left: auto; color: var(--dim); font-size: 12px; }
89
+ .conn-status.ok { color: var(--green); }
90
+ .conn-status.err { color: var(--red); }
91
+ .logout-btn { margin-left: 8px; padding: 2px 8px; font-size: 12px; background: none; border: 1px solid var(--border); border-radius: 4px; color: var(--dim); cursor: pointer; }
92
+ .logout-btn:hover { color: var(--red); border-color: var(--red); }
93
+
94
+ .content { flex: 1; overflow: hidden; position: relative; }
95
+ .view { display: none; height: 100%; overflow: auto; }
96
+ .view.active { display: block; }
97
+
98
+ /* ── AID 表格 ── */
99
+ table { width: 100%; border-collapse: collapse; font-size: 12px; }
100
+ th, td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
101
+ th { color: var(--dim); font-weight: 500; position: sticky; top: 0; background: var(--bg2); }
102
+ tr:hover td { background: var(--bg2); }
103
+ .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
104
+ .dot.on { background: var(--green); }
105
+ .dot.off { background: var(--red); }
106
+ .dot.idle { background: var(--orange); }
107
+ .preview { color: var(--dim); max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
108
+ .banner { padding: 10px 16px; background: #3d2a1a; color: var(--orange); border-bottom: 1px solid var(--border); }
109
+ .empty { padding: 40px; text-align: center; color: var(--dim); }
110
+
111
+ /* ── Messages 三栏 ── */
112
+ .msg-layout, .sess-layout { display: flex; height: 100%; }
113
+ .msg-col { overflow-y: auto; height: 100%; }
114
+ .msg-aids { width: 220px; border-right: 1px solid var(--border); flex-shrink: 0; }
115
+ .msg-peers { width: 240px; border-right: 1px solid var(--border); flex-shrink: 0; }
116
+ .msg-stream { flex: 1; padding: 12px; }
117
+ .list-item {
118
+ padding: 8px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
119
+ }
120
+ .list-item:hover { background: var(--bg2); }
121
+ .list-item.sel { background: var(--bg3); border-left: 2px solid var(--accent); }
122
+ .list-item .name { font-weight: 500; }
123
+ .list-item .sub { color: var(--dim); font-size: 11px; margin-top: 2px; }
124
+ .col-title { padding: 8px 12px; color: var(--dim); font-size: 11px; text-transform: uppercase; position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--border); }
125
+
126
+ .bubble { margin-bottom: 12px; max-width: 80%; }
127
+ .bubble.in { margin-right: auto; }
128
+ .bubble.out { margin-left: auto; }
129
+ .bubble .meta { font-size: 11px; color: var(--dim); margin-bottom: 3px; }
130
+ .bubble .body {
131
+ padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; word-break: break-word;
132
+ background: var(--bg2); border: 1px solid var(--border);
133
+ }
134
+ .bubble.in .body { border-left: 2px solid var(--green); }
135
+ .bubble.out .body { border-left: 2px solid var(--blue); }
136
+ .tag { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 10px; margin-left: 4px; background: var(--bg3); color: var(--magenta); }
137
+
138
+ /* ── Sessions ── */
139
+ .sess-list { width: 360px; border-right: 1px solid var(--border); flex-shrink: 0; display: flex; flex-direction: column; overflow: hidden; }
140
+ .sess-filter { padding: 10px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; flex-shrink: 0; }
141
+ .sess-filter select, .sess-filter input {
142
+ width: 100%; padding: 6px 8px; background: var(--bg); color: var(--fg);
143
+ border: 1px solid var(--border); border-radius: 6px; font-size: 12px; font-family: inherit;
144
+ }
145
+ .sess-filter select:focus, .sess-filter input:focus { outline: none; border-color: var(--accent); }
146
+ .sess-count { font-size: 11px; color: var(--dim); }
147
+ .sess-items { flex: 1; overflow-y: auto; }
148
+
149
+ .sess-items .list-item .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
150
+ .sess-items .list-item .sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
151
+ .bind-badge { display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; border-radius: 3px; background: var(--bg3); color: var(--accent); font-size: 10px; }
152
+ .bind-badge .dot { width: 6px; height: 6px; margin: 0; }
153
+ .msg-count { color: var(--dim); }
154
+
155
+ .sess-detail { flex: 1; padding: 0; overflow-y: auto; }
156
+
157
+ /* 会话头 */
158
+ .sess-header { position: sticky; top: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 12px 20px; z-index: 1; }
159
+ .sh-title { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
160
+ .sh-stats { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--dim); }
161
+ .sh-stat { display: inline-flex; align-items: center; gap: 4px; }
162
+ .sh-stat .dot { width: 7px; height: 7px; margin: 0 2px; }
163
+ .sh-path { font-size: 11px; color: var(--dim); margin-top: 6px; font-family: ui-monospace, Consolas, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
164
+
165
+ /* 顶部 4 类分类条 */
166
+ .sh-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
167
+ .cat-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 10px; font-size: 11px; background: var(--bg3); }
168
+ .cat-swatch { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
169
+ .cat-chip.cat-user_input .cat-swatch { background: var(--green); }
170
+ .cat-chip.cat-model_output .cat-swatch { background: var(--blue); }
171
+ .cat-chip.cat-tool_call .cat-swatch { background: var(--magenta); }
172
+ .cat-chip.cat-tool_result .cat-swatch { background: var(--orange); }
173
+ .cat-chip.cat-msg_send .cat-swatch { background: var(--cyan, #22d3a8); }
174
+
175
+ /* 视图切换工具条 */
176
+ .sess-toolbar { display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg); z-index: 1; }
177
+ .view-toggle { padding: 4px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--bg3); color: var(--fg); cursor: pointer; font-size: 12px; font-family: inherit; }
178
+ .view-toggle.active { background: var(--accent); border-color: var(--accent); color: #fff; }
179
+ .toolbar-hint { font-size: 11px; color: var(--dim); }
180
+ .turn-list { padding-top: 8px; }
181
+
182
+ /* 对话视图:仿微信气泡 */
183
+ .chat-row { display: flex; flex-direction: column; margin: 10px 20px; max-width: 72%; }
184
+ .chat-row.in { align-items: flex-start; margin-right: auto; }
185
+ .chat-row.out { align-items: flex-end; margin-left: auto; }
186
+ .chat-bubble { padding: 9px 13px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; line-height: 1.5; font-size: 13px; }
187
+ .chat-row.in .chat-bubble { background: var(--bg3); border-bottom-left-radius: 3px; }
188
+ .chat-row.out .chat-bubble { background: #2a6b3f; color: #eafff0; border-bottom-right-radius: 3px; }
189
+ .chat-time { font-size: 10px; color: var(--dim); margin-top: 3px; }
190
+
191
+ /* 处理过程折叠组 */
192
+ .proc-group { margin: 8px 20px; }
193
+ .proc-group > summary { cursor: pointer; color: var(--dim); font-size: 11px; padding: 4px 0; text-align: center; list-style: none; }
194
+ .proc-group > summary::-webkit-details-marker { display: none; }
195
+ .proc-group > summary:hover { color: var(--fg); }
196
+ .proc-body { border-left: 2px dashed var(--border); margin-left: 8px; padding-left: 4px; }
197
+ .proc-body .turn { margin: 8px 12px; }
198
+
199
+ /* 轮次:按 4 类着色(左色条 + 角色标签色)*/
200
+ .turn { margin: 0 20px 18px; border-left: 3px solid var(--border); padding-left: 12px; }
201
+ .turn:first-of-type { margin-top: 16px; }
202
+ .turn.cat-user_input { border-left-color: var(--green); }
203
+ .turn.cat-model_output { border-left-color: var(--blue); }
204
+ .turn.cat-tool_call { border-left-color: var(--magenta); }
205
+ .turn.cat-tool_result { border-left-color: var(--orange); }
206
+ .turn.cat-system { border-left-color: var(--dim); }
207
+
208
+ .turn-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
209
+ .turn-role { font-weight: 600; font-size: 12px; }
210
+ .turn.cat-user_input .turn-role { color: var(--green); }
211
+ .turn.cat-model_output .turn-role { color: var(--blue); }
212
+ .turn.cat-tool_call .turn-role { color: var(--magenta); }
213
+ .turn.cat-tool_result .turn-role { color: var(--orange); }
214
+ .turn.cat-system .turn-role { color: var(--dim); }
215
+ .turn-time { font-size: 11px; color: var(--dim); }
216
+ .turn-usage { font-size: 11px; color: var(--dim); margin-left: auto; }
217
+ .turn-blocks { display: flex; flex-direction: column; gap: 8px; }
218
+
219
+ /* 普通文本块 */
220
+ .blk-text { white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
221
+
222
+ /* 思考块(折叠) */
223
+ .blk-thinking { font-size: 12px; }
224
+ .blk-thinking summary { cursor: pointer; color: var(--magenta); opacity: 0.8; }
225
+ .blk-thinking-body { white-space: pre-wrap; word-break: break-word; color: var(--dim); margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--border); font-style: italic; }
226
+
227
+ /* 工具调用块 */
228
+ .blk-tool { background: var(--bg2); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
229
+ .tool-head { font-size: 12px; margin-bottom: 4px; }
230
+ .tool-name { font-weight: 600; color: var(--accent); font-family: ui-monospace, "SF Mono", Consolas, monospace; }
231
+ .tool-param { display: flex; gap: 8px; margin-top: 3px; font-size: 12px; align-items: baseline; }
232
+ .tool-param .pk { color: var(--dim); flex-shrink: 0; min-width: 64px; }
233
+ .tool-param .pv {
234
+ font-family: ui-monospace, "SF Mono", Consolas, monospace; color: var(--fg);
235
+ background: var(--bg); padding: 1px 6px; border-radius: 4px; word-break: break-all;
236
+ white-space: pre-wrap; display: block; flex: 1;
237
+ }
238
+
239
+ /* 工具结果块(折叠,默认收起) */
240
+ .blk-result { font-size: 12px; }
241
+ .blk-result summary { cursor: pointer; color: var(--dim); }
242
+ .blk-result.err summary { color: var(--red); }
243
+ .result-body {
244
+ margin-top: 6px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border);
245
+ border-radius: 6px; white-space: pre-wrap; word-break: break-word; max-height: 280px; overflow-y: auto;
246
+ font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 11.5px; line-height: 1.5;
247
+ }
248
+ .blk-result.err .result-body { border-color: var(--red); }
249
+
250
+
251
+
package/package.json ADDED
@@ -0,0 +1,30 @@
1
+ {
2
+ "name": "evolclaw-web",
3
+ "version": "1.0.0",
4
+ "description": "Web-based monitoring dashboard for EvolClaw",
5
+ "type": "module",
6
+ "bin": {
7
+ "evolclaw-web": "./dist/index.js"
8
+ },
9
+ "files": [
10
+ "dist/"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc && chmod +x dist/index.js && cp -r src/static dist/",
14
+ "prepublishOnly": "npm run build"
15
+ },
16
+ "keywords": ["evolclaw", "monitoring", "debug"],
17
+ "author": "",
18
+ "license": "MIT",
19
+ "peerDependencies": {
20
+ "evolclaw": ">=3.0.0"
21
+ },
22
+ "dependencies": {
23
+ "ws": "^8.18.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^22.0.0",
27
+ "@types/ws": "^8.5.10",
28
+ "typescript": "^5.6.0"
29
+ }
30
+ }