agent-loft 0.2.49 → 0.2.51

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,218 @@
1
+ /* ---------- 搜索会话弹窗(views/conv-search.js) ---------- */
2
+
3
+ /* 靠上显示:结果多少不同时输入框不跳 */
4
+ .overlay.search-overlay {
5
+ align-items: flex-start;
6
+ padding-top: 12vh;
7
+ }
8
+
9
+ .search-modal {
10
+ width: 100%;
11
+ max-width: 620px;
12
+ height: min(600px, 72dvh);
13
+ max-height: 72dvh;
14
+ display: flex;
15
+ flex-direction: column;
16
+ background: var(--bg);
17
+ border-radius: 16px;
18
+ box-shadow: var(--shadow);
19
+ overflow: hidden;
20
+ }
21
+
22
+ .search-head {
23
+ display: flex;
24
+ flex-shrink: 0;
25
+ align-items: center;
26
+ gap: 10px;
27
+ padding: 10px 10px 10px 16px;
28
+ border-bottom: 1px solid var(--border);
29
+ }
30
+
31
+ .search-icon {
32
+ display: inline-grid;
33
+ color: var(--fg-faint);
34
+ }
35
+
36
+ .search-icon svg {
37
+ width: 18px;
38
+ height: 18px;
39
+ }
40
+
41
+ .search-input {
42
+ flex: 1;
43
+ min-width: 0;
44
+ border: none;
45
+ outline: none;
46
+ background: transparent;
47
+ color: var(--fg);
48
+ font: inherit;
49
+ font-size: 16px;
50
+ padding: 6px 0;
51
+ }
52
+
53
+ /* 用自己的 × */
54
+ .search-input::-webkit-search-cancel-button {
55
+ display: none;
56
+ }
57
+
58
+ /* 专家筛选:一排小标签,放不下横向滚 */
59
+ .search-experts {
60
+ display: flex;
61
+ gap: 6px;
62
+ padding: 10px 16px;
63
+ overflow-x: auto;
64
+ scrollbar-width: none;
65
+ border-bottom: 1px solid var(--border);
66
+ flex-shrink: 0;
67
+ }
68
+
69
+ .search-experts::-webkit-scrollbar {
70
+ display: none;
71
+ }
72
+
73
+ .search-chip {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ gap: 5px;
77
+ flex-shrink: 0;
78
+ padding: 4px 11px;
79
+ border-radius: 999px;
80
+ border: 1px solid var(--border);
81
+ font-size: 13px;
82
+ color: var(--fg-soft);
83
+ white-space: nowrap;
84
+ }
85
+
86
+ .search-chip:hover {
87
+ color: var(--fg);
88
+ background: var(--bg-hover);
89
+ }
90
+
91
+ .search-chip.on {
92
+ background: var(--fg);
93
+ border-color: var(--fg);
94
+ color: var(--bg);
95
+ }
96
+
97
+ .search-chip .agent-icon {
98
+ display: inline-grid;
99
+ }
100
+
101
+ .search-chip .agent-icon svg {
102
+ width: 13px;
103
+ height: 13px;
104
+ }
105
+
106
+ .search-chip .agent-icon.expert-emoji {
107
+ font-size: 12px;
108
+ width: auto;
109
+ }
110
+
111
+ .search-results {
112
+ flex: 1;
113
+ overflow-y: auto;
114
+ padding: 6px;
115
+ min-height: 0;
116
+ }
117
+
118
+ .search-label {
119
+ font-size: 12px;
120
+ color: var(--fg-faint);
121
+ padding: 6px 10px 4px;
122
+ }
123
+
124
+ .search-empty {
125
+ padding: 28px 10px;
126
+ text-align: center;
127
+ font-size: 13px;
128
+ color: var(--fg-faint);
129
+ }
130
+
131
+ .search-hit {
132
+ display: flex;
133
+ align-items: center;
134
+ gap: 10px;
135
+ width: 100%;
136
+ padding: 8px 10px;
137
+ border-radius: 8px;
138
+ text-align: left;
139
+ }
140
+
141
+ .search-hit.sel {
142
+ background: var(--bg-hover);
143
+ }
144
+
145
+ .hit-icon {
146
+ display: inline-grid;
147
+ flex-shrink: 0;
148
+ color: var(--fg-soft);
149
+ }
150
+
151
+ .hit-icon .agent-icon {
152
+ display: inline-grid;
153
+ }
154
+
155
+ .hit-icon svg {
156
+ width: 16px;
157
+ height: 16px;
158
+ }
159
+
160
+ .search-hit .hit-body {
161
+ flex: 1;
162
+ min-width: 0;
163
+ display: flex;
164
+ flex-direction: column;
165
+ gap: 2px;
166
+ }
167
+
168
+ .hit-title,
169
+ .hit-snippet {
170
+ overflow: hidden;
171
+ white-space: nowrap;
172
+ text-overflow: ellipsis;
173
+ }
174
+
175
+ .hit-title {
176
+ font-size: 14px;
177
+ }
178
+
179
+ .hit-snippet {
180
+ font-size: 12px;
181
+ color: var(--fg-faint);
182
+ }
183
+
184
+ .search-hit mark {
185
+ background: none;
186
+ color: inherit;
187
+ font-weight: 600;
188
+ }
189
+
190
+ .hit-snippet mark {
191
+ color: var(--fg-soft);
192
+ }
193
+
194
+ .hit-meta {
195
+ flex-shrink: 0;
196
+ max-width: 40%;
197
+ overflow: hidden;
198
+ white-space: nowrap;
199
+ text-overflow: ellipsis;
200
+ font-size: 12px;
201
+ color: var(--fg-faint);
202
+ }
203
+
204
+ /* 手机:铺满宽度,贴着顶部 */
205
+ @media (max-width: 768px) {
206
+ .overlay.search-overlay {
207
+ padding: calc(8px + env(safe-area-inset-top)) 8px 8px;
208
+ }
209
+
210
+ .search-modal {
211
+ height: min(600px, calc(100dvh - env(safe-area-inset-top) - 24px));
212
+ max-height: calc(100% - 8px);
213
+ }
214
+
215
+ .hit-meta {
216
+ display: none;
217
+ }
218
+ }
@@ -152,7 +152,7 @@ button.conv-group:hover {
152
152
  }
