openclaw-openagent 1.0.12 → 1.0.14

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 (132) hide show
  1. package/dist/index.js +2 -0
  2. package/dist/src/config/config-schema.d.ts +9 -0
  3. package/dist/src/config/config-schema.js +6 -0
  4. package/dist/src/messaging/executor.d.ts +2 -3
  5. package/dist/src/messaging/executor.js +4 -31
  6. package/dist/src/plugin-ui/assets/openagent-override.js +124 -18
  7. package/dist/src/proxy/auth-proxy.js +5 -0
  8. package/dist/src/runtime/update-checker.d.ts +18 -0
  9. package/dist/src/runtime/update-checker.js +216 -0
  10. package/index.ts +3 -0
  11. package/package.json +1 -3
  12. package/src/app/channel-tools.ts +0 -249
  13. package/src/app/discovery-tools.ts +0 -273
  14. package/src/app/download-file-tool.ts +0 -133
  15. package/src/app/hooks.ts +0 -144
  16. package/src/app/index.ts +0 -84
  17. package/src/app/messaging-tools.ts +0 -79
  18. package/src/app/ops-tools.ts +0 -155
  19. package/src/app/remote-agent-tool.ts +0 -762
  20. package/src/app/types.ts +0 -68
  21. package/src/app/upload-file-tool.ts +0 -411
  22. package/src/app/verbose-preflight.ts +0 -190
  23. package/src/auth/config.ts +0 -266
  24. package/src/auth/credential-manager.ts +0 -146
  25. package/src/auth/index.ts +0 -24
  26. package/src/auth/verify.ts +0 -99
  27. package/src/channel.ts +0 -566
  28. package/src/compat.ts +0 -94
  29. package/src/config/config-schema.ts +0 -39
  30. package/src/messaging/aggregator.ts +0 -120
  31. package/src/messaging/collector.ts +0 -89
  32. package/src/messaging/executor.ts +0 -72
  33. package/src/messaging/inbound.ts +0 -150
  34. package/src/messaging/index.ts +0 -11
  35. package/src/messaging/mention-protocol.ts +0 -94
  36. package/src/messaging/process-c2c-request.ts +0 -564
  37. package/src/messaging/process-message.ts +0 -373
  38. package/src/messaging/scheduler.ts +0 -55
  39. package/src/messaging/types.ts +0 -38
  40. package/src/plugin-ui/adapters/oc-2026-04.js +0 -103
  41. package/src/plugin-ui/adapters/oc-2026-05.js +0 -125
  42. package/src/plugin-ui/adapters/oc-2026-06.js +0 -125
  43. package/src/plugin-ui/adapters/oc-unknown.js +0 -48
  44. package/src/plugin-ui/assets/agentbook-icon.svg +0 -5
  45. package/src/plugin-ui/assets/bg.png +0 -0
  46. package/src/plugin-ui/assets/icon.png +0 -0
  47. package/src/plugin-ui/assets/magic.svg +0 -5
  48. package/src/plugin-ui/assets/openagent-override.js +0 -11156
  49. package/src/plugin-ui/build.cjs +0 -463
  50. package/src/plugin-ui/index.ts +0 -18
  51. package/src/plugin-ui/modules/agent-book/panel/agent-book.js +0 -570
  52. package/src/plugin-ui/modules/agent-book/panel/agent-card.js +0 -170
  53. package/src/plugin-ui/modules/agent-book/panel/agent-data.js +0 -643
  54. package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +0 -665
  55. package/src/plugin-ui/modules/agent-book/panel/mention-state.js +0 -206
  56. package/src/plugin-ui/modules/agent-book/panel/styles.js +0 -833
  57. package/src/plugin-ui/modules/agent-book/panel/theme-adapter.js +0 -86
  58. package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +0 -295
  59. package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +0 -211
  60. package/src/plugin-ui/modules/agent-book/scanner.js +0 -131
  61. package/src/plugin-ui/modules/agent-book/travelcard/travel-cards.js +0 -500
  62. package/src/plugin-ui/modules/agent-book/travelcard/travel-engine.js +0 -652
  63. package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +0 -256
  64. package/src/plugin-ui/modules/loader/bootstrap.js +0 -38
  65. package/src/plugin-ui/modules/loader/shared-state.js +0 -838
  66. package/src/plugin-ui/modules/loader/ws-intercept.js +0 -199
  67. package/src/plugin-ui/modules/remote-agent/chunk-parser.js +0 -161
  68. package/src/plugin-ui/modules/remote-agent/execution-card.js +0 -530
  69. package/src/plugin-ui/modules/remote-agent/markdown-renderer.js +0 -256
  70. package/src/plugin-ui/modules/remote-agent/media-links.js +0 -151
  71. package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +0 -134
  72. package/src/plugin-ui/modules/remote-agent/output-card.js +0 -342
  73. package/src/plugin-ui/modules/remote-agent/progress-store.js +0 -363
  74. package/src/plugin-ui/modules/remote-agent/render-hooks.js +0 -1700
  75. package/src/plugin-ui/modules/remote-agent/styles.js +0 -896
  76. package/src/plugin-ui/modules/remote-agent/tool-card-model.js +0 -130
  77. package/src/plugin-ui/postinstall-deploy.cjs +0 -52
  78. package/src/plugin-ui/ui-extension-loader/backup.ts +0 -92
  79. package/src/plugin-ui/ui-extension-loader/index.ts +0 -276
  80. package/src/plugin-ui/ui-extension-loader/locator.ts +0 -152
  81. package/src/plugin-ui/ui-extension-loader/manifest.ts +0 -57
  82. package/src/plugin-ui/ui-extension-loader/registry-regex.ts +0 -944
  83. package/src/plugin-ui/ui-extension-loader/removed-extensions.ts +0 -70
  84. package/src/plugin-ui/ui-extension-loader/types.ts +0 -72
  85. package/src/proxy/auth-proxy.ts +0 -409
  86. package/src/runtime/account.ts +0 -549
  87. package/src/runtime/index.ts +0 -7
  88. package/src/runtime/plugin-runtime.ts +0 -94
  89. package/src/runtime/registry.ts +0 -71
  90. package/src/sdk/CLASS_MAP.md +0 -143
  91. package/src/sdk/index.d.ts +0 -126
  92. package/src/sdk/index.js +0 -23990
  93. package/src/sdk/modules/cloud-search-module.js +0 -1117
  94. package/src/sdk/modules/follow-module.js +0 -1069
  95. package/src/sdk/modules/group-module.js +0 -7397
  96. package/src/sdk/modules/relationship-module.js +0 -2269
  97. package/src/sdk/modules/signaling-module.js +0 -1468
  98. package/src/sdk/modules/tim-upload-plugin.js +0 -730
  99. package/src/sdk/node-env/http-request.js +0 -90
  100. package/src/sdk/node-env/index.js +0 -57
  101. package/src/sdk/node-env/storage.js +0 -114
  102. package/src/sdk/package.json +0 -10
  103. package/src/sdk/tsconfig.json +0 -16
  104. package/src/state/pending-invocation-store.ts +0 -43
  105. package/src/state/store.ts +0 -756
  106. package/src/tim/c2c.ts +0 -451
  107. package/src/tim/channels.ts +0 -364
  108. package/src/tim/client.ts +0 -330
  109. package/src/tim/index.ts +0 -18
  110. package/src/tim/messages.ts +0 -166
  111. package/src/tim/sdk-logger-init.ts +0 -50
  112. package/src/tools.ts +0 -10
  113. package/src/transport/factory.ts +0 -95
  114. package/src/transport/oasn/index.ts +0 -17
  115. package/src/transport/oasn/oasn-agent-card.ts +0 -111
  116. package/src/transport/oasn/oasn-discovery.ts +0 -108
  117. package/src/transport/oasn/oasn-files.ts +0 -210
  118. package/src/transport/oasn/oasn-http.ts +0 -529
  119. package/src/transport/oasn/oasn-invocation.ts +0 -604
  120. package/src/transport/oasn/oasn-normalize.ts +0 -133
  121. package/src/transport/oasn/oasn-register.ts +0 -33
  122. package/src/transport/oasn/oasn-transport.ts +0 -318
  123. package/src/transport/oasn/oasn-types.ts +0 -404
  124. package/src/transport/tim/index.ts +0 -8
  125. package/src/transport/tim/tim-transport.ts +0 -515
  126. package/src/transport/types.ts +0 -538
  127. package/src/types/openclaw-plugin-sdk-media-store.d.ts +0 -9
  128. package/src/types/openclaw.d.ts +0 -97
  129. package/src/types/tencentcloud-chat.d.ts +0 -15
  130. package/src/util/http.ts +0 -113
  131. package/src/util/logger.ts +0 -131
  132. package/src/util/url-resolver.ts +0 -77
