openclaw-openagent 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.
Files changed (113) hide show
  1. package/index.ts +114 -0
  2. package/openclaw.plugin.json +159 -0
  3. package/package.json +79 -0
  4. package/skills/clawlink/SKILL.md +145 -0
  5. package/skills/clawlink/SKILL.md.bak +165 -0
  6. package/src/app/channel-tools.ts +249 -0
  7. package/src/app/discovery-tools.ts +273 -0
  8. package/src/app/hooks.ts +60 -0
  9. package/src/app/index.ts +78 -0
  10. package/src/app/messaging-tools.ts +79 -0
  11. package/src/app/ops-tools.ts +155 -0
  12. package/src/app/remote-agent-tool.ts +476 -0
  13. package/src/app/types.ts +67 -0
  14. package/src/app/verbose-preflight.ts +190 -0
  15. package/src/auth/config.ts +197 -0
  16. package/src/auth/credential-manager.ts +146 -0
  17. package/src/auth/index.ts +24 -0
  18. package/src/auth/verify.ts +99 -0
  19. package/src/channel.ts +565 -0
  20. package/src/compat.ts +82 -0
  21. package/src/config/config-schema.ts +39 -0
  22. package/src/messaging/aggregator.ts +120 -0
  23. package/src/messaging/collector.ts +89 -0
  24. package/src/messaging/executor.ts +72 -0
  25. package/src/messaging/inbound.ts +150 -0
  26. package/src/messaging/index.ts +11 -0
  27. package/src/messaging/mention-protocol.ts +94 -0
  28. package/src/messaging/process-c2c-request.ts +564 -0
  29. package/src/messaging/process-message.ts +373 -0
  30. package/src/messaging/scheduler.ts +55 -0
  31. package/src/messaging/types.ts +38 -0
  32. package/src/plugin-ui/assets/agentbook-icon.svg +5 -0
  33. package/src/plugin-ui/assets/magic.svg +5 -0
  34. package/src/plugin-ui/assets/openagent-override.js +9329 -0
  35. package/src/plugin-ui/build.cjs +175 -0
  36. package/src/plugin-ui/index.ts +18 -0
  37. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +458 -0
  38. package/src/plugin-ui/modules/agent-book/panel/agent-card.js +154 -0
  39. package/src/plugin-ui/modules/agent-book/panel/agent-data.js +644 -0
  40. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +456 -0
  41. package/src/plugin-ui/modules/agent-book/panel/mention-state.js +206 -0
  42. package/src/plugin-ui/modules/agent-book/panel/styles.js +670 -0
  43. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +293 -0
  44. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +208 -0
  45. package/src/plugin-ui/modules/agent-book/scanner.js +119 -0
  46. package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +500 -0
  47. package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +652 -0
  48. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +251 -0
  49. package/src/plugin-ui/modules/loader/bootstrap.js +38 -0
  50. package/src/plugin-ui/modules/loader/shared-state.js +560 -0
  51. package/src/plugin-ui/modules/loader/ws-intercept.js +199 -0
  52. package/src/plugin-ui/modules/remote-agent/chunk-parser.js +161 -0
  53. package/src/plugin-ui/modules/remote-agent/execution-card.js +269 -0
  54. package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +256 -0
  55. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +146 -0
  56. package/src/plugin-ui/modules/remote-agent/output-card.js +259 -0
  57. package/src/plugin-ui/modules/remote-agent/progress-store.js +363 -0
  58. package/src/plugin-ui/modules/remote-agent/render-hooks.js +1609 -0
  59. package/src/plugin-ui/modules/remote-agent/styles.js +668 -0
  60. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +56 -0
  61. package/src/plugin-ui/ui-extension-loader/backup.ts +92 -0
  62. package/src/plugin-ui/ui-extension-loader/index.ts +276 -0
  63. package/src/plugin-ui/ui-extension-loader/locator.ts +152 -0
  64. package/src/plugin-ui/ui-extension-loader/manifest.ts +57 -0
  65. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +729 -0
  66. package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +70 -0
  67. package/src/plugin-ui/ui-extension-loader/types.ts +68 -0
  68. package/src/proxy/auth-proxy.ts +356 -0
  69. package/src/runtime/account.ts +572 -0
  70. package/src/runtime/index.ts +7 -0
  71. package/src/runtime/plugin-runtime.ts +94 -0
  72. package/src/runtime/registry.ts +71 -0
  73. package/src/sdk/CLASS_MAP.md +143 -0
  74. package/src/sdk/index.d.ts +126 -0
  75. package/src/sdk/index.js +23990 -0
  76. package/src/sdk/modules/cloud-search-module.js +1117 -0
  77. package/src/sdk/modules/follow-module.js +1069 -0
  78. package/src/sdk/modules/group-module.js +7397 -0
  79. package/src/sdk/modules/relationship-module.js +2269 -0
  80. package/src/sdk/modules/signaling-module.js +1468 -0
  81. package/src/sdk/modules/tim-upload-plugin.js +730 -0
  82. package/src/sdk/node-env/http-request.js +90 -0
  83. package/src/sdk/node-env/index.js +57 -0
  84. package/src/sdk/node-env/storage.js +114 -0
  85. package/src/sdk/package.json +10 -0
  86. package/src/sdk/tsconfig.json +16 -0
  87. package/src/state/pending-invocation-store.ts +43 -0
  88. package/src/state/store.ts +676 -0
  89. package/src/tim/c2c.ts +451 -0
  90. package/src/tim/channels.ts +364 -0
  91. package/src/tim/client.ts +330 -0
  92. package/src/tim/index.ts +18 -0
  93. package/src/tim/messages.ts +166 -0
  94. package/src/tim/sdk-logger-init.ts +50 -0
  95. package/src/tools.ts +10 -0
  96. package/src/transport/factory.ts +95 -0
  97. package/src/transport/oasn/index.ts +17 -0
  98. package/src/transport/oasn/oasn-agent-card.ts +111 -0
  99. package/src/transport/oasn/oasn-discovery.ts +108 -0
  100. package/src/transport/oasn/oasn-files.ts +210 -0
  101. package/src/transport/oasn/oasn-http.ts +483 -0
  102. package/src/transport/oasn/oasn-invocation.ts +527 -0
  103. package/src/transport/oasn/oasn-normalize.ts +159 -0
  104. package/src/transport/oasn/oasn-register.ts +106 -0
  105. package/src/transport/oasn/oasn-transport.ts +341 -0
  106. package/src/transport/oasn/oasn-types.ts +353 -0
  107. package/src/transport/tim/index.ts +8 -0
  108. package/src/transport/tim/tim-transport.ts +515 -0
  109. package/src/transport/types.ts +541 -0
  110. package/src/types/openclaw.d.ts +97 -0
  111. package/src/types/tencentcloud-chat.d.ts +15 -0
  112. package/src/util/http.ts +113 -0
  113. package/src/util/logger.ts +131 -0