153
153
 
154
154
  .sub-more .conv-more {
155
- padding-left: 36px;
155
+ padding-left: 10px;
156
156
  }
157
157
 
158
158
  .conv-item .lead {
@@ -161,17 +161,43 @@ button.conv-group:hover {
161
161
  opacity: 0.85;
162
162
  }
163
163
 
164
- .conv-item.sub {
165
- padding-left: 36px;
166
- }
167
-
168
164
  .proj-row {
169
165
  position: relative;
170
166
  margin-top: 2px;
171
167
  }
172
168
 
173
169
  .conv-item.proj {
174
- gap: 10px;
170
+ color: var(--fg-soft);
171
+ }
172
+
173
+ .conv-item.proj:hover {
174
+ color: var(--fg);
175
+ }
176
+
177
+ /* 标题后面的小三角:朝下 = 展开,朝右 = 折叠 */
178
+ .conv-item .caret {
179
+ display: inline-grid;
180
+ place-items: center;
181
+ flex-shrink: 0;
182
+ /* 点击区域大一点,视觉上不占地方 */
183
+ padding: 4px;
184
+ margin: -4px -4px -4px -2px;
185
+ border-radius: 4px;
186
+ color: var(--fg-faint);
187
+ transition: transform 0.15s;
188
+ }
189
+
190
+ .conv-item .caret svg {
191
+ width: 10px;
192
+ height: 10px;
193
+ }
194
+
195
+ .conv-item .caret.folded {
196
+ transform: rotate(-90deg);
197
+ }
198
+
199
+ .conv-item .caret[role="button"]:hover {
200
+ color: var(--fg);
175
201
  }
176
202
 
177
203
  /* 拖动目录排序:被拖的行变淡,落点处画一条横线 */
@@ -200,17 +226,6 @@ button.conv-group:hover {
200
226
  bottom: -2px;
201
227
  }
202
228
 
203
- .proj-icon {
204
- display: inline-grid;
205
- color: var(--fg-soft);
206
- flex-shrink: 0;
207
- }
208
-
209
- .proj-icon svg {
210
- width: 18px;
211
- height: 18px;
212
- }
213
-
214
229
  /* 目录行 hover 时右侧出现「在此目录开新对话」 */
215
230
  .proj-new {
216
231
  position: absolute;
@@ -230,8 +245,8 @@ button.conv-group:hover {
230
245
  height: 15px;
231
246
  }
232
247
 
248
+ /* 悬停加号时只提亮图标 */
233
249
  .proj-new:hover {
234
- background: var(--bg-soft);
235
250
  color: var(--fg);
236
251
  }
237
252
 
@@ -239,8 +254,11 @@ button.conv-group:hover {
239
254
  display: grid;
240
255
  }
241
256
 
257
+ /* 鼠标挪到右边的加号上时,整行的 hover 底色还留着 */
242
258
  .proj-row:hover .conv-item.proj {
243
259
  padding-right: 36px;
260
+ background: var(--bg-hover);
261
+ color: var(--fg);
244
262
  }
245
263
 
246
264
  @media (pointer: coarse) {
@@ -270,15 +288,28 @@ button.conv-group:hover {
270
288
  }
271
289
 
272
290
  .conv-item .title {
273
- flex: 1;
291
+ /* 不撑满:三角紧跟在标题后面,状态点靠右(见下面的 margin-left: auto) */
292
+ flex: 0 1 auto;
293
+ min-width: 0;
274
294
  overflow: hidden;
275
- text-overflow: ellipsis;
276
295
  white-space: nowrap;
277
296
  }
278
297
 
279
- /* 跑马灯滚动时去掉省略号 */
280
- .conv-item .title.marquee {
281
- text-overflow: clip;
298
+ /* 放不下:尾巴淡出,代替省略号(.clip 由 sidebar.js 量过后加) */
299
+ .conv-item .title.clip {
300
+ -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
301
+ mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
302
+ }
303
+
304
+ /* 跑马灯滚动时两头都淡出 */
305
+ .conv-item .title.clip.marquee {
306
+ -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
307
+ mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
308
+ }
309
+
310
+ .conv-item > .dot,
311
+ .conv-item > .conv-spin {
312
+ margin-left: auto;
282
313
  }
283
314
 
284
315
  .conv-item .badge {
@@ -330,8 +361,33 @@ button.conv-group:hover {
330
361
  }
331
362
 
332
363
  .conv-item .expert-mark {
364
+ display: none;
365
+ place-items: center;
366
+ flex-shrink: 0;
367
+ width: 14px;
368
+ height: 14px;
333
369
  font-size: 13px;
334
370
  line-height: 1;
371
+ color: var(--fg-soft);
372
+ }
373
+
374
+ .conv-item .expert-mark-icon {
375
+ display: inline-grid;
376
+ place-items: center;
377
+ width: 14px;
378
+ height: 14px;
379
+ }
380
+
381
+ .conv-item .expert-mark svg {
382
+ display: block;
383
+ width: 14px;
384
+ height: 14px;
385
+ }
386
+
387
+ @media (hover: hover) {
388
+ .conv-item:hover .expert-mark {
389
+ display: inline-grid;
390
+ }
335
391
  }
336
392
 
337
393
  /* ---- 侧栏底部的额度 ---- */
@@ -529,17 +585,11 @@ button.conv-group:hover {
529
585
  }
530
586
 
531
587
  /*
532
- * 分叉树:分叉对话缩进挂在主对话下面,虚线连起来。
533
- * 竖线从主对话标题下方往下走,每个分叉一个拐角;最后一个分叉的竖线只画到它的拐角为止。
588
+ * 分叉树:分叉对话缩进挂在主对话下面,左边一条细实线,最后一条拐个圆角接过去。
534
589
  * 行高约 34px(.conv-item 上下 7px + 一行字),拐角在 17px 处。
535
590
  */
536
591
  .fork-children {
537
- margin-left: 16px;
538
- }
539
-
540
- /* 「项目」里的会话行本身缩进 36px,竖线跟着右移 */
541
- .fork-children.in-proj {
542
- margin-left: 42px;
592
+ margin-left: 18px;
543
593
  }
544
594
 
545
595
  /* 分叉的分叉:竖线对齐上一层分叉的标题 */
@@ -547,8 +597,7 @@ button.conv-group:hover {
547
597
  margin-left: 14px;
548
598
  }
549
599
 
550
- .fork-children .conv-item,
551
- .fork-children .conv-item.sub {
600
+ .fork-children .conv-item {
552
601
  padding-left: 8px;
553
602
  }
554
603
 
@@ -557,38 +606,35 @@ button.conv-group:hover {
557
606
  padding-left: 14px;
558
607
  }
559
608
 
560
- .fork-node::before,
561
- .fork-node::after {
609
+ .fork-node::before {
562
610
  content: "";
563
611
  position: absolute;
564
612
  left: 0;
565
- border: 0 dashed var(--fg-faint);
566
- opacity: 0.7;
567
- pointer-events: none;
568
- }
569
-
570
- .fork-node::before {
571
613
  top: 0;
572
614
  bottom: 0;
573
- border-left-width: 1px;
574
- }
575
-
576
- /* 第一个分叉的竖线往上接到主对话那一行 */
577
- .fork-node:first-child::before {
578
- top: -6px;
615
+ border-left: 1px solid color-mix(in srgb, var(--fg-faint) 45%, transparent);
616
+ pointer-events: none;
579
617
  }
580
618
 
619
+ /* 最后一条:竖线到行中间,圆角拐向标题 */
581
620
  .fork-node:last-child::before {
582
621
  bottom: auto;
583
- height: 17px;
622
+ height: 15px;
623
+ width: 8px;
624
+ border-bottom: 1px solid color-mix(in srgb, var(--fg-faint) 45%, transparent);
625
+ border-bottom-left-radius: 8px;
584
626
  }
585
627
 
586
- .fork-node:first-child:last-child::before {
587
- height: 23px;
628
+ /* 折叠后的「N 个嵌套会话」 */
629
+ .conv-item.fork-more {
630
+ color: var(--fg-soft);
588
631
  }
589
632
 
590
- .fork-node::after {
591
- top: 17px;
592
- width: 10px;
593
- border-top-width: 1px;
633
+ .conv-item.fork-more:hover {
634
+ color: var(--fg);
635
+ }
636
+
637
+ /* 「搜索」和下面的「定时任务」挨着,间距和「新聊天」到它一样 */
638
+ .side-nav.search-nav {
639
+ margin-bottom: 0;
594
640
  }
@@ -155,16 +155,143 @@
155
155
  gap: 6px;
156
156
  }
157
157
 
158
+ /* 标题前的专家头像:点一下 / 鼠标停上去弹出专家信息卡 */
158
159
  .top-title .conv-expert-icon {
159
160
  display: inline-grid;
161
+ place-items: center;
160
162
  flex-shrink: 0;
161
- margin-left: 4px;
163
+ width: 28px;
164
+ height: 28px;
165
+ padding: 0;
166
+ margin-left: 2px;
167
+ border-radius: 50%;
168
+ line-height: 1;
162
169
  color: var(--fg-soft);
163
170
  }
164
171
 
165
- .top-title .conv-expert-icon svg {
166
- width: 16px;
167
- height: 16px;
172
+ .top-title .conv-expert-icon:hover {
173
+ background: var(--bg-hover);
174
+ }
175
+
176
+ .top-title .conv-expert-icon .agent-icon {
177
+ display: inline-grid;
178
+ place-items: center;
179
+ width: 18px;
180
+ height: 18px;
181
+ }
182
+
183
+ .top-title .conv-expert-icon svg,
184
+ .top-title .conv-expert-icon img {
185
+ display: block;
186
+ width: 18px;
187
+ height: 18px;
188
+ }
189
+
190
+ .top-title .conv-expert-icon .expert-emoji {
191
+ font-size: 16px;
192
+ }
193
+
194
+ /* ---- 专家信息卡 ---- */
195
+ .popover.expert-card {
196
+ width: 300px;
197
+ padding: 14px;
198
+ display: flex;
199
+ flex-direction: column;
200
+ gap: 10px;
201
+ }
202
+
203
+ .ec-head {
204
+ display: flex;
205
+ align-items: center;
206
+ gap: 10px;
207
+ }
208
+
209
+ .ec-avatar {
210
+ display: inline-grid;
211
+ place-items: center;
212
+ flex-shrink: 0;
213
+ width: 40px;
214
+ height: 40px;
215
+ border-radius: 50%;
216
+ background: var(--bg-soft);
217
+ color: var(--fg-soft);
218
+ }
219
+
220
+ .ec-avatar svg {
221
+ width: 24px;
222
+ height: 24px;
223
+ }
224
+
225
+ .ec-avatar img {
226
+ width: 40px;
227
+ height: 40px;
228
+ }
229
+
230
+ .ec-avatar.expert-emoji {
231
+ font-size: 22px;
232
+ line-height: 1;
233
+ }
234
+
235
+ .ec-name {
236
+ display: flex;
237
+ flex-direction: column;
238
+ gap: 2px;
239
+ min-width: 0;
240
+ }
241
+
242
+ .ec-name b {
243
+ font-size: 15px;
244
+ font-weight: 600;
245
+ overflow: hidden;
246
+ text-overflow: ellipsis;
247
+ white-space: nowrap;
248
+ }
249
+
250
+ .ec-sub {
251
+ font-size: 12px;
252
+ color: var(--fg-faint);
253
+ }
254
+
255
+ .ec-desc {
256
+ font-size: 13px;
257
+ color: var(--fg-soft);
258
+ line-height: 1.5;
259
+ }
260
+
261
+ .ec-rows {
262
+ display: flex;
263
+ flex-direction: column;
264
+ gap: 6px;
265
+ padding-top: 10px;
266
+ border-top: 1px solid var(--border);
267
+ font-size: 13px;
268
+ }
269
+
270
+ .ec-row {
271
+ display: flex;
272
+ gap: 10px;
273
+ align-items: baseline;
274
+ }
275
+
276
+ .ec-label {
277
+ flex: 0 0 56px;
278
+ color: var(--fg-faint);
279
+ }
280
+
281
+ .ec-value {
282
+ flex: 1;
283
+ min-width: 0;
284
+ display: flex;
285
+ align-items: baseline;
286
+ gap: 8px;
287
+ }
288
+
289
+ .ec-cwd {
290
+ flex: 1;
291
+ min-width: 0;
292
+ overflow-wrap: anywhere;
293
+ font-family: var(--mono);
294
+ font-size: 12px;
168
295
  }
169
296
 
170
297
  .top-title .conv-name {
package/web/index.html CHANGED
@@ -22,6 +22,7 @@
22
22
  <link rel="stylesheet" href="/css/loader.css" />
23
23
  <link rel="stylesheet" href="/css/composer.css" />
24
24
  <link rel="stylesheet" href="/css/overlay.css" />
25
+ <link rel="stylesheet" href="/css/search.css" />
25
26
  <link rel="stylesheet" href="/css/settings.css" />
26
27
  <link rel="stylesheet" href="/css/schedule.css" />
27
28
  <link rel="stylesheet" href="/css/todos.css" />
package/web/lib/dom.js CHANGED
@@ -37,10 +37,13 @@ export const ICON = {
37
37
  spark: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9Z"/><path d="M19 15l.8 2.2L22 18l-2.2.8L19 21l-.8-2.2L16 18l2.2-.8Z"/></svg>',
38
38
  clock: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>',
39
39
  down: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"><path d="m6 9 6 6 6-6"/></svg>',
40
+ search: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="11" cy="11" r="7"/><path d="m20 20-3.5-3.5"/></svg>',
41
+ caret:'<svg viewBox="0 0 10 10" fill="currentColor"><path d="M1.6 3.2h6.8L5 7.4Z"/></svg>',
40
42
  gear: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"/></svg>',
41
43
  fork: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="5" r="2"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="7" r="2"/><path d="M6 7v10"/><path d="M18 9c0 5-6 4-11.2 8.6"/></svg>',
42
44
  chat: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 11.5a8.4 8.4 0 0 1-12.3 7.5L3 20.5l1.6-5A8.4 8.4 0 1 1 21 11.5Z"/></svg>',
43
45
  copy: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>',
46
+ undo: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 10H3V4"/><path d="M3 10a9 9 0 1 1 2.6 9"/></svg>',
44
47
  x: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round"><path d="M18 6 6 18M6 6l12 12"/></svg>',
45
48
  plus: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M12 5v14M5 12h14"/></svg>',
46
49
  trash: '<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M8 6V4h8v2"/><path d="M19 6l-1 14H6L5 6"/><path d="M10 11v6M14 11v6"/></svg>',
@@ -68,20 +71,10 @@ export const ICON = {
68
71
  '<svg viewBox="2 4 44 40"><path fill="#00D6B9" d="M11.6 7H27.6C30.9 9.9 32.8 14.7 33.6 17C30.9 18.3 29 20.6 27 24C22.6 16.4 15.6 11 11.6 7Z"/><path fill="#133C9A" d="M17 29C21 29 25 26.9 28 23.4C36 14 41.4 16.8 44 18C38.5 21 40.5 29.6 33 36C27.5 34.8 21.8 32.2 17 29Z"/><path fill="#3370FF" d="M4 16.2C7.2 20.8 12.4 26 17.4 29.4C23 33.2 28.6 35.7 34 35.2C28.9 39.8 23.8 41 19 41C12.5 41 6.9 37.8 4 35.4Z"/></svg>',
69
72
  };
70
73
 
71
- /** Claude 的放射状标志:长短不一的圆头射线 */
72
- ICON.claude = (() => {
73
- const lens = [10, 8.2, 9.4, 7.6, 10.4, 8.4, 9.2, 7.8, 10, 8.6, 9.6, 7.4];
74
- const rays = lens
75
- .map((len, i) => {
76
- const a = (i / lens.length) * Math.PI * 2 + 0.12;
77
- const x = (r) => (12 + Math.cos(a) * r).toFixed(2);
78
- const y = (r) => (12 + Math.sin(a) * r).toFixed(2);
79
- return `M${x(1.6)} ${y(1.6)}L${x(len)} ${y(len)}`;
80
- })
81
- .join("");
82
- return `<svg viewBox="0 0 24 24" fill="none" stroke="#D97757" stroke-width="2.3" stroke-linecap="round"><path d="${rays}"/></svg>`;
83
- })();
84
- ICON.codex = ICON.logo;
74
+ /** Claude 的标志(橙色放射状),也是内置专家 Claude Code 的头像 */
75
+ ICON.claude = '<svg viewBox="0 0 640 640"><path fill="#D97757" fill-rule="evenodd" d="M173 2C168 3 167 4 158 17C146 32 146 32 151 52C155 66 155 66 164 81C188 118 252 233 250 235C248 238 246 237 241 233C238 230 221 218 203 204C185 191 156 169 138 156C94 122 96 123 92 122C90 122 84 121 77 120L66 120 58 129L49 139 51 152C52 159 53 165 53 165C53 168 65 179 74 186C80 190 92 199 101 205C110 211 129 225 144 235C185 262 247 304 252 307C254 310 255 311 254 312C253 315 246 315 212 311C196 309 170 307 153 306C114 304 35 298 24 297L14 296 8 301C2 305 1 305 1 310C0 314 0 314 7 323L14 333 21 334C31 337 103 341 170 342C230 344 251 345 252 347C253 347 253 349 253 351C252 355 251 355 190 390C136 420 124 427 102 442C68 465 69 464 68 477L67 486 74 493C79 498 81 499 83 498C84 498 91 497 98 496L110 495 194 440C240 410 279 386 280 385C281 385 281 386 281 387C281 389 277 394 269 404C262 411 248 429 238 442C227 456 204 486 186 509C143 564 143 563 143 574L142 583 152 588L161 593 167 590C172 588 174 586 196 563C220 536 230 524 295 435C308 416 315 408 316 408C318 408 318 408 316 417C315 421 312 436 310 450C306 475 295 533 284 584L279 608 283 618C287 628 287 628 296 634L304 640 313 636C321 633 323 632 327 628L331 623 340 526C348 445 349 429 351 428C353 427 353 426 369 454C395 498 454 586 459 588C461 588 465 589 469 590C476 591 476 591 484 588C492 586 492 585 494 581L496 576 495 562L493 547 456 492C436 461 419 435 419 434C419 433 420 432 421 432C423 432 460 463 486 486C501 499 553 538 557 539C563 541 564 540 569 534L573 528 571 520C570 514 569 512 566 509C556 500 502 450 478 429C447 401 420 374 420 372C420 370 424 371 443 375C453 378 493 388 533 397L606 414 622 406L638 398 639 392L640 385 634 377C628 369 626 367 617 361L606 354 574 351C553 350 528 349 502 348C464 347 425 344 423 342C422 341 419 342 472 329C496 323 531 316 549 312C568 308 594 302 606 299L629 294 633 283C638 273 638 272 637 267L636 262 625 257L613 251 591 255C548 262 523 267 486 275C439 285 443 284 441 283C440 281 441 278 450 263C463 241 486 209 540 142C547 133 547 132 551 118C553 110 555 103 555 102C555 101 551 94 545 86L536 72 521 72L507 72 499 79C480 94 436 145 396 199C381 219 375 226 371 226C370 226 369 225 369 225C369 223 376 184 386 133C390 114 395 83 398 66L403 35 396 26C390 18 389 17 383 13C379 12 375 10 375 10C374 10 369 13 364 16L354 23 349 35C343 49 344 45 339 105C337 125 335 152 333 167C331 181 329 202 329 212C326 245 326 244 324 244C322 244 321 241 317 229C313 216 311 211 286 162C261 113 248 87 226 35C212 4 212 4 181 1C179 0 175 1 173 2"/></svg>';
76
+ /** OpenAI 的标志,也是内置专家 Codex 的头像。跟着文字颜色(深色模式下是白的) */
77
+ ICON.codex = '<svg viewBox="0 0 640 640"><path fill="currentColor" fill-rule="evenodd" d="M253 1C193 8 141 51 122 109C120 115 118 121 117 123C117 127 117 127 108 130C31 154 -16 240 6 321C12 346 26 370 45 391L53 399 52 407C43 448 51 491 75 527C83 539 104 560 116 569C156 596 205 604 250 591L257 589 264 595C284 613 307 624 335 631C351 635 382 635 399 631C461 618 506 575 523 511C523 508 524 508 534 504C587 485 625 442 637 384C640 369 640 341 637 325C631 293 616 266 594 244L587 236 588 228C606 142 552 60 466 41C442 36 412 37 390 44L384 46 375 38C340 9 297 -4 253 1M259 39C258 39 253 39 249 40C206 46 169 78 156 119C150 137 150 139 150 224L150 302 153 305C156 308 206 338 207 338C208 338 208 296 208 245C208 181 208 150 209 148C211 140 215 138 280 100C314 80 343 64 343 63C345 61 322 48 308 44C293 39 272 37 259 39M405 78C385 82 385 82 309 126C271 148 249 161 248 163C246 166 245 168 245 198C245 220 245 230 246 230C247 230 283 209 326 184C412 134 410 135 416 135C422 135 421 135 489 174C524 195 552 211 553 211C554 209 554 196 553 186C547 133 512 92 462 79C448 76 418 75 405 78M103 173C62 194 36 238 38 284C40 316 53 346 75 368C86 379 88 380 145 413C171 428 199 444 206 448C217 454 221 456 224 456C227 456 281 427 281 425C281 425 245 403 201 378C157 353 120 331 119 329C112 323 113 327 112 244L112 169 103 173M385 194C370 202 358 209 358 209C358 210 394 231 438 256C482 281 519 303 521 305C522 306 525 309 526 311C528 316 528 316 528 390C528 444 528 465 529 465C531 465 547 456 554 451C612 407 618 321 566 267C554 256 553 255 497 222C416 176 420 178 416 178C413 178 406 181 385 194M282 252L246 273 246 317L246 362 282 382C303 394 320 403 320 403C321 403 388 365 393 362L395 361 395 317L394 273 358 252C337 240 320 231 320 231C320 231 303 240 282 252M432 389C432 453 432 484 431 486C429 494 425 497 360 535C325 554 297 571 297 571C295 572 307 580 317 585C336 593 353 597 374 596C432 593 475 558 489 502C491 490 492 336 489 331C488 328 483 325 460 312C445 303 433 296 432 296C432 296 432 338 432 389M376 414C367 419 331 440 297 460C230 498 228 500 222 499C217 498 220 500 150 459C117 440 89 424 88 424C87 424 86 440 87 450C91 492 115 527 153 545C183 561 223 563 254 551C264 547 388 476 391 472L394 469 394 436C394 419 394 404 394 404C394 404 386 408 376 414"/></svg>';
85
78
 
86
79
  /**
87
80
  * 星星加载动画(回复末尾、打开会话时用)。开屏那个带台面的完整 logo 动画直接写在 index.html 里。
@@ -54,7 +54,7 @@ export function closeMenu() {
54
54
  }
55
55
 
56
56
  /** beforeClose:点 × 或点外面关闭前先问它,返回(或 resolve 成)false 就不关。返回的 close 不问,直接关 */
57
- export function modal({ title, body, foot, wide, tall, beforeClose }) {
57
+ export function modal({ title, body, foot, wide, tall, className = "", beforeClose }) {
58
58
  const close = () => overlay.remove();
59
59
  const tryClose = async () => {
60
60
  if (!beforeClose || (await beforeClose()) !== false) close();
@@ -64,7 +64,7 @@ export function modal({ title, body, foot, wide, tall, beforeClose }) {
64
64
  { class: "overlay", onclick: (e) => e.target === overlay && void tryClose() },
65
65
  h(
66
66
  "div",
67
- { class: `modal${wide ? " wide" : ""}${tall ? " tall" : ""}` },
67
+ { class: `modal${wide ? " wide" : ""}${tall ? " tall" : ""}${className ? ` ${className}` : ""}` },
68
68
  h("div", { class: "modal-head" }, h("h3", {}, title), h("button", { class: "icon-btn", onclick: () => void tryClose() }, icon("x"))),
69
69
  body,
70
70
  foot ?? null,