@@ -1,896 +0,0 @@
1
- // ── OpenAgent Remote Agent Card Styles ──
2
- //
3
- // 补充样式。核心样式(.cl-thought-chain, .cl-agent-pill, .cl-tools-collapse-*)
4
- // 已由 thought-chain-card.js 注入,此处只补新增的类。
5
- //
6
- // 注意:不使用 .chat-tool-card 类名,避免 scanner.js 误匹配。
7
-
8
- (function _clInjectRemoteAgentStyles() {
9
- var oldStyle = document.getElementById('cl-remote-agent-styles');
10
- if (oldStyle) oldStyle.remove();
11
- var style = document.createElement('style');
12
- style.id = 'cl-remote-agent-styles';
13
- style.setAttribute('data-openagent-style', 'remote-agent');
14
- style.setAttribute('data-openagent-host-version', CL.hostVersion || 'unknown');
15
- style.setAttribute('data-openagent-host-adapter', (CL.hostAdapter && CL.hostAdapter.id) || 'oc-unknown');
16
- var hostCss = (CL.hostAdapter && CL.hostAdapter.css) || {};
17
- function _clSelectorList(selectors) {
18
- if (!selectors) return '';
19
- if (Array.isArray(selectors)) return selectors.filter(Boolean).join(',\n');
20
- return String(selectors || '');
21
- }
22
- function _clRule(selectors, declarations) {
23
- var selectorText = _clSelectorList(selectors);
24
- if (!selectorText) return '';
25
- return selectorText + ' {\n' + declarations.join('\n') + '\n}';
26
- }
27
- style.textContent = [
28
- // ── 隐藏宿主上下文用量提示 ──
29
- '.context-notice.context-notice--usage,',
30
- '.context-notice .context-notice--usage {',
31
- ' display: none !important;',
32
- '}',
33
-
34
- // ── RenderHook 远端 Agent 卡片接管 native tool header ──
35
- _clRule(hostCss.remoteShell, [
36
- ' width: 100% !important;',
37
- ' max-width: 100% !important;',
38
- ' min-width: 0 !important;',
39
- ' box-sizing: border-box !important;',
40
- ' border: 0 !important;',
41
- ' background: transparent !important;',
42
- ' box-shadow: none !important;',
43
- ]),
44
- '/* Align output host shells with execution shells. Keep v4 msg-collapse',
45
- ' separate from newer tools-collapse so modern spacing never leaks into',
46
- ' the 2026.4 DOM. Move the host shell, not the inner OpenAgent card. */',
47
- _clRule(hostCss.outputHostMargin, [
48
- ' margin-left: 12px !important;',
49
- ]),
50
- _clRule(hostCss.outputHostMarginReset, [
51
- ' margin-left: 0 !important;',
52
- ]),
53
- _clRule(hostCss.summaryHidden, [
54
- ' display: none !important;',
55
- ]),
56
- _clRule(hostCss.hostShellRawText, [
57
- ' display: none !important;',
58
- ]),
59
- '.cl-remote-agent-raw-hidden > .chat-text,',
60
- '.cl-remote-agent-raw-hidden.chat-bubble > .chat-text {',
61
- ' display: none !important;',
62
- '}',
63
- '/* Phase A: 不依赖 host-shell class,用 :has() 直接隐藏宿主 raw text */',
64
- _clRule(hostCss.rawTextCardHosts, [
65
- ' display: none !important;',
66
- ]),
67
- _clRule(hostCss.rawTextPlaceholderHosts, [
68
- ' display: none !important;',
69
- ]),
70
- _clRule(hostCss.hostBody, [
71
- ' border: 0 !important;',
72
- ' outline: 0 !important;',
73
- ' background: transparent !important;',
74
- ' box-shadow: none !important;',
75
- ' padding: 0 !important;',
76
- ' margin: 0 !important;',
77
- ' width: 100% !important;',
78
- ' max-width: 100% !important;',
79
- ' min-width: 0 !important;',
80
- ' box-sizing: border-box !important;',
81
- ]),
82
- '.chat-bubble:has(.cl-remote-agent-card) {',
83
- ' border: 0 !important;',
84
- ' background: transparent !important;',
85
- ' box-shadow: none !important;',
86
- ' padding: 10px 0 !important;',
87
- ' width: 100%;',
88
- ' max-width: 100% !important;',
89
- ' min-width: 0 !important;',
90
- ' overflow: hidden !important;',
91
- ' box-sizing: border-box !important;',
92
- '}',
93
- '.chat-split-container:has(.cl-output-card),',
94
- '.chat-main:has(.cl-output-card),',
95
- '.chat-sidebar:has(.cl-output-card),',
96
- '.chat-side-result:has(.cl-output-card),',
97
- '.chat-side-result__body:has(.cl-output-card) {',
98
- ' min-width: 0 !important;',
99
- ' max-width: 100% !important;',
100
- ' box-sizing: border-box !important;',
101
- '}',
102
- _clRule(hostCss.manualOpenReset, [
103
- ' margin-left: 0 !important;',
104
- ]),
105
- // ── 外层活动组容器 ──
106
- '.chat-activity-group__body:has(.cl-remote-agent-card) {',
107
- ' border-radius: 14px;',
108
- ' border: 1px solid #E5E5EA;',
109
- ' background: #F8F9FA;',
110
- ' margin: 8px;',
111
- ' padding-bottom: 0 !important;',
112
- '}',
113
- '.chat-bubble:has(.cl-remote-agent-card) > .chat-text,',
114
- '.chat-bubble:has(.cl-remote-agent-output-placeholder) > .chat-text {',
115
- ' display: none !important;',
116
- '}',
117
- '.cl-remote-agent-host-shell {',
118
- ' width: min(100%, 912px) !important;',
119
- ' max-width: 100% !important;',
120
- ' min-width: 0 !important;',
121
- ' box-sizing: border-box !important;',
122
- '}',
123
- _clRule(hostCss.hostShellReset, [
124
- ' border: 0 !important;',
125
- ' outline: 0 !important;',
126
- ' background: transparent !important;',
127
- ' box-shadow: none !important;',
128
- ]),
129
- _clRule(hostCss.hostShellSummary, [
130
- ' display: none !important;',
131
- ]),
132
- // ── 新卡片容器 ──
133
- // 覆盖 OpenClaw .chat-tool-card 的 max-height: 120px 限制
134
- '.cl-remote-agent-card {',
135
- ' max-height: none;',
136
- ' overflow: visible;',
137
- ' width: 100%;',
138
- ' max-width: 100%;',
139
- ' border: 1px solid rgba(0,0,0,0.05);',
140
- ' border-radius: 14px;',
141
- ' background: #fff;',
142
- ' display: flex;',
143
- ' flex-direction: column;',
144
- ' box-sizing: border-box;',
145
- '}',
146
- _clRule(hostCss.modernCardLayout ? ['.cl-remote-agent-card'] : [], [
147
- ' overflow: hidden;',
148
- ' min-width: 0;',
149
- ' gap: 0;',
150
- ' padding: 15px;',
151
- ]),
152
-
153
- // ── 顶部 OpenAgent 标题条 ──
154
- '.cl-openagent-header {',
155
- ' max-width: 100%;',
156
- ' display: flex;',
157
- ' align-items: center;',
158
- ' gap: 6px;',
159
- ' height: 34px;',
160
- ' padding: 6px 0;',
161
- ' border-radius: 10px;',
162
- ' box-sizing: border-box;',
163
- ' border: none;',
164
- ' background: transparent;',
165
- ' font-family: "PingFang SC", sans-serif;',
166
- '}',
167
- '.cl-openagent-header:hover {',
168
- '}',
169
- _clRule(!hostCss.modernCardLayout ? ['.cl-openagent-header'] : [], [
170
- ' height: auto;',
171
- ' padding: 16px 25px;',
172
- ]),
173
- _clRule(hostCss.modernCardLayout ? ['.cl-openagent-header'] : [], [
174
- ' gap: 0;',
175
- ' height: auto;',
176
- ' padding: 15px;',
177
- ]),
178
- '/* Output mode (Figma 373:12082) */',
179
- '.cl-exec-v2 .cl-openagent-header--output {',
180
- ' border-radius: 10px 10px 0 0 !important;',
181
- ' border: 1px solid rgba(229, 229, 234, 0.75) !important;',
182
- ' background: linear-gradient(90deg, rgba(220, 38, 38, 0.09) 0%, rgba(220, 38, 38, 0) 34%),',
183
- ' linear-gradient(90deg, rgb(253, 253, 254) 0%, rgb(253, 253, 254) 100%) !important;',
184
- ' box-shadow: 0px 8px 11px rgba(0, 0, 0, 0.12);',
185
- ' padding: 8px 6px !important;',
186
- '}',
187
- '.cl-exec-v2 .cl-openagent-header--output .cl-openagent-agent {',
188
- ' display: none;',
189
- '}',
190
- '.cl-exec-v2 .cl-openagent-header--output:hover {',
191
- ' border-color: rgba(0,0,0,0.1);',
192
- '}',
193
- '.cl-openagent-expand-icon {',
194
- ' display: flex;',
195
- ' align-items: center;',
196
- ' justify-content: center;',
197
- ' width: 15px;',
198
- ' height: 15px;',
199
- ' flex-shrink: 0;',
200
- ' transition: transform 0.2s ease;',
201
- '}',
202
- '.cl-openagent-expand-icon.cl-openagent-expanded {',
203
- ' transform: rotate(180deg);',
204
- '}',
205
- '.cl-openagent-badge {',
206
- ' width: 14px;',
207
- ' height: 14px;',
208
- ' border-radius: 14px;',
209
- ' background: url(./icon.png) center / contain no-repeat;',
210
- ' flex-shrink: 0;',
211
- ' overflow: hidden;',
212
- '}',
213
- _clRule(hostCss.modernCardLayout ? ['.cl-openagent-badge'] : [], [
214
- ' background: url(./icon.png) center/cover no-repeat;',
215
- ' margin: 0 6px;',
216
- ]),
217
- '.cl-openagent-text-row {',
218
- ' display: flex;',
219
- ' align-items: center;',
220
- ' gap: 6px;',
221
- ' min-width: 0;',
222
- ' line-height: 1.32;',
223
- '}',
224
- '.cl-openagent-label {',
225
- ' font-size: 12px;',
226
- ' font-weight: 500;',
227
- ' color: #333;',
228
- ' white-space: nowrap;',
229
- '}',
230
- '.cl-openagent-agent {',
231
- ' font-size: 12px;',
232
- ' font-weight: 500;',
233
- ' color: #333;',
234
- ' white-space: nowrap;',
235
- '}',
236
- '.cl-openagent-status {',
237
- ' font-size: 11px;',
238
- ' font-weight: 400;',
239
- ' color: #666;',
240
- ' white-space: nowrap;',
241
- '}',
242
- // ── Execution detail card (Figma 346:181) ──
243
- '.cl-thought-chain-content {',
244
- ' display: flex;',
245
- ' flex-direction: column;',
246
- ' gap: 16px;',
247
- ' min-width: 0;',
248
- ' max-width: 100%;',
249
- ' box-sizing: border-box;',
250
- '}',
251
- _clRule(!hostCss.modernCardLayout ? ['.cl-thought-chain-content.cl-thought-chain-content--execution'] : [], [
252
- ' padding: 0 15px 15px;',
253
- ]),
254
- _clRule(hostCss.modernCardLayout ? ['.cl-thought-chain-content'] : [], [
255
- ' margin-left: 0;',
256
- ' width: 100%;',
257
- ' min-width: 0;',
258
- ' box-sizing: border-box;',
259
- ' overflow: hidden;',
260
- ]),
261
- '.cl-exec-detail-card {',
262
- ' padding: 8px 16px 8px 12px;',
263
- ' border-radius: 8px;',
264
- ' background: #f8f8f8 url(./bg.png) no-repeat;',
265
- ' background-size: 100% 100%;',
266
- ' background-position: center;',
267
- ' width: 460px;',
268
- ' max-width: 100%;',
269
- ' box-sizing: border-box;',
270
- '}',
271
- '.cl-exec-detail-row {',
272
- ' display: flex;',
273
- ' align-items: center;',
274
- ' gap: 16px;',
275
- '}',
276
- '.cl-exec-agent-avatar {',
277
- ' width: 68px;',
278
- ' height: 68px;',
279
- ' object-fit: contain;',
280
- ' flex-shrink: 0;',
281
- '}',
282
- '.cl-exec-detail-info {',
283
- ' display: flex;',
284
- ' flex-direction: column;',
285
- ' gap: 6px;',
286
- ' flex: 1;',
287
- ' min-width: 0;',
288
- '}',
289
- '.cl-exec-name-row {',
290
- ' display: flex;',
291
- ' align-items: center;',
292
- ' justify-content: space-between;',
293
- ' gap: 8px;',
294
- ' margin-bottom: 6px;',
295
- '}',
296
- '.cl-exec-agent-name {',
297
- ' font-family: "PingFang SC", sans-serif;',
298
- ' font-size: 17px;',
299
- ' font-weight: 500;',
300
- ' color: #000;',
301
- ' margin: 0;',
302
- ' line-height: 1;',
303
- '}',
304
- '.cl-exec-star-badge {',
305
- ' display: flex;',
306
- ' align-items: center;',
307
- ' gap: 2px;',
308
- ' padding: 2px 10px 2px 8px;',
309
- ' border-radius: 30px;',
310
- ' background: #ebebeb;',
311
- ' flex-shrink: 0;',
312
- '}',
313
- ,
314
- ,
315
- ,
316
- '.cl-exec-star-count {',
317
- ' font-family: "PingFang SC", sans-serif;',
318
- ' font-size: 11px;',
319
- ' font-weight: 500;',
320
- ' color: #555;',
321
- ' white-space: nowrap;',
322
- '}',
323
- '.cl-exec-agent-bio {',
324
- ' font-family: "PingFang SC", sans-serif;',
325
- ' font-size: 14px;',
326
- ' font-weight: 400;',
327
- ' color: #555;',
328
- ' margin: 0;',
329
- ' line-height: 1;',
330
- '}',
331
- _clRule(!hostCss.modernCardLayout ? ['.cl-exec-agent-bio'] : [], [
332
- ' width: 250px;',
333
- ' max-width: 100%;',
334
- ' min-width: 0;',
335
- ' box-sizing: border-box;',
336
- ' overflow: hidden;',
337
- ' text-overflow: ellipsis;',
338
- ' display: -webkit-box;',
339
- ' -webkit-line-clamp: 2;',
340
- ' -webkit-box-orient: vertical;',
341
- ]),
342
-
343
- // ── Progress text (Figma 346:253) ──
344
- '.cl-thought-chain-content.cl-content-collapsed {',
345
- ' display: none;',
346
- '}',
347
- ,
348
- '.cl-exec-progress-row {',
349
- ' display: flex;',
350
- ' align-items: center;',
351
- ' gap: 2px;',
352
- '}',
353
- '.cl-exec-progress-text {',
354
- ' font-family: "PingFang SC", sans-serif;',
355
- ' font-size: 14px;',
356
- ' font-weight: 400;',
357
- ' line-height: 1.2;',
358
- ' margin: 0;',
359
- ' white-space: nowrap;',
360
- ' background-image: linear-gradient(90deg, #555 0%, #555 36%, #eee 55%, #555 77%, #555 100%);',
361
- ' background-size: 200% 100%;',
362
- ' -webkit-background-clip: text;',
363
- ' background-clip: text;',
364
- ' -webkit-text-fill-color: transparent;',
365
- ' animation: cl-progress-shimmer 2.5s ease-in-out infinite;',
366
- '}',
367
- '.cl-exec-progress-arrow {',
368
- ' display: flex;',
369
- ' align-items: center;',
370
- ' flex-shrink: 0;',
371
- '}',
372
-
373
-
374
- // ── Progress shimmer keyframes ──
375
- '@keyframes cl-progress-shimmer {',
376
- ' 0% { background-position: 200% 0; }',
377
- ' 100% { background-position: -200% 0; }',
378
- '}',
379
-
380
- // ── Output card(Figma 160:6681) ──
381
- '.cl-output-card {',
382
- ' background: #fff !important;',
383
- ' border: 1.2px solid rgba(47,47,51,0.1) !important;',
384
- ' border-radius: 24px !important;',
385
- ' padding: 10px 15px !important;',
386
- ' width: 100% !important;',
387
- ' max-width: 100% !important;',
388
- ' min-width: 0 !important;',
389
- ' box-sizing: border-box !important;',
390
- ' overflow: hidden;',
391
- '}',
392
- _clRule(hostCss.modernCardLayout ? ['.cl-output-card'] : [], [
393
- ' gap: 10px !important;',
394
- ]),
395
- _clRule(!hostCss.modernCardLayout ? ['.cl-output-card'] : [], [
396
- ' border-radius: 14px !important;',
397
- ]),
398
- _clRule(!hostCss.modernCardLayout ? ['.cl-remote-agent-card.cl-thought-chain.cl-output-card'] : [], [
399
- ' padding: 0 !important;',
400
- ]),
401
- '.cl-output-card > .cl-thought-chain-content {',
402
- ' background: #fff;',
403
- ' border: 1px solid #f4f4f4;',
404
- ' border-radius: 12px;',
405
- ' padding: 20px 30px;',
406
- ' overflow: hidden;',
407
- ' width: 100%;',
408
- ' max-width: 100%;',
409
- ' min-width: 0;',
410
- ' box-sizing: border-box;',
411
- '}',
412
- _clRule(!hostCss.modernCardLayout ? ['.cl-output-card > .cl-thought-chain-content'] : [], [
413
- ' margin: 10px 15px;',
414
- ' width: calc(100% - 30px);',
415
- ]),
416
- '.cl-output-card .cl-output-result {',
417
- ' width: 100%;',
418
- ' max-width: 100%;',
419
- ' min-width: 0;',
420
- ' box-sizing: border-box;',
421
- ' overflow-wrap: anywhere;',
422
- ' word-break: break-word;',
423
- '}',
424
- '.cl-output-card > .cl-thought-chain-content * {',
425
- ' max-width: 100%;',
426
- ' min-width: 0;',
427
- ' box-sizing: border-box;',
428
- '}',
429
- '.cl-output-card > .cl-thought-chain-content p,',
430
- '.cl-output-card > .cl-thought-chain-content li,',
431
- '.cl-output-card > .cl-thought-chain-content a {',
432
- ' overflow-wrap: anywhere;',
433
- ' word-break: break-word;',
434
- '}',
435
- '.cl-output-card > .cl-thought-chain-content hr {',
436
- ' border: 0;',
437
- ' border-top: 1px solid #bdbdbd;',
438
- '}',
439
- '.cl-output-card > .cl-thought-chain-content pre,',
440
- '.cl-output-card > .cl-thought-chain-content code {',
441
- ' overflow-x: auto;',
442
- ' white-space: pre-wrap;',
443
- ' word-break: break-all;',
444
- '}',
445
- // V2 output card:统一 border/padding 与 execution card 一致
446
- '.cl-exec-v2.cl-output-card {',
447
- ' border: 1px solid rgba(0,0,0,0.05) !important;',
448
- ' border-radius: 14px !important;',
449
- ' padding: 0 !important;',
450
- '}',
451
- // V2 output card:去掉 content 区多余的内边距,detail card 自带动间距
452
- '.cl-exec-v2.cl-output-card > .cl-thought-chain-content {',
453
- ' background: transparent;',
454
- ' border: none;',
455
- ' border-radius: 0;',
456
- ' padding: 0 14px !important;',
457
- '}',
458
-
459
- // ── Collapsed state(Figma 145:3466) ──
460
- '.cl-remote-agent-card:has(.cl-content-collapsed) {',
461
- ' padding: 0 !important;',
462
- '}',
463
- // ── Output card Footer(Figma 131:2091) ──
464
- '.cl-output-footer {',
465
- ' display: flex;',
466
- ' align-items: center;',
467
- ' gap: 4px;',
468
- ' font-family: "PingFang SC", sans-serif;',
469
- ' font-size: 14px;',
470
- ' color: #999;',
471
- '}',
472
- _clRule(!hostCss.modernCardLayout ? ['.cl-output-footer'] : [], [
473
- ' padding: 10px 15px;',
474
- ' line-height: 22px;',
475
- ]),
476
- '.cl-output-footer-text {',
477
- ' white-space: nowrap;',
478
- '}',
479
- '.cl-output-footer-star {',
480
- ' display: flex;',
481
- ' align-items: center;',
482
- ' flex-shrink: 0;',
483
- '}',
484
- '.cl-output-footer-count {',
485
- ' font-weight: 500;',
486
- ' white-space: nowrap;',
487
- '}',
488
-
489
- /* ── Sidebar 面板(Figma 145:5712) ── */
490
- '.chat-sidebar {',
491
- ' background: #fff !important;',
492
- ' border: 1px solid rgba(0,0,0,0.05) !important;',
493
- ' border-radius: 14px !important;',
494
- ' padding: 16px 20px !important;',
495
- ' box-sizing: border-box !important;',
496
- ' min-width: 0 !important;',
497
- ' max-width: 100% !important;',
498
- ' overflow-x: hidden !important;',
499
- ' display: flex !important;',
500
- ' flex-direction: column !important;',
501
- ' gap: 16px !important;',
502
- '}',
503
- '.chat-sidebar > .sidebar-panel {',
504
- ' display: flex !important;',
505
- ' flex-direction: column !important;',
506
- ' gap: 16px !important;',
507
- ' width: 100% !important;',
508
- ' min-width: 0 !important;',
509
- ' max-width: 100% !important;',
510
- ' overflow-x: hidden !important;',
511
- ' box-sizing: border-box !important;',
512
- ' background: transparent !important;',
513
- '}',
514
- '.chat-sidebar .sidebar-header {',
515
- ' display: flex !important;',
516
- ' align-items: center !important;',
517
- ' justify-content: space-between !important;',
518
- ' padding: 6px 0 !important;',
519
- ' border-radius: 10px !important;',
520
- ' width: 100% !important;',
521
- ' border: none !important;',
522
- ' background: transparent !important;',
523
- '}',
524
- '.chat-sidebar .sidebar-title {',
525
- ' font-family: "PingFang SC", sans-serif !important;',
526
- ' font-weight: 500 !important;',
527
- ' font-size: 18px !important;',
528
- ' color: #333 !important;',
529
- ' line-height: 1.32 !important;',
530
- '}',
531
- '.chat-sidebar .sidebar-header button {',
532
- ' width: 16px !important;',
533
- ' height: 16px !important;',
534
- ' padding: 0 !important;',
535
- ' border: none !important;',
536
- ' background: transparent !important;',
537
- ' cursor: pointer !important;',
538
- ' flex-shrink: 0 !important;',
539
- '}',
540
- '.chat-sidebar .sidebar-content {',
541
- ' font-family: "PingFang SC", sans-serif !important;',
542
- ' font-size: 14px !important;',
543
- ' font-weight: 400 !important;',
544
- ' line-height: 1.8 !important;',
545
- ' color: #333 !important;',
546
- ' width: 100% !important;',
547
- ' min-width: 0 !important;',
548
- ' max-width: 100% !important;',
549
- ' padding: 0 !important;',
550
- ' overflow-x: hidden !important;',
551
- ' box-sizing: border-box !important;',
552
- ' overflow-wrap: anywhere !important;',
553
- '}',
554
- '.chat-sidebar .sidebar-markdown {',
555
- ' font-family: "PingFang SC", sans-serif !important;',
556
- ' font-size: 14px !important;',
557
- ' font-weight: 400 !important;',
558
- ' line-height: 1.8 !important;',
559
- ' color: #333 !important;',
560
- ' background: transparent !important;',
561
- ' border: none !important;',
562
- ' padding: 0 !important;',
563
- ' min-width: 0 !important;',
564
- ' max-width: 100% !important;',
565
- ' overflow-x: hidden !important;',
566
- ' box-sizing: border-box !important;',
567
- ' overflow-wrap: anywhere !important;',
568
- '}',
569
- '.chat-sidebar .sidebar-markdown * {',
570
- ' max-width: 100% !important;',
571
- ' min-width: 0 !important;',
572
- ' box-sizing: border-box !important;',
573
- '}',
574
- '.chat-sidebar .sidebar-markdown pre,',
575
- '.chat-sidebar .sidebar-markdown code {',
576
- ' white-space: pre-wrap !important;',
577
- ' word-break: break-word !important;',
578
- '}',
579
- // 隐藏宿主 sidebar 自带的 "Rendered Markdown / View Raw Text" 工具栏
580
- '.chat-sidebar .sidebar-markdown-shell__toolbar {',
581
- ' display: none !important;',
582
- '}',
583
- // ═══════════════════════════════════════════════════════════════
584
- // V2 执行卡片样式(2026.6.9+ 新版 UI)
585
- // 所有 V2 样式在 .cl-exec-v2 下隔离,不影响旧版
586
- // ═══════════════════════════════════════════════════════════════
587
-
588
- // ── V2 容器 ──
589
- '.cl-exec-v2 {',
590
- ' position: relative;',
591
- ' gap: 10px;',
592
- ' padding: 0;',
593
- '}',
594
-
595
- // ── V2 Header(Figma 371:6987 — 红晕渐变背景 + 独立边框)──
596
- '.cl-exec-v2 .cl-openagent-header-v2 {',
597
- ' background: linear-gradient(90deg, rgba(220, 38, 38, 0.09) 0%, rgba(220, 38, 38, 0) 34%),',
598
- ' linear-gradient(90deg, rgb(253, 253, 254) 0%, rgb(253, 253, 254) 100%) !important;',
599
- ' border-bottom: 1px solid rgba(229, 229, 234, 0.75) !important;',
600
- ' padding: 8px 6px !important;',
601
- ' margin: 0 !important;',
602
- ' border-radius: 10px 10px 0 0;',
603
- ' height: auto !important;',
604
- ' min-height: auto !important;',
605
- ' gap: 6px;',
606
- ' box-sizing: border-box;',
607
- '}',
608
- '.cl-exec-v2 .cl-openagent-header-v2:hover {',
609
- ' background: linear-gradient(90deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0) 34%),',
610
- ' linear-gradient(90deg, rgb(250, 250, 251) 0%, rgb(250, 250, 251) 100%) !important;',
611
- '}',
612
-
613
- // ── V2 圆形灰色头像(替代小徽章)──
614
- '.cl-exec-v2 .cl-openagent-avatar-v2 {',
615
- ' display: inline-block;',
616
- ' width: 24px;',
617
- ' height: 24px;',
618
- ' border-radius: 50%;',
619
- ' background: #d0d0d0;',
620
- ' flex-shrink: 0;',
621
- ' margin-right: 4px;',
622
- '}',
623
-
624
- // ── V2 隐藏旧版 OASN 小徽章和 @agentName ──
625
- '.cl-exec-v2 .cl-openagent-badge,',
626
- '.cl-exec-v2 .cl-openagent-agent {',
627
- ' display: none !important;',
628
- '}',
629
- // ── V2 隐藏步骤标题栏(▼ + "思考中..."),保留进度文字行 ──
630
- '.cl-exec-v2 .cl-tools-collapse-header-v2 {',
631
- ' display: none !important;',
632
- '}',
633
-
634
- // ── V2 Detail Card(大头像 + 右置星级 + 网格点背景)──
635
- '.cl-exec-v2 .cl-exec-detail-card-v2 {',
636
- ' max-width: 488px !important;',
637
- ' width: 100% !important;',
638
- ' padding: 8px 16px 8px 12px !important;',
639
- ' padding-right: 90px !important;',
640
- ' border-radius: 12px !important;',
641
- ' background: #f7f7f8 !important;',
642
- ' margin: 12px 14px 14px 14px !important;',
643
- ' margin-top: 0 !important;',
644
- ' margin-left: 0 !important;',
645
- ' position: relative;',
646
- ' overflow: hidden;',
647
- ' box-sizing: border-box;',
648
- '}',
649
- /* 四角网格点装饰 */
650
- '.cl-exec-v2 .cl-exec-detail-card-v2::before,',
651
- '.cl-exec-v2 .cl-exec-detail-card-v2::after {',
652
- ' content: "";',
653
- ' position: absolute;',
654
- ' width: 40px;',
655
- ' height: 40px;',
656
- ' background-image: radial-gradient(circle, #ddd 1px, transparent 1px);',
657
- ' background-size: 8px 8px;',
658
- ' opacity: 0.5;',
659
- '}',
660
- '.cl-exec-v2 .cl-exec-detail-card-v2::before {',
661
- ' top: 8px;',
662
- ' left: 8px;',
663
- '}',
664
- '.cl-exec-v2 .cl-exec-detail-card-v2::after {',
665
- ' bottom: 8px;',
666
- ' right: 8px;',
667
- '}',
668
-
669
- '.cl-exec-v2 .cl-exec-detail-row-v2 {',
670
- ' display: flex;',
671
- ' gap: 16px;',
672
- '}',
673
-
674
- '.cl-exec-v2 .cl-exec-detail-info-v2 {',
675
- ' display: flex;',
676
- ' flex-direction: column;',
677
- ' gap: 6px;',
678
- ' flex: 1;',
679
- ' min-width: 0;',
680
- '}',
681
-
682
- // ── V2 大头像 68×68 ──
683
- '.cl-exec-v2 .cl-exec-agent-avatar-v2 {',
684
- ' width: 68px !important;',
685
- ' height: 68px !important;',
686
- ' border-radius: 50% !important;',
687
- ' object-fit: cover;',
688
- ' flex-shrink: 0;',
689
- '}',
690
-
691
- // ── V2 名称 ~20px/600/黑色 ──
692
- '.cl-exec-v2 .cl-exec-agent-name-v2 {',
693
- ' font-family: "PingFang SC", sans-serif;',
694
- ' font-size: 20px !important;',
695
- ' font-weight: 600 !important;',
696
- ' color: #000 !important;',
697
- ' margin: 0;',
698
- ' line-height: 1.3;',
699
- '}',
700
-
701
- // ── V2 描述 ~14px/400/灰色 ──
702
- '.cl-exec-v2 .cl-exec-agent-bio-v2 {',
703
- ' font-family: "PingFang SC", sans-serif;',
704
- ' font-size: 14px !important;',
705
- ' font-weight: 400;',
706
- ' color: #888 !important;',
707
- ' margin: 0;',
708
- ' line-height: 1.4;',
709
- '}',
710
-
711
- // ── V2 星级右置到卡片右上角 ──
712
- '.cl-exec-v2 .cl-exec-star-badge-v2 {',
713
- ' position: absolute;',
714
- ' right: 24px;',
715
- ' top: 20px;',
716
- ' display: flex;',
717
- ' align-items: center;',
718
- ' gap: 4px;',
719
- ' padding: 4px 12px;',
720
- ' border-radius: 30px;',
721
- ' background: #ebebeb;',
722
- ' z-index: 1;',
723
- '}',
724
- '.cl-exec-v2 .cl-exec-star-count-v2 {',
725
- ' font-family: "PingFang SC", sans-serif;',
726
- ' font-size: 13px;',
727
- ' font-weight: 500;',
728
- ' color: #555;',
729
- ' white-space: nowrap;',
730
- '}',
731
-
732
- // ── V2 Progress Row(Figma 373:9765 — shimmer 渐变文字 + 箭头)──
733
- '.cl-exec-v2 .cl-exec-progress-row-v2 {',
734
- ' display: flex;',
735
- ' align-items: center;',
736
- ' gap: 2px;',
737
- ' margin-top: 16px;',
738
- ' padding: 0 4px;',
739
- '}',
740
- '.cl-exec-v2 .cl-exec-progress-row-v2 .cl-exec-progress-text {',
741
- ' font-family: "PingFang SC", sans-serif;',
742
- ' font-size: 14px;',
743
- ' font-weight: 400;',
744
- ' line-height: 1.2;',
745
- ' margin: 0;',
746
- ' white-space: nowrap;',
747
- ' background-image: linear-gradient(90deg, #555 0%, #555 36%, #eee 55%, #555 77%, #555 100%);',
748
- ' background-size: 200% 100%;',
749
- ' -webkit-background-clip: text;',
750
- ' background-clip: text;',
751
- ' -webkit-text-fill-color: transparent;',
752
- ' animation: cl-progress-shimmer 2.5s ease-in-out infinite;',
753
- '}',
754
- '.cl-exec-v2 .cl-exec-progress-row-v2 .cl-exec-progress-arrow {',
755
- ' display: flex;',
756
- ' align-items: center;',
757
- ' flex-shrink: 0;',
758
- ' opacity: 1;',
759
- '}',
760
-
761
- // ── V2 隐藏旧版 name-row(星级原来在名称旁边)──
762
- '.cl-exec-v2 .cl-exec-name-row,',
763
- '.cl-exec-v2 .cl-exec-star-badge:not(.cl-exec-star-badge-v2) {',
764
- ' display: none !important;',
765
- '}',
766
-
767
- // ─ V2 步骤列表样式(覆盖 thought-chain-card.js 默认值)──
768
- '.cl-exec-v2 .cl-tools-collapse-body-v2 {',
769
- ' padding: 4px 0 8px;',
770
- '}',
771
- '.cl-exec-v2 .cl-tools-collapse-step {',
772
- ' padding: 5px 0;',
773
- ' gap: 10px;',
774
- '}',
775
- '.cl-exec-v2 .cl-tools-collapse-step-title {',
776
- ' font-size: 13px;',
777
- ' color: #555;',
778
- '}',
779
- '.cl-exec-v2 .cl-tools-collapse-step-check {',
780
- ' width: 12px;',
781
- ' height: 12px;',
782
- ' background: #ccc;',
783
- '}',
784
- '.cl-exec-v2 .cl-tools-collapse-step-dot {',
785
- ' width: 14px;',
786
- ' height: 14px;',
787
- '}',
788
- '.cl-exec-v2 .cl-tools-collapse-step-dot::before,',
789
- '.cl-exec-v2 .cl-tools-collapse-step-dot::after,',
790
- '.cl-exec-v2 .cl-tools-collapse-step-dot span {',
791
- ' width: 3px;',
792
- ' height: 3px;',
793
- ' background: #bbb;',
794
- '}',
795
-
796
- // ── V2 Footer(-由xxx完成 + 星级)──
797
- '.cl-exec-v2 .cl-output-footer-v2 {',
798
- ' display: flex;',
799
- ' align-items: center;',
800
- ' gap: 4px;',
801
- ' font-family: "PingFang SC", sans-serif;',
802
- ' font-size: 13px;',
803
- ' color: #999;',
804
- ' padding: 12px;',
805
- ' margin-top: 8px;',
806
- '}',
807
- '.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-text {',
808
- ' white-space: nowrap;',
809
- '}',
810
- '.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-star {',
811
- ' display: flex;',
812
- ' align-items: center;',
813
- ' flex-shrink: 0;',
814
- ' margin-left: 2px;',
815
- '}',
816
- '.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-count {',
817
- ' font-weight: 500;',
818
- ' white-space: nowrap;',
819
- '}',
820
-
821
- // ── chat-text 下 p 标签样式 ──
822
- '.cl-remote-agent-card .chat-text p {',
823
- ' color: #2F2F33 !important;',
824
- ' text-align: justify;',
825
- ' font-family: "PingFang SC" !important;',
826
- ' font-size: 14px !important;',
827
- ' font-style: normal !important;',
828
- ' font-weight: 400 !important;',
829
- ' line-height: 132% !important;',
830
- '}',
831
-
832
- // ── chat-text 下 code 标签样式(去背景、去边框、加粗)──
833
- '.chat-text code,',
834
- '.cl-remote-agent-card .chat-text code,',
835
- '.cl-remote-agent-card .chat-text p code {',
836
- ' background: transparent !important;',
837
- ' border: none !important;',
838
- ' font-weight: 700 !important;',
839
- '}',
840
- ].join('\n');
841
- document.head.appendChild(style);
842
- // ── 局部 host-shell 标记(不做全局扫描)──
843
- // 只处理当前 cardNode 的祖先链路,不 querySelectorAll 全局
844
- window._clMarkRemoteAgentHostShell = function _clMarkRemoteAgentHostShell(cardNode) {
845
- try {
846
- var hostAdapter = CL.hostAdapter || {};
847
- var node = cardNode && cardNode.parentElement;
848
- var hops = 0;
849
- while (node && node !== document.body && hops < 10) {
850
- if (node.matches && node.matches(
851
- '.chat,.chat-main,.chat-thread,.chat-thread-inner,' +
852
- '.chat-split-container,.content,.content--chat,.shell,.shell--chat'
853
- )) {
854
- break;
855
- }
856
-
857
- var shouldMark = false;
858
- var tag = (node.tagName || '').toLowerCase();
859
- if (typeof hostAdapter.isMarkableHost === 'function') {
860
- shouldMark = hostAdapter.isMarkableHost(node);
861
- }
862
-
863
- if (shouldMark && node.classList) {
864
- node.classList.add('cl-remote-agent-host-shell');
865
- if (tag === 'details' && !node.open) {
866
- node.open = true;
867
- node.setAttribute('open', '');
868
- }
869
- }
870
- node = node.parentElement;
871
- hops++;
872
- }
873
- } catch (err) {}
874
- };
875
-
876
- // 调度器:render hook 生命周期内调用,带延迟重试 + per-node 防抖
877
- window._cl_scheduleHostShellMark = function _cl_scheduleHostShellMark(cardNode) {
878
- if (!cardNode || typeof window._clMarkRemoteAgentHostShell !== 'function') return;
879
-
880
- // 防抖:同一 cardNode 150ms 内不重复调度(标记是幂等的,但有遍历成本)
881
- if (cardNode.__clShellMarkScheduled) return;
882
- cardNode.__clShellMarkScheduled = true;
883
- setTimeout(function() { cardNode.__clShellMarkScheduled = false; }, 150);
884
-
885
- function run() {
886
- try { window._clMarkRemoteAgentHostShell(cardNode); } catch (err) {}
887
- }
888
-
889
- run();
890
- if (typeof requestAnimationFrame === 'function') requestAnimationFrame(run);
891
- setTimeout(run, 0);
892
- setTimeout(run, 80);
893
- };
894
-
895
- console.log('[cl-styles] ✅ remote agent styles injected');
896
- })();