openclaw-openagent 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/dist/src/app/remote-agent-tool.js +110 -14
- package/dist/src/app/types.d.ts +2 -2
- package/dist/src/plugin-ui/adapters/adapters/oc-2026-04.js +103 -0
- package/dist/src/plugin-ui/adapters/adapters/oc-2026-05.js +125 -0
- package/dist/src/plugin-ui/adapters/adapters/oc-2026-06.js +125 -0
- package/dist/src/plugin-ui/adapters/adapters/oc-unknown.js +48 -0
- package/dist/src/plugin-ui/adapters/oc-2026-04.js +103 -0
- package/dist/src/plugin-ui/adapters/oc-2026-05.js +125 -0
- package/dist/src/plugin-ui/adapters/oc-2026-06.js +125 -0
- package/dist/src/plugin-ui/adapters/oc-unknown.js +48 -0
- package/dist/src/plugin-ui/assets/openagent-override.js +1007 -258
- package/dist/src/plugin-ui/index.d.ts +1 -1
- package/dist/src/plugin-ui/index.js +2 -2
- package/dist/src/plugin-ui/ui-extension-loader/index.d.ts +2 -1
- package/dist/src/plugin-ui/ui-extension-loader/index.js +5 -5
- package/dist/src/plugin-ui/ui-extension-loader/registry-regex.js +75 -8
- package/dist/src/plugin-ui/ui-extension-loader/types.d.ts +4 -1
- package/dist/src/state/store.d.ts +21 -0
- package/dist/src/state/store.js +54 -0
- package/dist/src/transport/oasn/oasn-invocation.d.ts +3 -0
- package/dist/src/transport/oasn/oasn-invocation.js +28 -12
- package/dist/src/transport/oasn/oasn-types.d.ts +8 -4
- package/index.ts +1 -1
- package/package.json +4 -3
- package/src/app/remote-agent-tool.ts +131 -16
- package/src/app/types.ts +2 -2
- package/src/plugin-ui/adapters/oc-2026-04.js +103 -0
- package/src/plugin-ui/adapters/oc-2026-05.js +125 -0
- package/src/plugin-ui/adapters/oc-2026-06.js +125 -0
- package/src/plugin-ui/adapters/oc-unknown.js +48 -0
- package/src/plugin-ui/assets/openagent-override.js +1007 -258
- package/src/plugin-ui/build.cjs +249 -38
- package/src/plugin-ui/index.ts +2 -2
- package/src/plugin-ui/modules/agent-book/panel/agent-book.js +102 -12
- package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +105 -3
- package/src/plugin-ui/modules/agent-book/panel/styles.js +42 -35
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/components-core.js +4 -2
- package/src/plugin-ui/modules/agent-book/remote-agent-tool/thought-chain-card.js +4 -1
- package/src/plugin-ui/modules/agent-book/scanner.js +17 -5
- package/src/plugin-ui/modules/agent-book/travelcard/travel-styles.js +5 -0
- package/src/plugin-ui/modules/loader/shared-state.js +244 -20
- package/src/plugin-ui/modules/remote-agent/execution-card.js +54 -16
- package/src/plugin-ui/modules/remote-agent/native-style-adapter.js +5 -23
- package/src/plugin-ui/modules/remote-agent/output-card.js +13 -7
- package/src/plugin-ui/modules/remote-agent/render-hooks.js +53 -41
- package/src/plugin-ui/modules/remote-agent/styles.js +230 -88
- package/src/plugin-ui/modules/remote-agent/tool-card-model.js +72 -4
- package/src/plugin-ui/postinstall-deploy.cjs +52 -0
- package/src/plugin-ui/ui-extension-loader/index.ts +6 -6
- package/src/plugin-ui/ui-extension-loader/registry-regex.ts +81 -9
- package/src/plugin-ui/ui-extension-loader/types.ts +5 -1
- package/src/state/store.ts +80 -0
- package/src/transport/oasn/oasn-invocation.ts +47 -12
- package/src/transport/oasn/oasn-types.ts +6 -2
- package/src/types/openclaw-plugin-sdk-media-store.d.ts +9 -0
|
@@ -10,62 +10,75 @@
|
|
|
10
10
|
if (oldStyle) oldStyle.remove();
|
|
11
11
|
var style = document.createElement('style');
|
|
12
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
|
+
}
|
|
13
27
|
style.textContent = [
|
|
14
|
-
// ──
|
|
15
|
-
'
|
|
16
|
-
'
|
|
17
|
-
'.chat-tools-collapse:has(.cl-remote-agent-card),',
|
|
18
|
-
'.chat-tool-msg-collapse:has(.cl-remote-agent-card) {',
|
|
19
|
-
' width: 100% !important;',
|
|
20
|
-
' max-width: none !important;',
|
|
21
|
-
' box-sizing: border-box !important;',
|
|
22
|
-
' border: 0 !important;',
|
|
23
|
-
' background: transparent !important;',
|
|
24
|
-
' box-shadow: none !important;',
|
|
25
|
-
'}',
|
|
26
|
-
'/* Align output host shells with execution shells. 3.28 renders output as',
|
|
27
|
-
' chat-tools-collapse + .cl-output-card; some versions use chat-tool-msg-collapse.',
|
|
28
|
-
' Move the host shell, not the inner OpenAgent card. */',
|
|
29
|
-
'details.chat-tools-collapse:has(.cl-output-card),',
|
|
30
|
-
'.chat-tools-collapse:has(.cl-output-card),',
|
|
31
|
-
'details.chat-tool-msg-collapse:has(.cl-remote-agent-card),',
|
|
32
|
-
'.chat-tool-msg-collapse:has(.cl-remote-agent-card) {',
|
|
33
|
-
' margin-left: 12px !important;',
|
|
34
|
-
'}',
|
|
35
|
-
'details.chat-tools-collapse:has(.cl-remote-agent-card) > summary.chat-tools-summary,',
|
|
36
|
-
'details.chat-tool-msg-collapse:has(.cl-remote-agent-card) > summary.chat-tool-msg-summary,',
|
|
37
|
-
'.chat-tools-collapse:has(.cl-remote-agent-card) > .chat-tools-summary,',
|
|
38
|
-
'.chat-tool-msg-collapse:has(.cl-remote-agent-card) > .chat-tool-msg-summary {',
|
|
39
|
-
' display: none !important;',
|
|
40
|
-
'}',
|
|
41
|
-
'.chat-tools-collapse__body.cl-remote-agent-host-shell > .chat-text,',
|
|
42
|
-
'.chat-tool-msg-body.cl-remote-agent-host-shell > .chat-text {',
|
|
28
|
+
// ── 隐藏宿主上下文用量提示 ──
|
|
29
|
+
'.context-notice.context-notice--usage,',
|
|
30
|
+
'.context-notice .context-notice--usage {',
|
|
43
31
|
' display: none !important;',
|
|
44
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
|
+
]),
|
|
45
59
|
'.cl-remote-agent-raw-hidden > .chat-text,',
|
|
46
60
|
'.cl-remote-agent-raw-hidden.chat-bubble > .chat-text {',
|
|
47
61
|
' display: none !important;',
|
|
48
62
|
'}',
|
|
49
63
|
'/* Phase A: 不依赖 host-shell class,用 :has() 直接隐藏宿主 raw text */',
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
'}',
|
|
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
|
+
]),
|
|
69
82
|
'.chat-bubble:has(.cl-remote-agent-card) {',
|
|
70
83
|
' border: 0 !important;',
|
|
71
84
|
' background: transparent !important;',
|
|
@@ -73,11 +86,22 @@
|
|
|
73
86
|
' padding: 10px 0 !important;',
|
|
74
87
|
' width: 100%;',
|
|
75
88
|
' max-width: 100% !important;',
|
|
89
|
+
' min-width: 0 !important;',
|
|
76
90
|
' overflow: hidden !important;',
|
|
91
|
+
' box-sizing: border-box !important;',
|
|
77
92
|
'}',
|
|
78
|
-
'.chat-
|
|
79
|
-
'
|
|
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;',
|
|
80
101
|
'}',
|
|
102
|
+
_clRule(hostCss.manualOpenReset, [
|
|
103
|
+
' margin-left: 0 !important;',
|
|
104
|
+
]),
|
|
81
105
|
// ── 外层活动组容器 ──
|
|
82
106
|
'.chat-activity-group__body:has(.cl-remote-agent-card) {',
|
|
83
107
|
' border-radius: 14px;',
|
|
@@ -93,22 +117,18 @@
|
|
|
93
117
|
'.cl-remote-agent-host-shell {',
|
|
94
118
|
' width: min(100%, 912px) !important;',
|
|
95
119
|
' max-width: 100% !important;',
|
|
120
|
+
' min-width: 0 !important;',
|
|
96
121
|
' box-sizing: border-box !important;',
|
|
97
122
|
'}',
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
'}',
|
|
108
|
-
'.cl-remote-agent-host-shell > summary.chat-tools-summary,',
|
|
109
|
-
'.cl-remote-agent-host-shell > summary.chat-tool-msg-summary {',
|
|
110
|
-
' display: none !important;',
|
|
111
|
-
'}',
|
|
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
|
+
]),
|
|
112
132
|
// ── 新卡片容器 ──
|
|
113
133
|
// 覆盖 OpenClaw .chat-tool-card 的 max-height: 120px 限制
|
|
114
134
|
'.cl-remote-agent-card {',
|
|
@@ -121,9 +141,14 @@
|
|
|
121
141
|
' background: #fff;',
|
|
122
142
|
' display: flex;',
|
|
123
143
|
' flex-direction: column;',
|
|
124
|
-
' gap: 10px;',
|
|
125
144
|
' box-sizing: border-box;',
|
|
126
145
|
'}',
|
|
146
|
+
_clRule(hostCss.modernCardLayout ? ['.cl-remote-agent-card'] : [], [
|
|
147
|
+
' overflow: hidden;',
|
|
148
|
+
' min-width: 0;',
|
|
149
|
+
' gap: 0;',
|
|
150
|
+
' padding: 15px;',
|
|
151
|
+
]),
|
|
127
152
|
|
|
128
153
|
// ── 顶部 OpenAgent 标题条 ──
|
|
129
154
|
'.cl-openagent-header {',
|
|
@@ -141,8 +166,16 @@
|
|
|
141
166
|
'}',
|
|
142
167
|
'.cl-openagent-header:hover {',
|
|
143
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
|
+
]),
|
|
144
178
|
'/* Output mode (Figma 373:12082) */',
|
|
145
|
-
'.cl-openagent-header--output,',
|
|
146
179
|
'.cl-exec-v2 .cl-openagent-header--output {',
|
|
147
180
|
' border-radius: 10px 10px 0 0 !important;',
|
|
148
181
|
' border: 1px solid rgba(229, 229, 234, 0.75) !important;',
|
|
@@ -151,11 +184,9 @@
|
|
|
151
184
|
' box-shadow: 0px 8px 11px rgba(0, 0, 0, 0.12);',
|
|
152
185
|
' padding: 8px 6px !important;',
|
|
153
186
|
'}',
|
|
154
|
-
'.cl-openagent-header--output .cl-openagent-agent,',
|
|
155
187
|
'.cl-exec-v2 .cl-openagent-header--output .cl-openagent-agent {',
|
|
156
188
|
' display: none;',
|
|
157
189
|
'}',
|
|
158
|
-
'.cl-openagent-header--output:hover,',
|
|
159
190
|
'.cl-exec-v2 .cl-openagent-header--output:hover {',
|
|
160
191
|
' border-color: rgba(0,0,0,0.1);',
|
|
161
192
|
'}',
|
|
@@ -175,10 +206,14 @@
|
|
|
175
206
|
' width: 14px;',
|
|
176
207
|
' height: 14px;',
|
|
177
208
|
' border-radius: 14px;',
|
|
178
|
-
' background: url(./icon.png) center/
|
|
209
|
+
' background: url(./icon.png) center / contain no-repeat;',
|
|
179
210
|
' flex-shrink: 0;',
|
|
180
211
|
' overflow: hidden;',
|
|
181
212
|
'}',
|
|
213
|
+
_clRule(hostCss.modernCardLayout ? ['.cl-openagent-badge'] : [], [
|
|
214
|
+
' background: url(./icon.png) center/cover no-repeat;',
|
|
215
|
+
' margin: 0 6px;',
|
|
216
|
+
]),
|
|
182
217
|
'.cl-openagent-text-row {',
|
|
183
218
|
' display: flex;',
|
|
184
219
|
' align-items: center;',
|
|
@@ -209,7 +244,20 @@
|
|
|
209
244
|
' display: flex;',
|
|
210
245
|
' flex-direction: column;',
|
|
211
246
|
' gap: 16px;',
|
|
247
|
+
' min-width: 0;',
|
|
248
|
+
' max-width: 100%;',
|
|
249
|
+
' box-sizing: border-box;',
|
|
212
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
|
+
]),
|
|
213
261
|
'.cl-exec-detail-card {',
|
|
214
262
|
' padding: 8px 16px 8px 12px;',
|
|
215
263
|
' border-radius: 8px;',
|
|
@@ -228,8 +276,7 @@
|
|
|
228
276
|
'.cl-exec-agent-avatar {',
|
|
229
277
|
' width: 68px;',
|
|
230
278
|
' height: 68px;',
|
|
231
|
-
'
|
|
232
|
-
' object-fit: cover;',
|
|
279
|
+
' object-fit: contain;',
|
|
233
280
|
' flex-shrink: 0;',
|
|
234
281
|
'}',
|
|
235
282
|
'.cl-exec-detail-info {',
|
|
@@ -281,6 +328,17 @@
|
|
|
281
328
|
' margin: 0;',
|
|
282
329
|
' line-height: 1;',
|
|
283
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
|
+
]),
|
|
284
342
|
|
|
285
343
|
// ── Progress text (Figma 346:253) ──
|
|
286
344
|
'.cl-thought-chain-content.cl-content-collapsed {',
|
|
@@ -325,21 +383,59 @@
|
|
|
325
383
|
' border: 1.2px solid rgba(47,47,51,0.1) !important;',
|
|
326
384
|
' border-radius: 24px !important;',
|
|
327
385
|
' padding: 10px 15px !important;',
|
|
328
|
-
'
|
|
386
|
+
' width: 100% !important;',
|
|
387
|
+
' max-width: 100% !important;',
|
|
388
|
+
' min-width: 0 !important;',
|
|
389
|
+
' box-sizing: border-box !important;',
|
|
390
|
+
' overflow: hidden;',
|
|
329
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
|
+
]),
|
|
330
401
|
'.cl-output-card > .cl-thought-chain-content {',
|
|
331
402
|
' background: #fff;',
|
|
332
403
|
' border: 1px solid #f4f4f4;',
|
|
333
404
|
' border-radius: 12px;',
|
|
334
405
|
' padding: 20px 30px;',
|
|
335
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%;',
|
|
336
418
|
' max-width: 100%;',
|
|
419
|
+
' min-width: 0;',
|
|
337
420
|
' box-sizing: border-box;',
|
|
421
|
+
' overflow-wrap: anywhere;',
|
|
422
|
+
' word-break: break-word;',
|
|
338
423
|
'}',
|
|
339
424
|
'.cl-output-card > .cl-thought-chain-content * {',
|
|
340
425
|
' max-width: 100%;',
|
|
426
|
+
' min-width: 0;',
|
|
341
427
|
' box-sizing: border-box;',
|
|
342
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
|
+
'}',
|
|
343
439
|
'.cl-output-card > .cl-thought-chain-content pre,',
|
|
344
440
|
'.cl-output-card > .cl-thought-chain-content code {',
|
|
345
441
|
' overflow-x: auto;',
|
|
@@ -373,6 +469,10 @@
|
|
|
373
469
|
' font-size: 14px;',
|
|
374
470
|
' color: #999;',
|
|
375
471
|
'}',
|
|
472
|
+
_clRule(!hostCss.modernCardLayout ? ['.cl-output-footer'] : [], [
|
|
473
|
+
' padding: 10px 15px;',
|
|
474
|
+
' line-height: 22px;',
|
|
475
|
+
]),
|
|
376
476
|
'.cl-output-footer-text {',
|
|
377
477
|
' white-space: nowrap;',
|
|
378
478
|
'}',
|
|
@@ -393,6 +493,9 @@
|
|
|
393
493
|
' border-radius: 14px !important;',
|
|
394
494
|
' padding: 16px 20px !important;',
|
|
395
495
|
' box-sizing: border-box !important;',
|
|
496
|
+
' min-width: 0 !important;',
|
|
497
|
+
' max-width: 100% !important;',
|
|
498
|
+
' overflow-x: hidden !important;',
|
|
396
499
|
' display: flex !important;',
|
|
397
500
|
' flex-direction: column !important;',
|
|
398
501
|
' gap: 16px !important;',
|
|
@@ -402,6 +505,10 @@
|
|
|
402
505
|
' flex-direction: column !important;',
|
|
403
506
|
' gap: 16px !important;',
|
|
404
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;',
|
|
405
512
|
' background: transparent !important;',
|
|
406
513
|
'}',
|
|
407
514
|
'.chat-sidebar .sidebar-header {',
|
|
@@ -437,7 +544,12 @@
|
|
|
437
544
|
' line-height: 1.8 !important;',
|
|
438
545
|
' color: #333 !important;',
|
|
439
546
|
' width: 100% !important;',
|
|
547
|
+
' min-width: 0 !important;',
|
|
548
|
+
' max-width: 100% !important;',
|
|
440
549
|
' padding: 0 !important;',
|
|
550
|
+
' overflow-x: hidden !important;',
|
|
551
|
+
' box-sizing: border-box !important;',
|
|
552
|
+
' overflow-wrap: anywhere !important;',
|
|
441
553
|
'}',
|
|
442
554
|
'.chat-sidebar .sidebar-markdown {',
|
|
443
555
|
' font-family: "PingFang SC", sans-serif !important;',
|
|
@@ -448,6 +560,21 @@
|
|
|
448
560
|
' background: transparent !important;',
|
|
449
561
|
' border: none !important;',
|
|
450
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;',
|
|
451
578
|
'}',
|
|
452
579
|
// 隐藏宿主 sidebar 自带的 "Rendered Markdown / View Raw Text" 工具栏
|
|
453
580
|
'.chat-sidebar .sidebar-markdown-shell__toolbar {',
|
|
@@ -461,6 +588,8 @@
|
|
|
461
588
|
// ── V2 容器 ──
|
|
462
589
|
'.cl-exec-v2 {',
|
|
463
590
|
' position: relative;',
|
|
591
|
+
' gap: 10px;',
|
|
592
|
+
' padding: 0;',
|
|
464
593
|
'}',
|
|
465
594
|
|
|
466
595
|
// ── V2 Header(Figma 371:6987 — 红晕渐变背景 + 独立边框)──
|
|
@@ -473,6 +602,7 @@
|
|
|
473
602
|
' border-radius: 10px 10px 0 0;',
|
|
474
603
|
' height: auto !important;',
|
|
475
604
|
' min-height: auto !important;',
|
|
605
|
+
' gap: 6px;',
|
|
476
606
|
' box-sizing: border-box;',
|
|
477
607
|
'}',
|
|
478
608
|
'.cl-exec-v2 .cl-openagent-header-v2:hover {',
|
|
@@ -510,6 +640,7 @@
|
|
|
510
640
|
' border-radius: 12px !important;',
|
|
511
641
|
' background: #f7f7f8 !important;',
|
|
512
642
|
' margin: 12px 14px 14px 14px !important;',
|
|
643
|
+
' margin-top: 0 !important;',
|
|
513
644
|
' margin-left: 0 !important;',
|
|
514
645
|
' position: relative;',
|
|
515
646
|
' overflow: hidden;',
|
|
@@ -537,7 +668,6 @@
|
|
|
537
668
|
|
|
538
669
|
'.cl-exec-v2 .cl-exec-detail-row-v2 {',
|
|
539
670
|
' display: flex;',
|
|
540
|
-
' align-items: flex-start;',
|
|
541
671
|
' gap: 16px;',
|
|
542
672
|
'}',
|
|
543
673
|
|
|
@@ -549,11 +679,11 @@
|
|
|
549
679
|
' min-width: 0;',
|
|
550
680
|
'}',
|
|
551
681
|
|
|
552
|
-
// ── V2 大头像
|
|
682
|
+
// ── V2 大头像 68×68 ──
|
|
553
683
|
'.cl-exec-v2 .cl-exec-agent-avatar-v2 {',
|
|
554
|
-
' width:
|
|
555
|
-
' height:
|
|
556
|
-
' border-radius:
|
|
684
|
+
' width: 68px !important;',
|
|
685
|
+
' height: 68px !important;',
|
|
686
|
+
' border-radius: 50% !important;',
|
|
557
687
|
' object-fit: cover;',
|
|
558
688
|
' flex-shrink: 0;',
|
|
559
689
|
'}',
|
|
@@ -687,12 +817,33 @@
|
|
|
687
817
|
' font-weight: 500;',
|
|
688
818
|
' white-space: nowrap;',
|
|
689
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
|
+
'}',
|
|
690
840
|
].join('\n');
|
|
691
841
|
document.head.appendChild(style);
|
|
692
842
|
// ── 局部 host-shell 标记(不做全局扫描)──
|
|
693
843
|
// 只处理当前 cardNode 的祖先链路,不 querySelectorAll 全局
|
|
694
844
|
window._clMarkRemoteAgentHostShell = function _clMarkRemoteAgentHostShell(cardNode) {
|
|
695
845
|
try {
|
|
846
|
+
var hostAdapter = CL.hostAdapter || {};
|
|
696
847
|
var node = cardNode && cardNode.parentElement;
|
|
697
848
|
var hops = 0;
|
|
698
849
|
while (node && node !== document.body && hops < 10) {
|
|
@@ -705,17 +856,8 @@
|
|
|
705
856
|
|
|
706
857
|
var shouldMark = false;
|
|
707
858
|
var tag = (node.tagName || '').toLowerCase();
|
|
708
|
-
if (
|
|
709
|
-
shouldMark =
|
|
710
|
-
'details.chat-tools-collapse, details.chat-tool-msg-collapse'
|
|
711
|
-
);
|
|
712
|
-
} else if (node.matches) {
|
|
713
|
-
shouldMark = node.matches(
|
|
714
|
-
'.chat-tool-card,' +
|
|
715
|
-
'.chat-tool-card__detail,' +
|
|
716
|
-
'.chat-tools-collapse__body,' +
|
|
717
|
-
'.chat-tool-msg-body'
|
|
718
|
-
);
|
|
859
|
+
if (typeof hostAdapter.isMarkableHost === 'function') {
|
|
860
|
+
shouldMark = hostAdapter.isMarkableHost(node);
|
|
719
861
|
}
|
|
720
862
|
|
|
721
863
|
if (shouldMark && node.classList) {
|
|
@@ -15,6 +15,73 @@ function _clInferToolCardKind(card) {
|
|
|
15
15
|
return 'call';
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function _clPickAgentDescription(source) {
|
|
19
|
+
if (!source) return '';
|
|
20
|
+
var keys = [
|
|
21
|
+
'agent_bio',
|
|
22
|
+
'agentBio',
|
|
23
|
+
'bio',
|
|
24
|
+
'description',
|
|
25
|
+
'desc',
|
|
26
|
+
'agent_description',
|
|
27
|
+
'agentDescription',
|
|
28
|
+
'MOM',
|
|
29
|
+
'mom',
|
|
30
|
+
'introduction',
|
|
31
|
+
'summary'
|
|
32
|
+
];
|
|
33
|
+
for (var i = 0; i < keys.length; i++) {
|
|
34
|
+
var value = source[keys[i]];
|
|
35
|
+
if (typeof value === 'string' && value.trim()) return value.trim();
|
|
36
|
+
}
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function _clIsFailureStatusValue(value) {
|
|
41
|
+
var normalized = String(value || '').trim().toLowerCase();
|
|
42
|
+
return normalized === 'failed'
|
|
43
|
+
|| normalized === 'failure'
|
|
44
|
+
|| normalized === 'error'
|
|
45
|
+
|| normalized === 'errored'
|
|
46
|
+
|| normalized === 'rejected'
|
|
47
|
+
|| normalized === 'cancelled'
|
|
48
|
+
|| normalized === 'canceled';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function _clLooksLikeRemoteFailureText(text) {
|
|
52
|
+
var value = String(text || '').trim();
|
|
53
|
+
if (!value || value.length > 300) return false;
|
|
54
|
+
return /(^|[,。;\s])(调用失败|执行失败|任务失败|远端服务目前连不上|远端服务.*不可用|两次都返回了调用失败)([,。;\s]|$)/.test(value);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function _clInferToolCardError(card, chunks, rawText) {
|
|
58
|
+
if (chunks && chunks.some(function(c) { return c && c.type === 'error'; })) return true;
|
|
59
|
+
if (!card) return _clLooksLikeRemoteFailureText(rawText);
|
|
60
|
+
if (card.isError === true || card.error === true) return true;
|
|
61
|
+
if (_clIsFailureStatusValue(card.status)
|
|
62
|
+
|| _clIsFailureStatusValue(card.state)
|
|
63
|
+
|| _clIsFailureStatusValue(card.resultStatus)) {
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
if (card.error && typeof card.error === 'object') return true;
|
|
67
|
+
return _clLooksLikeRemoteFailureText(rawText);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function _clApplyAgentIdentityToModel(model) {
|
|
71
|
+
if (!model || typeof CL === 'undefined' || !CL || typeof CL.getAgentIdentity !== 'function') return model;
|
|
72
|
+
var identity = CL.getAgentIdentity(model.agentId, model.agentName);
|
|
73
|
+
if (!identity) return model;
|
|
74
|
+
model.agentId = model.agentId || identity.id || identity.agent_id;
|
|
75
|
+
if (!model.agentName || model.agentName === 'Remote Agent') {
|
|
76
|
+
model.agentName = identity.name || model.agentName;
|
|
77
|
+
}
|
|
78
|
+
model.agentAvatar = model.agentAvatar || identity.avatar || identity.avatar_url || identity.avatarUrl || null;
|
|
79
|
+
if (!model.agentBio) {
|
|
80
|
+
model.agentBio = _clPickAgentDescription(identity);
|
|
81
|
+
}
|
|
82
|
+
return model;
|
|
83
|
+
}
|
|
84
|
+
|
|
18
85
|
function _clParseToolCardModel(card) {
|
|
19
86
|
var inferredKind = _clInferToolCardKind(card);
|
|
20
87
|
|
|
@@ -23,7 +90,7 @@ function _clParseToolCardModel(card) {
|
|
|
23
90
|
var agentId = args.agent_id || args.agentId || null;
|
|
24
91
|
var agentName = args.agent_name || args.agentName || agentId || 'Remote Agent';
|
|
25
92
|
var agentAvatar = args.agent_avatar || args.agentAvatar || args.avatar || args.avatar_url || args.avatarUrl || null;
|
|
26
|
-
var agentBio = args
|
|
93
|
+
var agentBio = _clPickAgentDescription(args);
|
|
27
94
|
var agentStars = args.agent_stars || args.agentStars || args.stars || args.claws || '3.2万';
|
|
28
95
|
var taskText = args.task || args.message || args.instruction || '';
|
|
29
96
|
|
|
@@ -34,7 +101,7 @@ function _clParseToolCardModel(card) {
|
|
|
34
101
|
rawText: rawText
|
|
35
102
|
});
|
|
36
103
|
var hasOutput = inferredKind === 'result' && rawText.trim().length > 0;
|
|
37
|
-
var isError =
|
|
104
|
+
var isError = _clInferToolCardError(card, chunks, rawText);
|
|
38
105
|
|
|
39
106
|
var model = {
|
|
40
107
|
agentId: agentId,
|
|
@@ -44,7 +111,7 @@ function _clParseToolCardModel(card) {
|
|
|
44
111
|
agentStars: agentStars,
|
|
45
112
|
taskText: taskText,
|
|
46
113
|
toolCallId: card.toolCallId || '',
|
|
47
|
-
status: hasOutput ? 'completed' : 'executing',
|
|
114
|
+
status: isError ? 'failed' : (hasOutput ? 'completed' : 'executing'),
|
|
48
115
|
rawText: rawText,
|
|
49
116
|
text: rawText,
|
|
50
117
|
outputText: rawText,
|
|
@@ -52,8 +119,9 @@ function _clParseToolCardModel(card) {
|
|
|
52
119
|
isError: isError,
|
|
53
120
|
inferredKind: inferredKind,
|
|
54
121
|
};
|
|
122
|
+
_clApplyAgentIdentityToModel(model);
|
|
55
123
|
|
|
56
|
-
console.log('[cl-model] parsed:', 'agent=' + agentName,
|
|
124
|
+
console.log('[cl-model] parsed:', 'agent=' + model.agentName,
|
|
57
125
|
'status=' + model.status,
|
|
58
126
|
'chunks=' + chunks.length,
|
|
59
127
|
'error=' + isError);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Best-effort deploy for npm install/upgrade.
|
|
4
|
+
*
|
|
5
|
+
* The browser cache strategy depends on Control UI index.html carrying the
|
|
6
|
+
* latest openagent-override.js?v=<hash>. Running the override builder here
|
|
7
|
+
* updates reachable OpenClaw Control UI directories immediately after the npm
|
|
8
|
+
* package changes, without making npm install fail if OpenClaw is not present.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const fs = require('fs');
|
|
12
|
+
const path = require('path');
|
|
13
|
+
const { spawnSync } = require('child_process');
|
|
14
|
+
|
|
15
|
+
function log(message) {
|
|
16
|
+
console.log('[openagent postinstall] ' + message);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function main() {
|
|
20
|
+
if (process.env.OPENAGENT_SKIP_POSTINSTALL_DEPLOY === '1') {
|
|
21
|
+
log('skipped by OPENAGENT_SKIP_POSTINSTALL_DEPLOY=1');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const buildScript = path.join(__dirname, 'build.cjs');
|
|
26
|
+
if (!fs.existsSync(buildScript)) {
|
|
27
|
+
log('build script not found, skipped');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const result = spawnSync(process.execPath, [buildScript], {
|
|
32
|
+
cwd: path.join(__dirname, '..', '..'),
|
|
33
|
+
env: {
|
|
34
|
+
...process.env,
|
|
35
|
+
OPENAGENT_POSTINSTALL_DEPLOY: '1',
|
|
36
|
+
},
|
|
37
|
+
stdio: 'inherit',
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (result.error) {
|
|
41
|
+
log('deploy skipped: ' + result.error.message);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (result.status !== 0) {
|
|
45
|
+
log('deploy exited with code ' + result.status + ' (ignored)');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
log('deployed latest Control UI override where reachable');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
main();
|