@@ -0,0 +1,670 @@
1
+ // ── 样式注入 ──
2
+
3
+ function injectStyles() {
4
+ if (document.getElementById('openagent-override-styles')) return;
5
+
6
+ const style = document.createElement('style');
7
+ style.id = 'openagent-override-styles';
8
+ style.textContent = `
9
+ /* ── 流式回复边框闪烁:覆盖为蓝色 ── */
10
+ @keyframes chatStreamPulse {
11
+ 0%, 100% { border-color: var(--border); }
12
+ 50% { border-color: #3b82f6; }
13
+ }
14
+ .chat-bubble.streaming.cl-remote-agent-bubble {
15
+ animation: 1.5s ease-in-out infinite chatStreamPulse !important;
16
+ border-color: #3b82f6;
17
+ }
18
+
19
+ /* ── @ Agent Book 按钮(Figma 1:1117 物理级复刻 — Mesh Gradient) ── */
20
+ .openagent-at-btn {
21
+ position: relative;
22
+ overflow: hidden; /* Figma clipsContent: true */
23
+ display: inline-flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ gap: 4px;
27
+ height: 26px;
28
+ padding: 0 16px;
29
+ border-radius: 100px;
30
+ border: none;
31
+ background: #6ECCFF; /* Figma Frame 72552 底色 */
32
+ box-shadow: inset 0 0 8.5px 0 #96ECFF; /* Figma INNER_SHADOW */
33
+ color: #fff;
34
+ font-size: 13px;
35
+ font-weight: 600;
36
+ cursor: pointer;
37
+ transition: all 0.2s ease;
38
+ line-height: 26px;
39
+ margin-left: 6px;
40
+ white-space: nowrap;
41
+ flex-shrink: 0;
42
+ letter-spacing: 0.2px;
43
+ /* 建立层叠上下文,让伪元素在底层 */
44
+ z-index: 1;
45
+ isolation: isolate;
46
+ }
47
+
48
+ /* Figma 外层 Ellipse 12873:蓝色椭圆,偏左 */
49
+ .openagent-at-btn::before {
50
+ content: '';
51
+ position: absolute;
52
+ left: -13%;
53
+ top: -98%;
54
+ width: 50%;
55
+ height: 304%;
56
+ background: #7A94FF;
57
+ filter: blur(23px); /* Figma LAYER_BLUR: 23.2px */
58
+ transform: rotate(174deg);
59
+ z-index: -1;
60
+ pointer-events: none;
61
+ }
62
+
63
+ /* Figma 外层 Ellipse 12872:黄绿色椭圆,偏右 */
64
+ .openagent-at-btn::after {
65
+ content: '';
66
+ position: absolute;
67
+ left: 70%;
68
+ top: -49%;
69
+ width: 54%;
70
+ height: 145%;
71
+ background: #A1FF2E;
72
+ filter: blur(30.5px); /* Figma LAYER_BLUR: 30.5px */
73
+ transform: rotate(27deg);
74
+ z-index: -1;
75
+ pointer-events: none;
76
+ }
77
+
78
+ /* 确保文字始终在最高层 */
79
+ .openagent-at-btn .at-sym,
80
+ .openagent-at-btn span {
81
+ position: relative;
82
+ z-index: 2;
83
+ }
84
+
85
+ .openagent-at-btn:hover {
86
+ filter: brightness(1.08);
87
+ transform: translateY(-1px);
88
+ box-shadow: inset 0 0 8.5px 0 #96ECFF, 0 2px 8px rgba(110, 204, 255, 0.4);
89
+ }
90
+ .openagent-at-btn .at-sym {
91
+ font-size: 14px;
92
+ font-weight: 700;
93
+ color: #fff;
94
+ }
95
+
96
+ /* ── 输入区域包裹层(让面板可以相对定位) ── */
97
+ .openagent-input-wrapper {
98
+ position: relative;
99
+ z-index: 100000;
100
+ }
101
+
102
+ /* ── Agent 面板(Figma 341-2083) ── */
103
+ .openagent-panel-backdrop {
104
+ display: none;
105
+ position: fixed;
106
+ inset: 0;
107
+ z-index: 99998;
108
+ }
109
+ .openagent-panel-backdrop.visible { display: block; }
110
+
111
+ .openagent-agent-panel {
112
+ position: fixed;
113
+ max-height: none;
114
+ background: #fff;
115
+ border: 1.2px solid rgba(47, 47, 51, 0.12);
116
+ border-radius: 18px;
117
+ box-shadow: 0 -4px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
118
+ z-index: 99999;
119
+ overflow: hidden;
120
+ display: none;
121
+ flex-direction: column;
122
+ gap: 14px;
123
+ padding: 14px;
124
+ font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
125
+ box-sizing: border-box;
126
+ }
127
+ .openagent-agent-panel.visible {
128
+ display: flex;
129
+ animation: openagent-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
130
+ }
131
+ @keyframes openagent-up {
132
+ from { opacity: 0; transform: translateY(8px); }
133
+ to { opacity: 1; transform: translateY(0); }
134
+ }
135
+
136
+ /* ── 面板头部 ── */
137
+ .openagent-panel-head {
138
+ display: flex;
139
+ justify-content: space-between;
140
+ align-items: center;
141
+ min-height: 26px;
142
+ padding: 6px 10px 0 10px;
143
+ border-bottom: none;
144
+ }
145
+ .openagent-panel-title {
146
+ display: flex;
147
+ align-items: center;
148
+ gap: 6px;
149
+ font-size: 16px;
150
+ font-weight: 500;
151
+ color: rgba(47, 47, 51, 0.8);
152
+ text-transform: uppercase;
153
+ letter-spacing: 0.3px;
154
+ }
155
+ .openagent-panel-title-icon {
156
+ width: 21px;
157
+ height: 21px;
158
+ flex-shrink: 0;
159
+ }
160
+ .openagent-panel-close {
161
+ background: rgba(249, 249, 249, 1);
162
+ border: none;
163
+ color: rgba(47, 47, 51, 0.6);
164
+ cursor: pointer;
165
+ width: 21px;
166
+ height: 21px;
167
+ display: inline-flex;
168
+ align-items: center;
169
+ justify-content: center;
170
+ font-size: 12px;
171
+ font-weight: 400;
172
+ padding: 0;
173
+ border-radius: 4px;
174
+ transition: all 0.1s;
175
+ line-height: 1;
176
+ }
177
+ .openagent-panel-close:hover {
178
+ background: #eee;
179
+ color: rgba(47, 47, 51, 1);
180
+ }
181
+
182
+ /* ── 分隔线(Figma: 0.2px, opacity 0.16) ── */
183
+ .openagent-panel-divider {
184
+ height: 0;
185
+ border: none;
186
+ border-top: 0.2px solid rgba(47, 47, 51, 0.16);
187
+ margin: 0;
188
+ }
189
+
190
+ /* ── Agent 列表(section stack) ── */
191
+ .openagent-agent-list {
192
+ overflow-y: auto;
193
+ padding: 8px 0;
194
+ flex: 1;
195
+ display: flex;
196
+ flex-direction: column;
197
+ gap: 14px;
198
+ min-height: 0;
199
+ max-height: min(56vh, 451px);
200
+ scrollbar-width: thin;
201
+ scrollbar-color: #ddd transparent;
202
+ }
203
+ .openagent-agent-list::-webkit-scrollbar {
204
+ width: 4px;
205
+ }
206
+ .openagent-agent-list::-webkit-scrollbar-track {
207
+ background: transparent;
208
+ }
209
+ .openagent-agent-list::-webkit-scrollbar-thumb {
210
+ background: #ddd;
211
+ border-radius: 2px;
212
+ }
213
+ .openagent-agent-list::-webkit-scrollbar-thumb:hover {
214
+ background: #bbb;
215
+ }
216
+
217
+ .openagent-agent-section {
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: 8px;
221
+ width: 100%;
222
+ min-width: 0;
223
+ }
224
+
225
+ /* ── 父分类标题(两级结构:Research > Market Research) ── */
226
+ .openagent-parent-section {
227
+ display: flex;
228
+ flex-direction: column;
229
+ gap: 10px;
230
+ width: 100%;
231
+ min-width: 0;
232
+ }
233
+ .openagent-parent-heading {
234
+ font-size: 11px;
235
+ font-weight: 600;
236
+ line-height: 13px;
237
+ color: rgba(47, 47, 51, 0.45);
238
+ padding: 0 12px;
239
+ text-transform: uppercase;
240
+ letter-spacing: 0.8px;
241
+ }
242
+
243
+ /* ── 分组标题 ── */
244
+ .openagent-section-heading {
245
+ font-size: 14px;
246
+ font-weight: 400;
247
+ line-height: 14px;
248
+ color: rgba(47, 47, 51, 0.80);
249
+ padding: 0 12px 0 12px;
250
+ letter-spacing: 0;
251
+ }
252
+
253
+ /* ── 分组网格容器 ── */
254
+ .openagent-section-grid {
255
+ display: grid;
256
+ grid-template-columns: repeat(3, minmax(0, 439.5px));
257
+ justify-content: start;
258
+ gap: 8px 14px;
259
+ padding: 0 12px;
260
+ width: 100%;
261
+ box-sizing: border-box;
262
+ }
263
+
264
+ /* ── 有搜索词时:保留旧搜索结果列表形态,不走默认分类网格 ── */
265
+ .openagent-search-results {
266
+ display: flex;
267
+ flex-direction: column;
268
+ gap: 8px;
269
+ padding: 0 12px;
270
+ width: 100%;
271
+ box-sizing: border-box;
272
+ }
273
+
274
+ /* ── 统一 Agent 卡片组件 ── */
275
+ .agent-card {
276
+ display: flex;
277
+ align-items: flex-start;
278
+ transition: background 0.15s;
279
+ }
280
+
281
+ /* 头像(共享) */
282
+ .agent-card__avatar {
283
+ flex-shrink: 0;
284
+ object-fit: cover;
285
+ background: #e8e8e8;
286
+ }
287
+
288
+ /* 内容区(共享) */
289
+ .agent-card__body { flex: 1; min-width: 0; }
290
+ .agent-card__name-line { display: flex; align-items: baseline; gap: 8px; }
291
+ .agent-card__name {
292
+ font-family: "PingFang SC", sans-serif;
293
+ font-weight: 600;
294
+ color: rgba(47, 47, 51, 1);
295
+ }
296
+ .agent-card__tag { font-size: 12px; color: #6366f1; font-weight: 500; }
297
+ .agent-card__specialty { font-size: 12px; color: #999; font-weight: 400; }
298
+ .agent-card__bio {
299
+ font-family: "PingFang SC", sans-serif;
300
+ font-size: 11px;
301
+ font-weight: 400;
302
+ color: rgba(47, 47, 51, 1);
303
+ line-height: 14.52px;
304
+ overflow: hidden;
305
+ text-overflow: ellipsis;
306
+ display: -webkit-box;
307
+ -webkit-line-clamp: 2;
308
+ -webkit-box-orient: vertical;
309
+ }
310
+
311
+ /* 统计行(共享) */
312
+ .agent-card__stats {
313
+ display: flex;
314
+ align-items: center;
315
+ gap: 0;
316
+ flex-wrap: wrap;
317
+ }
318
+ .agent-card__stat {
319
+ font-family: "PingFang SC", sans-serif;
320
+ font-size: 13.5px;
321
+ font-weight: 400;
322
+ white-space: nowrap;
323
+ letter-spacing: 1px;
324
+ }
325
+ .agent-card__stat--claws {
326
+ color: rgba(240, 152, 0, 1);
327
+ }
328
+ .agent-card__stat--owner {
329
+ color: rgba(47, 47, 51, 1);
330
+ line-height: 13.5px;
331
+ }
332
+
333
+ /* 按钮(共享) */
334
+ .agent-card__action {
335
+ flex-shrink: 0;
336
+ border: none;
337
+ cursor: pointer;
338
+ font-weight: 500;
339
+ transition: all 0.12s;
340
+ white-space: nowrap;
341
+ }
342
+
343
+ /* ── mode: mention(Figma Agent item → avart 实例) ── */
344
+ .agent-card--mention {
345
+ flex-direction: row;
346
+ align-items: stretch;
347
+ gap: 0;
348
+ padding: 0;
349
+ border-radius: 8px;
350
+ border: none;
351
+ background: transparent;
352
+ min-height: 88px;
353
+ min-width: 0;
354
+ }
355
+ .agent-card--mention:hover {
356
+ background: rgba(0, 0, 0, 0.02);
357
+ }
358
+ /* 键盘导航高亮(§1.5)— 对标 TIM index.vue:32 'selected' class */
359
+ .agent-card--mention.openagent-card-selected {
360
+ background: rgba(99, 102, 241, 0.06);
361
+ outline: 2px solid rgba(99, 102, 241, 0.3);
362
+ outline-offset: -2px;
363
+ }
364
+ [data-theme-mode="dark"] .agent-card--mention.openagent-card-selected {
365
+ background: rgba(99, 102, 241, 0.12);
366
+ outline-color: rgba(99, 102, 241, 0.4);
367
+ }
368
+
369
+ /* avart 外壳: Figma px 12, centered */
370
+ .agent-card--mention .agent-card__avart {
371
+ display: flex;
372
+ flex-direction: column;
373
+ justify-content: center;
374
+ gap: 0;
375
+ padding: 0 10px;
376
+ flex: 1;
377
+ min-width: 0;
378
+ box-sizing: border-box;
379
+ }
380
+
381
+ /* 第一行: row, gap:24 (内容组 + @Try) */
382
+ .agent-card--mention .agent-card__row1 {
383
+ display: flex;
384
+ flex-direction: row;
385
+ align-items: center;
386
+ gap: 16px;
387
+ width: 100%;
388
+ min-width: 0;
389
+ }
390
+
391
+ /* 内容组: row, gap:18 (头像 + 信息列) */
392
+ .agent-card--mention .agent-card__content-group {
393
+ display: flex;
394
+ flex-direction: row;
395
+ align-items: flex-start;
396
+ gap: 12px;
397
+ flex: 1;
398
+ min-width: 0;
399
+ }
400
+
401
+ /* 头像 */
402
+ .agent-card--mention .agent-card__avatar {
403
+ width: 48px;
404
+ height: 48px;
405
+ border-radius: 50%;
406
+ border: none;
407
+ flex-shrink: 0;
408
+ margin-top: 0;
409
+ }
410
+
411
+ /* 信息列: name / bio / stats */
412
+ .agent-card--mention .agent-card__info {
413
+ display: flex;
414
+ flex-direction: column;
415
+ gap: 4px;
416
+ padding: 3px 0;
417
+ flex: 1;
418
+ min-width: 0;
419
+ }
420
+
421
+ .agent-card--mention .agent-card__name {
422
+ font-size: 12px;
423
+ font-weight: 600;
424
+ line-height: 14px;
425
+ color: rgba(47, 47, 51, 1);
426
+ }
427
+ .agent-card--mention .agent-card__bio {
428
+ font-size: 10px;
429
+ font-weight: 400;
430
+ line-height: 14px;
431
+ color: rgba(47, 47, 51, 0.40);
432
+ text-align: justify;
433
+ overflow: hidden;
434
+ text-overflow: ellipsis;
435
+ display: -webkit-box;
436
+ -webkit-line-clamp: 2;
437
+ -webkit-box-orient: vertical;
438
+ margin-top: 0;
439
+ }
440
+
441
+ /* @Try 按钮 */
442
+ .agent-card--mention .agent-card__action {
443
+ width: 64px;
444
+ height: 30px;
445
+ padding: 0 14px;
446
+ border-radius: 10px;
447
+ background: #EFF0F2;
448
+ border: 1.286px solid rgba(47, 47, 51, 0.04);
449
+ color: rgba(47, 47, 51, 1);
450
+ font-family: "PingFang SC", sans-serif;
451
+ font-size: 12px;
452
+ font-weight: 500;
453
+ line-height: 12px;
454
+ text-transform: capitalize;
455
+ flex-shrink: 0;
456
+ display: inline-flex;
457
+ align-items: center;
458
+ justify-content: center;
459
+ }
460
+ .agent-card--mention .agent-card__action::before { content: '@'; font-weight: 600; }
461
+ .agent-card--mention .agent-card__action:hover {
462
+ background: #e2e3e5;
463
+ }
464
+
465
+ /* Legacy row2 kept for older generated DOM, but current mention card keeps stats in info. */
466
+ .agent-card--mention .agent-card__row2 {
467
+ display: none;
468
+ flex-direction: row;
469
+ align-items: center;
470
+ padding-left: 60px;
471
+ }
472
+ .agent-card--mention .agent-card__stats {
473
+ display: flex;
474
+ align-items: center;
475
+ gap: 0;
476
+ margin-top: 0;
477
+ }
478
+ .agent-card--mention .agent-card__stat--claws {
479
+ color: rgba(240, 152, 0, 1);
480
+ font-size: 10px;
481
+ line-height: 12px;
482
+ letter-spacing: 1px;
483
+ }
484
+ .agent-card--mention .agent-card__stat--owner {
485
+ color: rgba(47, 47, 51, 1);
486
+ font-size: 10px;
487
+ line-height: 12px;
488
+ letter-spacing: 1px;
489
+ }
490
+
491
+ /* ── mode: search(有输入搜索结果,沿用旧式单列行) ── */
492
+ .agent-card--search {
493
+ align-items: center;
494
+ gap: 14px;
495
+ width: 100%;
496
+ min-height: 64px;
497
+ padding: 10px 12px;
498
+ border-radius: 10px;
499
+ background: transparent;
500
+ box-sizing: border-box;
501
+ }
502
+ .agent-card--search:hover {
503
+ background: rgba(0, 0, 0, 0.02);
504
+ }
505
+ .agent-card--search.openagent-card-selected {
506
+ background: rgba(99, 102, 241, 0.06);
507
+ outline: 2px solid rgba(99, 102, 241, 0.3);
508
+ outline-offset: -2px;
509
+ }
510
+ .agent-card--search .agent-card__avatar {
511
+ width: 40px;
512
+ height: 40px;
513
+ border-radius: 50%;
514
+ border: 0.4px solid rgba(47, 47, 51, 0.18);
515
+ }
516
+ .agent-card--search .agent-card__body {
517
+ display: flex;
518
+ flex-direction: column;
519
+ gap: 3px;
520
+ min-width: 0;
521
+ }
522
+ .agent-card--search .agent-card__name {
523
+ font-size: 13px;
524
+ line-height: 16px;
525
+ font-weight: 600;
526
+ color: rgba(47, 47, 51, 1);
527
+ }
528
+ .agent-card--search .agent-card__bio {
529
+ font-size: 11px;
530
+ line-height: 15px;
531
+ color: rgba(47, 47, 51, 0.45);
532
+ -webkit-line-clamp: 1;
533
+ }
534
+ .agent-card--search .agent-card__stats {
535
+ margin-top: 0;
536
+ }
537
+ .agent-card--search .agent-card__stat--claws {
538
+ font-size: 11px;
539
+ line-height: 13px;
540
+ color: rgba(240, 152, 0, 1);
541
+ }
542
+ .agent-card--search .agent-card__stat--owner {
543
+ font-size: 11px;
544
+ line-height: 13px;
545
+ color: rgba(47, 47, 51, 0.65);
546
+ }
547
+ .agent-card--search .agent-card__action {
548
+ width: 60px;
549
+ height: 28px;
550
+ padding: 0 12px;
551
+ border-radius: 10px;
552
+ background: #EFF0F2;
553
+ border: 1px solid rgba(47, 47, 51, 0.04);
554
+ color: rgba(47, 47, 51, 1);
555
+ font-family: "PingFang SC", sans-serif;
556
+ font-size: 12px;
557
+ line-height: 12px;
558
+ display: inline-flex;
559
+ align-items: center;
560
+ justify-content: center;
561
+ }
562
+ .agent-card--search .agent-card__action::before { content: '@'; font-weight: 600; }
563
+ .agent-card--search .agent-card__action:hover {
564
+ background: #e2e3e5;
565
+ }
566
+
567
+ @media (max-width: 980px) {
568
+ .openagent-section-grid { grid-template-columns: repeat(2, minmax(0, 439.5px)); }
569
+ }
570
+
571
+ @media (max-width: 640px) {
572
+ .openagent-section-grid { grid-template-columns: 1fr; }
573
+ .openagent-agent-panel { padding: 14px; gap: 14px; }
574
+ .agent-card--mention .agent-card__row1 { gap: 12px; }
575
+ .agent-card--mention .agent-card__content-group { gap: 12px; }
576
+ }
577
+
578
+ /* ── mode: inline(聊天内嵌卡片) ── */
579
+ .agent-card--inline {
580
+ padding: 16px 20px; border-radius: 16px;
581
+ background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
582
+ border: 1px solid #e0e7ff;
583
+ margin: 8px 0; cursor: pointer; max-width: 420px;
584
+ }
585
+ .agent-card--inline:hover {
586
+ border-color: #6366f1;
587
+ box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
588
+ transform: translateY(-1px);
589
+ }
590
+ .agent-card--inline .agent-card__avatar {
591
+ width: 56px; height: 56px; border-radius: 14px;
592
+ border: 2px solid #e0e7ff;
593
+ }
594
+ .agent-card--inline .agent-card__name { font-size: 16px; color: #1e1b4b; }
595
+ .agent-card--inline .agent-card__bio { color: #64748b; line-height: 1.4; }
596
+ .agent-card--inline .agent-card__stats { gap: 12px; margin-top: 8px; }
597
+ .agent-card--inline .agent-card__stat { color: #94a3b8; font-weight: 500; }
598
+ .agent-card--inline .agent-card__action {
599
+ padding: 8px 16px; border-radius: 10px;
600
+ background: linear-gradient(135deg, #6366f1, #8b5cf6);
601
+ color: #fff; font-size: 12px;
602
+ }
603
+ .agent-card--inline .agent-card__action:hover {
604
+ filter: brightness(1.1); transform: scale(1.03);
605
+ }
606
+
607
+ /* Agent card loading skeleton */
608
+ .agent-card__loading {
609
+ display: flex; align-items: center; gap: 10px;
610
+ padding: 14px 18px; border-radius: 14px;
611
+ background: #f8f9ff; border: 1px solid #e0e7ff;
612
+ color: #94a3b8; font-size: 13px;
613
+ margin: 8px 0; max-width: 300px;
614
+ }
615
+
616
+ /* 加载态 */
617
+ .openagent-loading {
618
+ padding: 32px; text-align: center; color: #aaa; font-size: 13px;
619
+ }
620
+
621
+ /* ── 深色主题(统一) ── */
622
+ [data-theme-mode="dark"] .openagent-agent-panel {
623
+ background: #1c1c1c; border-color: rgba(255,255,255,0.12);
624
+ box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
625
+ }
626
+ [data-theme-mode="dark"] .openagent-panel-head { border-color: #2a2a2a; }
627
+ [data-theme-mode="dark"] .openagent-panel-title { color: rgba(224, 224, 224, 0.8); }
628
+ [data-theme-mode="dark"] .openagent-panel-close { background: #2a2a2a; color: #888; }
629
+ [data-theme-mode="dark"] .openagent-panel-close:hover { background: #333; color: #ccc; }
630
+ [data-theme-mode="dark"] .openagent-section-heading { color: rgba(224, 224, 224, 0.45); }
631
+ [data-theme-mode="dark"] .openagent-parent-heading { color: rgba(224, 224, 224, 0.3); }
632
+ [data-theme-mode="dark"] .openagent-panel-divider { border-color: rgba(255,255,255,0.1); }
633
+
634
+ [data-theme-mode="dark"] .agent-card__name { color: #e0e0e0; }
635
+ [data-theme-mode="dark"] .agent-card__bio { color: rgba(224, 224, 224, 0.7); }
636
+ [data-theme-mode="dark"] .agent-card__stat { color: #64748b; }
637
+
638
+ [data-theme-mode="dark"] .agent-card--mention { background: transparent; }
639
+ [data-theme-mode="dark"] .agent-card--mention:hover { background: #252525; }
640
+ [data-theme-mode="dark"] .agent-card--mention .agent-card__action {
641
+ background: #333; border-color: #555; color: #ddd;
642
+ }
643
+ [data-theme-mode="dark"] .agent-card--mention .agent-card__action:hover { background: #444; }
644
+ [data-theme-mode="dark"] .agent-card--search:hover { background: #252525; }
645
+ [data-theme-mode="dark"] .agent-card--search.openagent-card-selected {
646
+ background: rgba(99, 102, 241, 0.12);
647
+ outline-color: rgba(99, 102, 241, 0.4);
648
+ }
649
+ [data-theme-mode="dark"] .agent-card--search .agent-card__action {
650
+ background: #333; border-color: #555; color: #ddd;
651
+ }
652
+ [data-theme-mode="dark"] .agent-card--search .agent-card__action:hover { background: #444; }
653
+
654
+
655
+ [data-theme-mode="dark"] .agent-card--inline {
656
+ background: linear-gradient(135deg, #1e1b3a 0%, #1a1a2e 100%);
657
+ border-color: #2d2b55;
658
+ }
659
+ [data-theme-mode="dark"] .agent-card--inline:hover {
660
+ border-color: #6366f1;
661
+ box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
662
+ }
663
+ [data-theme-mode="dark"] .agent-card--inline .agent-card__name { color: #e2e8f0; }
664
+ [data-theme-mode="dark"] .agent-card--inline .agent-card__avatar { border-color: #2d2b55; }
665
+ [data-theme-mode="dark"] .agent-card__loading {
666
+ background: #1e1b3a; border-color: #2d2b55; color: #64748b;
667
+ }
668
+ `;
669
+ document.head.appendChild(style);
670
+ }