openclaw-openagent 1.0.9 → 1.0.11
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/src/plugin-ui/assets/bg.png +0 -0
- package/dist/src/plugin-ui/assets/icon.png +0 -0
- package/dist/src/plugin-ui/assets/openagent-override.js +1553 -826
- package/dist/src/plugin-ui/ui-extension-loader/registry-regex.js +53 -5
- package/openclaw.plugin.json +1 -1
- package/package.json +3 -3
- package/src/plugin-ui/assets/bg.png +0 -0
- package/src/plugin-ui/assets/icon.png +0 -0
- package/src/plugin-ui/assets/openagent-override.js +1553 -826
- package/src/plugin-ui/build.cjs +79 -4
- package/src/plugin-ui/modules/agent-book/panel/agent-book.js +92 -9
- package/src/plugin-ui/modules/agent-book/panel/agent-card.js +26 -10
- package/src/plugin-ui/modules/agent-book/panel/agent-data.js +1 -1
- package/src/plugin-ui/modules/agent-book/panel/inject-ui.js +46 -0
- package/src/plugin-ui/modules/agent-book/panel/styles.js +313 -178
- package/src/plugin-ui/modules/loader/bootstrap.js +1 -1
- package/src/plugin-ui/modules/loader/shared-state.js +54 -0
- package/src/plugin-ui/modules/remote-agent/execution-card.js +347 -124
- package/src/plugin-ui/modules/remote-agent/output-card.js +91 -31
- package/src/plugin-ui/modules/remote-agent/render-hooks.js +97 -18
- package/src/plugin-ui/modules/remote-agent/styles.js +482 -457
- package/src/plugin-ui/modules/remote-agent/tool-card-model.js +6 -0
- package/src/plugin-ui/ui-extension-loader/registry-regex.ts +50 -5
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* OpenAgent UI Override — Auto-generated, do not edit directly!
|
|
3
3
|
*
|
|
4
4
|
* Source: src/plugin-ui/modules/
|
|
5
|
-
* Built: 2026-
|
|
5
|
+
* Built: 2026-07-01T12:59:59.814Z
|
|
6
6
|
*
|
|
7
7
|
* To modify, edit the source modules and run:
|
|
8
8
|
* npm run build:override
|
|
@@ -48,6 +48,9 @@ const CL = {
|
|
|
48
48
|
handleDelegateWsEvent: function(msg) {},
|
|
49
49
|
processCustomCards: function(bubble) {},
|
|
50
50
|
|
|
51
|
+
// ── Host 版本(构建时注入,fallback 运行时检测)──
|
|
52
|
+
hostVersion: '__OPENCLAW_HOST_VERSION__',
|
|
53
|
+
|
|
51
54
|
// ── 配置 ──
|
|
52
55
|
OPENAGENT_API: 'https://api.openagent.club',
|
|
53
56
|
AUTH_API: '/plugins/openagent', // Proxied via Gateway registerHttpRoute (see src/proxy/auth-proxy.ts)
|
|
@@ -56,6 +59,57 @@ const CL = {
|
|
|
56
59
|
CACHE_TTL: 30000,
|
|
57
60
|
};
|
|
58
61
|
|
|
62
|
+
// ── 版本解析与比较(供 execution-card V2 分支使用)──
|
|
63
|
+
|
|
64
|
+
function _clParseHostVersion(v) {
|
|
65
|
+
if (!v) return [0, 0, 0];
|
|
66
|
+
var base = String(v).split('-')[0];
|
|
67
|
+
var parts = base.split('.');
|
|
68
|
+
if (parts.length !== 3) return [0, 0, 0];
|
|
69
|
+
var y = parseInt(parts[0], 10);
|
|
70
|
+
var m = parseInt(parts[1], 10);
|
|
71
|
+
var d = parseInt(parts[2], 10);
|
|
72
|
+
if (isNaN(y) || isNaN(m) || isNaN(d)) return [0, 0, 0];
|
|
73
|
+
return [y, m, d];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function _clIsHostVersionGte(minVer) {
|
|
77
|
+
var cur = _clParseHostVersion(CL.hostVersion || '');
|
|
78
|
+
var min = _clParseHostVersion(minVer);
|
|
79
|
+
for (var i = 0; i < 3; i++) {
|
|
80
|
+
if (cur[i] > min[i]) return true;
|
|
81
|
+
if (cur[i] < min[i]) return false;
|
|
82
|
+
}
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// ─ 运行时 fallback:当构建时未注入版本,通过 CSS/DOM 特征检测 ──
|
|
87
|
+
// v5.x (2026.5+) 有 data-theme 属性和 --glass-surface CSS 变量
|
|
88
|
+
// v4.x (2026.3-4.x) 有 data-theme-mode 属性和 --vscode-* CSS 变量
|
|
89
|
+
if (CL.hostVersion === '__OPENCLAW_HOST_VERSION__' || !CL.hostVersion) {
|
|
90
|
+
try {
|
|
91
|
+
if (document.documentElement.hasAttribute('data-theme')) {
|
|
92
|
+
// v5.x (2026.5+) — 有 data-theme 属性
|
|
93
|
+
CL.hostVersion = '2026.6.9';
|
|
94
|
+
} else if (document.documentElement.hasAttribute('data-theme-mode')) {
|
|
95
|
+
// v4.x — 有 data-theme-mode 属性
|
|
96
|
+
CL.hostVersion = '2026.4.0';
|
|
97
|
+
} else {
|
|
98
|
+
var cs = getComputedStyle(document.documentElement);
|
|
99
|
+
if (cs.getPropertyValue('--glass-surface').trim()) {
|
|
100
|
+
CL.hostVersion = '2026.6.9';
|
|
101
|
+
} else if (cs.getPropertyValue('--vscode-editor-background').trim()) {
|
|
102
|
+
CL.hostVersion = '2026.4.0';
|
|
103
|
+
} else {
|
|
104
|
+
CL.hostVersion = '2026.3.0';
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
console.log('[cl-version] detected via DOM/CSS features: ' + CL.hostVersion);
|
|
108
|
+
} catch (e) {
|
|
109
|
+
CL.hostVersion = '2026.3.0';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
59
113
|
// 暴露到 window 供控制台调试/测试
|
|
60
114
|
window.__CL = CL;
|
|
61
115
|
|
|
@@ -1405,7 +1459,7 @@ function avatarUrl(agent) {
|
|
|
1405
1459
|
if (agent.avatar.startsWith('http')) return agent.avatar;
|
|
1406
1460
|
return CL.AUTH_API + '/' + agent.avatar;
|
|
1407
1461
|
}
|
|
1408
|
-
return
|
|
1462
|
+
return './icon.png';
|
|
1409
1463
|
}
|
|
1410
1464
|
|
|
1411
1465
|
const ESC_MAP = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' };
|
|
@@ -1478,17 +1532,23 @@ function AgentCard(agent, opts = {}) {
|
|
|
1478
1532
|
info.appendChild(_text('div', 'agent-card__name', agent.name || ''));
|
|
1479
1533
|
info.appendChild(_text('div', 'agent-card__bio', agent.bio || '暂无简介'));
|
|
1480
1534
|
const stats = _el('div', 'agent-card__stats');
|
|
1481
|
-
|
|
1535
|
+
// 星标 + 数字 紧密组合(Figma gap 1.5px)
|
|
1536
|
+
const statGroup = _el('span', 'agent-card__stat-group');
|
|
1537
|
+
var starIcon = _el('span', 'agent-card__stat-icon');
|
|
1538
|
+
starIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M5.94531 0.525391C6.08953 0.525551 6.20334 0.604267 6.25098 0.701172L7.59668 3.43262L7.71875 3.68066L7.99121 3.7207L11.0859 4.16992V4.1709H11.0869C11.1865 4.18536 11.2656 4.2375 11.3135 4.30371L11.3506 4.37402C11.3752 4.44422 11.3691 4.52183 11.3301 4.58984L11.2803 4.6543L9.01172 6.86914L8.81543 7.06152L8.86133 7.33301L9.3877 10.4043C9.40428 10.501 9.36472 10.6085 9.26172 10.6797C9.20158 10.7197 9.13 10.7412 9.05762 10.7412C9.00017 10.7412 8.94132 10.7275 8.8877 10.7002L6.18945 9.2793L5.94531 9.15039L5.7002 9.2793L3.00684 10.6982C2.95198 10.7266 2.89097 10.7412 2.83203 10.7412C2.77821 10.7412 2.72454 10.7298 2.67578 10.707L2.62891 10.6797C2.52556 10.6083 2.48649 10.5012 2.50293 10.4053V10.4043L3.0293 7.33301L3.0752 7.06152L2.87793 6.86914L0.611328 4.6543L0.610352 4.65332L0.560547 4.58984C0.521516 4.522 0.515166 4.44401 0.540039 4.37305L0.539062 4.37207C0.573747 4.27569 0.671018 4.18999 0.803711 4.1709L0.804688 4.16992L3.89844 3.7207L4.17188 3.68066L4.29395 3.43262L5.63867 0.702148C5.68788 0.603278 5.80274 0.525391 5.94531 0.525391Z" stroke="#666666" stroke-width="1.05"/></svg>';
|
|
1539
|
+
statGroup.appendChild(starIcon);
|
|
1540
|
+
statGroup.appendChild(_text('span', 'agent-card__stat agent-card__stat--claws', formatNumber(agent.claws)));
|
|
1541
|
+
stats.appendChild(statGroup);
|
|
1482
1542
|
if (agent.owner) {
|
|
1483
|
-
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` ·
|
|
1543
|
+
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` · ${agent.owner}`));
|
|
1484
1544
|
}
|
|
1485
1545
|
info.appendChild(stats);
|
|
1486
1546
|
contentGroup.appendChild(info);
|
|
1487
1547
|
|
|
1488
1548
|
row1.appendChild(contentGroup);
|
|
1489
1549
|
|
|
1490
|
-
//
|
|
1491
|
-
const defaultLabel = '
|
|
1550
|
+
// @召唤 按钮
|
|
1551
|
+
const defaultLabel = '@召唤';
|
|
1492
1552
|
const btn = _text('button', 'agent-card__action', actionLabel || defaultLabel);
|
|
1493
1553
|
if (onAction) {
|
|
1494
1554
|
btn.addEventListener('click', (e) => {
|
|
@@ -1524,14 +1584,19 @@ function AgentCard(agent, opts = {}) {
|
|
|
1524
1584
|
body.appendChild(_text('div', 'agent-card__bio', agent.bio || '暂无简介'));
|
|
1525
1585
|
|
|
1526
1586
|
const stats = _el('div', 'agent-card__stats');
|
|
1527
|
-
|
|
1587
|
+
const statGroup = _el('span', 'agent-card__stat-group');
|
|
1588
|
+
var starIcon = _el('span', 'agent-card__stat-icon');
|
|
1589
|
+
starIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M5.94531 0.525391C6.08953 0.525551 6.20334 0.604267 6.25098 0.701172L7.59668 3.43262L7.71875 3.68066L7.99121 3.7207L11.0859 4.16992V4.1709H11.0869C11.1865 4.18536 11.2656 4.2375 11.3135 4.30371L11.3506 4.37402C11.3752 4.44422 11.3691 4.52183 11.3301 4.58984L11.2803 4.6543L9.01172 6.86914L8.81543 7.06152L8.86133 7.33301L9.3877 10.4043C9.40428 10.501 9.36472 10.6085 9.26172 10.6797C9.20158 10.7197 9.13 10.7412 9.05762 10.7412C9.00017 10.7412 8.94132 10.7275 8.8877 10.7002L6.18945 9.2793L5.94531 9.15039L5.7002 9.2793L3.00684 10.6982C2.95198 10.7266 2.89097 10.7412 2.83203 10.7412C2.77821 10.7412 2.72454 10.7298 2.67578 10.707L2.62891 10.6797C2.52556 10.6083 2.48649 10.5012 2.50293 10.4053V10.4043L3.0293 7.33301L3.0752 7.06152L2.87793 6.86914L0.611328 4.6543L0.610352 4.65332L0.560547 4.58984C0.521516 4.522 0.515166 4.44401 0.540039 4.37305L0.539062 4.37207C0.573747 4.27569 0.671018 4.18999 0.803711 4.1709L0.804688 4.16992L3.89844 3.7207L4.17188 3.68066L4.29395 3.43262L5.63867 0.702148C5.68788 0.603278 5.80274 0.525391 5.94531 0.525391Z" stroke="#666666" stroke-width="1.05"/></svg>';
|
|
1590
|
+
statGroup.appendChild(starIcon);
|
|
1591
|
+
statGroup.appendChild(_text('span', 'agent-card__stat agent-card__stat--claws', formatNumber(agent.claws)));
|
|
1592
|
+
stats.appendChild(statGroup);
|
|
1528
1593
|
if (agent.owner) {
|
|
1529
|
-
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` ·
|
|
1594
|
+
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` · ${agent.owner}`));
|
|
1530
1595
|
}
|
|
1531
1596
|
body.appendChild(stats);
|
|
1532
1597
|
card.appendChild(body);
|
|
1533
1598
|
|
|
1534
|
-
const btn = _text('button', 'agent-card__action', actionLabel || '
|
|
1599
|
+
const btn = _text('button', 'agent-card__action', actionLabel || '@召唤');
|
|
1535
1600
|
if (onAction) {
|
|
1536
1601
|
btn.addEventListener('click', (e) => {
|
|
1537
1602
|
e.stopPropagation();
|
|
@@ -1568,14 +1633,19 @@ function AgentCard(agent, opts = {}) {
|
|
|
1568
1633
|
body.appendChild(_text('div', 'agent-card__bio', agent.bio || '暂无简介'));
|
|
1569
1634
|
|
|
1570
1635
|
const stats = _el('div', 'agent-card__stats');
|
|
1571
|
-
|
|
1636
|
+
const statGroup = _el('span', 'agent-card__stat-group');
|
|
1637
|
+
var starIcon = _el('span', 'agent-card__stat-icon');
|
|
1638
|
+
starIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none"><path d="M5.94531 0.525391C6.08953 0.525551 6.20334 0.604267 6.25098 0.701172L7.59668 3.43262L7.71875 3.68066L7.99121 3.7207L11.0859 4.16992V4.1709H11.0869C11.1865 4.18536 11.2656 4.2375 11.3135 4.30371L11.3506 4.37402C11.3752 4.44422 11.3691 4.52183 11.3301 4.58984L11.2803 4.6543L9.01172 6.86914L8.81543 7.06152L8.86133 7.33301L9.3877 10.4043C9.40428 10.501 9.36472 10.6085 9.26172 10.6797C9.20158 10.7197 9.13 10.7412 9.05762 10.7412C9.00017 10.7412 8.94132 10.7275 8.8877 10.7002L6.18945 9.2793L5.94531 9.15039L5.7002 9.2793L3.00684 10.6982C2.95198 10.7266 2.89097 10.7412 2.83203 10.7412C2.77821 10.7412 2.72454 10.7298 2.67578 10.707L2.62891 10.6797C2.52556 10.6083 2.48649 10.5012 2.50293 10.4053V10.4043L3.0293 7.33301L3.0752 7.06152L2.87793 6.86914L0.611328 4.6543L0.610352 4.65332L0.560547 4.58984C0.521516 4.522 0.515166 4.44401 0.540039 4.37305L0.539062 4.37207C0.573747 4.27569 0.671018 4.18999 0.803711 4.1709L0.804688 4.16992L3.89844 3.7207L4.17188 3.68066L4.29395 3.43262L5.63867 0.702148C5.68788 0.603278 5.80274 0.525391 5.94531 0.525391Z" stroke="#666666" stroke-width="1.05"/></svg>';
|
|
1639
|
+
statGroup.appendChild(starIcon);
|
|
1640
|
+
statGroup.appendChild(_text('span', 'agent-card__stat agent-card__stat--claws', formatNumber(agent.claws)));
|
|
1641
|
+
stats.appendChild(statGroup);
|
|
1572
1642
|
if (agent.owner) {
|
|
1573
|
-
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` ·
|
|
1643
|
+
stats.appendChild(_text('span', 'agent-card__stat agent-card__stat--owner', ` · ${agent.owner}`));
|
|
1574
1644
|
}
|
|
1575
1645
|
body.appendChild(stats);
|
|
1576
1646
|
card.appendChild(body);
|
|
1577
1647
|
|
|
1578
|
-
const btn = _text('button', 'agent-card__action', actionLabel || '
|
|
1648
|
+
const btn = _text('button', 'agent-card__action', actionLabel || '@召唤');
|
|
1579
1649
|
if (onAction) {
|
|
1580
1650
|
btn.addEventListener('click', (e) => { e.stopPropagation(); onAction(agent); });
|
|
1581
1651
|
card.addEventListener('click', (e) => { e.stopPropagation(); onAction(agent); });
|
|
@@ -1700,80 +1770,39 @@ function injectStyles() {
|
|
|
1700
1770
|
border-color: #3b82f6;
|
|
1701
1771
|
}
|
|
1702
1772
|
|
|
1703
|
-
/* ── @ Agent Book 按钮(Figma
|
|
1773
|
+
/* ── @ Agent Book 按钮(Figma 129:955 Frame 72552 — 紫色渐变) ── */
|
|
1704
1774
|
.openagent-at-btn {
|
|
1705
1775
|
position: relative;
|
|
1706
|
-
overflow: hidden;
|
|
1776
|
+
overflow: hidden;
|
|
1707
1777
|
display: inline-flex;
|
|
1708
1778
|
align-items: center;
|
|
1709
1779
|
justify-content: center;
|
|
1710
1780
|
gap: 4px;
|
|
1711
|
-
height:
|
|
1712
|
-
padding: 0
|
|
1713
|
-
border-radius:
|
|
1781
|
+
height: 27px;
|
|
1782
|
+
padding: 0 12px;
|
|
1783
|
+
border-radius: 150px;
|
|
1714
1784
|
border: none;
|
|
1715
|
-
background: #
|
|
1716
|
-
box-shadow: inset 0 0 8.5px 0 #96ECFF; /* Figma INNER_SHADOW */
|
|
1785
|
+
background: linear-gradient(90deg, #5c4aff 0%, #8274ff 100%);
|
|
1717
1786
|
color: #fff;
|
|
1718
|
-
font-size:
|
|
1719
|
-
font-weight:
|
|
1787
|
+
font-size: 12px;
|
|
1788
|
+
font-weight: 500;
|
|
1720
1789
|
cursor: pointer;
|
|
1721
1790
|
transition: all 0.2s ease;
|
|
1722
|
-
line-height:
|
|
1791
|
+
line-height: 27px;
|
|
1723
1792
|
margin-left: 6px;
|
|
1724
1793
|
white-space: nowrap;
|
|
1725
1794
|
flex-shrink: 0;
|
|
1726
1795
|
letter-spacing: 0.2px;
|
|
1727
|
-
|
|
1728
|
-
z-index: 1;
|
|
1729
|
-
isolation: isolate;
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
/* Figma 外层 Ellipse 12873:蓝色椭圆,偏左 */
|
|
1733
|
-
.openagent-at-btn::before {
|
|
1734
|
-
content: '';
|
|
1735
|
-
position: absolute;
|
|
1736
|
-
left: -13%;
|
|
1737
|
-
top: -98%;
|
|
1738
|
-
width: 50%;
|
|
1739
|
-
height: 304%;
|
|
1740
|
-
background: #7A94FF;
|
|
1741
|
-
filter: blur(23px); /* Figma LAYER_BLUR: 23.2px */
|
|
1742
|
-
transform: rotate(174deg);
|
|
1743
|
-
z-index: -1;
|
|
1744
|
-
pointer-events: none;
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
/* Figma 外层 Ellipse 12872:黄绿色椭圆,偏右 */
|
|
1748
|
-
.openagent-at-btn::after {
|
|
1749
|
-
content: '';
|
|
1750
|
-
position: absolute;
|
|
1751
|
-
left: 70%;
|
|
1752
|
-
top: -49%;
|
|
1753
|
-
width: 54%;
|
|
1754
|
-
height: 145%;
|
|
1755
|
-
background: #A1FF2E;
|
|
1756
|
-
filter: blur(30.5px); /* Figma LAYER_BLUR: 30.5px */
|
|
1757
|
-
transform: rotate(27deg);
|
|
1758
|
-
z-index: -1;
|
|
1759
|
-
pointer-events: none;
|
|
1760
|
-
}
|
|
1761
|
-
|
|
1762
|
-
/* 确保文字始终在最高层 */
|
|
1763
|
-
.openagent-at-btn .at-sym,
|
|
1764
|
-
.openagent-at-btn span {
|
|
1765
|
-
position: relative;
|
|
1766
|
-
z-index: 2;
|
|
1796
|
+
font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
1767
1797
|
}
|
|
1768
1798
|
|
|
1769
1799
|
.openagent-at-btn:hover {
|
|
1770
|
-
filter: brightness(1.08);
|
|
1771
1800
|
transform: translateY(-1px);
|
|
1772
|
-
box-shadow: inset 0 0
|
|
1801
|
+
box-shadow: inset 0 0 6px 1px rgba(255, 255, 255, 0.65);
|
|
1773
1802
|
}
|
|
1774
1803
|
.openagent-at-btn .at-sym {
|
|
1775
|
-
font-size:
|
|
1776
|
-
font-weight:
|
|
1804
|
+
font-size: 11.6px;
|
|
1805
|
+
font-weight: 500;
|
|
1777
1806
|
color: #fff;
|
|
1778
1807
|
}
|
|
1779
1808
|
|
|
@@ -1796,8 +1825,8 @@ function injectStyles() {
|
|
|
1796
1825
|
position: fixed;
|
|
1797
1826
|
max-height: none;
|
|
1798
1827
|
background: var(--oa-panel-bg, #fff);
|
|
1799
|
-
border:
|
|
1800
|
-
border-radius:
|
|
1828
|
+
border: 0.5px solid #dbdbdb;
|
|
1829
|
+
border-radius: 16px;
|
|
1801
1830
|
box-shadow: 0 -4px 24px var(--oa-shadow-color, rgba(0,0,0,0.08)), 0 2px 8px var(--oa-shadow-color, rgba(0,0,0,0.04));
|
|
1802
1831
|
z-index: 99999;
|
|
1803
1832
|
overflow: hidden;
|
|
@@ -1842,9 +1871,8 @@ function injectStyles() {
|
|
|
1842
1871
|
flex-shrink: 0;
|
|
1843
1872
|
}
|
|
1844
1873
|
.openagent-panel-close {
|
|
1845
|
-
background:
|
|
1874
|
+
background: transparent;
|
|
1846
1875
|
border: none;
|
|
1847
|
-
color: rgba(47, 47, 51, 0.6);
|
|
1848
1876
|
cursor: pointer;
|
|
1849
1877
|
width: 21px;
|
|
1850
1878
|
height: 21px;
|
|
@@ -1860,7 +1888,6 @@ function injectStyles() {
|
|
|
1860
1888
|
}
|
|
1861
1889
|
.openagent-panel-close:hover {
|
|
1862
1890
|
background: #eee;
|
|
1863
|
-
color: rgba(47, 47, 51, 1);
|
|
1864
1891
|
}
|
|
1865
1892
|
|
|
1866
1893
|
/* ── 分隔线(Figma: 0.2px, opacity 0.16) ── */
|
|
@@ -1871,6 +1898,174 @@ function injectStyles() {
|
|
|
1871
1898
|
margin: 0;
|
|
1872
1899
|
}
|
|
1873
1900
|
|
|
1901
|
+
/* ── 提示栏(Figma 141:3293,页面加载即显示) ── */
|
|
1902
|
+
.openagent-hint-bar {
|
|
1903
|
+
display: flex;
|
|
1904
|
+
align-items: center;
|
|
1905
|
+
justify-content: space-between;
|
|
1906
|
+
padding: 12px 12px;
|
|
1907
|
+
margin-bottom: 12px;
|
|
1908
|
+
background: #fff;
|
|
1909
|
+
border: 1.2px solid rgba(47, 47, 51, 0.1);
|
|
1910
|
+
border-radius: var(--radius-lg, 18px);
|
|
1911
|
+
gap: 12px;
|
|
1912
|
+
width: 100%;
|
|
1913
|
+
box-sizing: border-box;
|
|
1914
|
+
margin:0 auto;
|
|
1915
|
+
margin-bottom: 12px;
|
|
1916
|
+
}
|
|
1917
|
+
.openagent-hint-bar__content {
|
|
1918
|
+
display: flex;
|
|
1919
|
+
align-items: center;
|
|
1920
|
+
gap: 9px;
|
|
1921
|
+
flex: 1;
|
|
1922
|
+
min-width: 0;
|
|
1923
|
+
}
|
|
1924
|
+
.openagent-hint-bar__icon {
|
|
1925
|
+
display: flex;
|
|
1926
|
+
align-items: center;
|
|
1927
|
+
justify-content: center;
|
|
1928
|
+
width: 27px;
|
|
1929
|
+
height: 27px;
|
|
1930
|
+
border-radius: 6px;
|
|
1931
|
+
background: linear-gradient(135deg, rgba(130,116,255,0.1) 0%, rgba(56,144,255,0.1) 100%);
|
|
1932
|
+
flex-shrink: 0;
|
|
1933
|
+
}
|
|
1934
|
+
.openagent-hint-bar__text {
|
|
1935
|
+
font-family: "PingFang SC", sans-serif;
|
|
1936
|
+
font-size: 15px;
|
|
1937
|
+
font-weight: 400;
|
|
1938
|
+
color: rgba(51, 51, 51, 0.8);
|
|
1939
|
+
white-space: nowrap;
|
|
1940
|
+
overflow: hidden;
|
|
1941
|
+
text-overflow: ellipsis;
|
|
1942
|
+
}
|
|
1943
|
+
.openagent-hint-bar__close {
|
|
1944
|
+
display: flex;
|
|
1945
|
+
align-items: center;
|
|
1946
|
+
justify-content: center;
|
|
1947
|
+
width: 21px;
|
|
1948
|
+
height: 21px;
|
|
1949
|
+
padding: 0;
|
|
1950
|
+
border: none;
|
|
1951
|
+
background: transparent;
|
|
1952
|
+
cursor: pointer;
|
|
1953
|
+
flex-shrink: 0;
|
|
1954
|
+
border-radius: 4px;
|
|
1955
|
+
transition: all 0.1s;
|
|
1956
|
+
}
|
|
1957
|
+
.openagent-hint-bar__close:hover {
|
|
1958
|
+
background: #eee;
|
|
1959
|
+
}
|
|
1960
|
+
|
|
1961
|
+
/* 暗色主题 */
|
|
1962
|
+
[data-theme-mode="dark"] .openagent-hint-bar,
|
|
1963
|
+
[data-theme="dark"] .openagent-hint-bar {
|
|
1964
|
+
background: #1c1c1c;
|
|
1965
|
+
border-color: rgba(255,255,255,0.1);
|
|
1966
|
+
}
|
|
1967
|
+
[data-theme-mode="dark"] .openagent-hint-bar__text,
|
|
1968
|
+
[data-theme="dark"] .openagent-hint-bar__text {
|
|
1969
|
+
color: rgba(224, 224, 224, 0.8);
|
|
1970
|
+
}
|
|
1971
|
+
[data-theme-mode="dark"] .openagent-hint-bar__close,
|
|
1972
|
+
[data-theme="dark"] .openagent-hint-bar__close {
|
|
1973
|
+
}
|
|
1974
|
+
[data-theme-mode="dark"] .openagent-hint-bar__close:hover,
|
|
1975
|
+
[data-theme="dark"] .openagent-hint-bar__close:hover {
|
|
1976
|
+
background: #333;
|
|
1977
|
+
}
|
|
1978
|
+
|
|
1979
|
+
/* ── 空状态独立浮层(Figma 144:3444) ── */
|
|
1980
|
+
.openagent-empty-toast {
|
|
1981
|
+
display: flex;
|
|
1982
|
+
align-items: center;
|
|
1983
|
+
gap: 9px;
|
|
1984
|
+
padding: 18px;
|
|
1985
|
+
background: #fff;
|
|
1986
|
+
border: 1.2px solid rgba(47, 47, 51, 0.1);
|
|
1987
|
+
border-radius: 18px;
|
|
1988
|
+
box-sizing: border-box;
|
|
1989
|
+
animation: openagent-up 0.25s cubic-bezier(0.16, 1, 0.3, 1);
|
|
1990
|
+
box-shadow: 0 -4px 24px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
|
|
1991
|
+
}
|
|
1992
|
+
[data-theme-mode="dark"] .openagent-empty-toast,
|
|
1993
|
+
[data-theme="dark"] .openagent-empty-toast {
|
|
1994
|
+
background: #1c1c1c; border-color: rgba(255,255,255,0.1);
|
|
1995
|
+
box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
|
|
1996
|
+
}
|
|
1997
|
+
[data-theme-mode="dark"] .openagent-empty-toast .openagent-empty-state__text,
|
|
1998
|
+
[data-theme="dark"] .openagent-empty-toast .openagent-empty-state__text {
|
|
1999
|
+
color: rgba(224, 224, 224, 0.8);
|
|
2000
|
+
}
|
|
2001
|
+
[data-theme-mode="dark"] .openagent-empty-toast .openagent-empty-state__close,
|
|
2002
|
+
[data-theme="dark"] .openagent-empty-toast .openagent-empty-state__close {
|
|
2003
|
+
}
|
|
2004
|
+
|
|
2005
|
+
/* ── 空状态(Figma 144:3444)— 无匹配结果 ── */
|
|
2006
|
+
.openagent-empty-state {
|
|
2007
|
+
padding: 18px;
|
|
2008
|
+
background: #fff;
|
|
2009
|
+
border: 1.2px solid rgba(47, 47, 51, 0.1);
|
|
2010
|
+
border-radius: 18px;
|
|
2011
|
+
}
|
|
2012
|
+
.openagent-empty-state__row {
|
|
2013
|
+
display: flex;
|
|
2014
|
+
align-items: flex-start;
|
|
2015
|
+
justify-content: space-between;
|
|
2016
|
+
gap: 9px;
|
|
2017
|
+
}
|
|
2018
|
+
.openagent-empty-state__icon {
|
|
2019
|
+
display: flex;
|
|
2020
|
+
align-items: center;
|
|
2021
|
+
justify-content: center;
|
|
2022
|
+
width: 27px;
|
|
2023
|
+
height: 27px;
|
|
2024
|
+
border-radius: 6px;
|
|
2025
|
+
background: linear-gradient(135deg, rgba(92,74,255,0.1) 0%, rgba(130,116,255,0.1) 100%);
|
|
2026
|
+
flex-shrink: 0;
|
|
2027
|
+
}
|
|
2028
|
+
.openagent-empty-state__text {
|
|
2029
|
+
flex: 1;
|
|
2030
|
+
font-family: "PingFang SC", sans-serif;
|
|
2031
|
+
font-size: 15px;
|
|
2032
|
+
font-weight: 400;
|
|
2033
|
+
color: rgba(51, 51, 51, 0.8);
|
|
2034
|
+
line-height: 1.5;
|
|
2035
|
+
}
|
|
2036
|
+
.openagent-empty-state__close {
|
|
2037
|
+
display: flex;
|
|
2038
|
+
align-items: center;
|
|
2039
|
+
justify-content: center;
|
|
2040
|
+
width: 21px;
|
|
2041
|
+
height: 21px;
|
|
2042
|
+
padding: 0;
|
|
2043
|
+
border: none;
|
|
2044
|
+
background: transparent;
|
|
2045
|
+
cursor: pointer;
|
|
2046
|
+
flex-shrink: 0;
|
|
2047
|
+
border-radius: 4px;
|
|
2048
|
+
}
|
|
2049
|
+
.openagent-empty-state__close:hover {
|
|
2050
|
+
background: #eee;
|
|
2051
|
+
}
|
|
2052
|
+
[data-theme-mode="dark"] .openagent-empty-state,
|
|
2053
|
+
[data-theme="dark"] .openagent-empty-state {
|
|
2054
|
+
background: #1c1c1c;
|
|
2055
|
+
border-color: rgba(255,255,255,0.1);
|
|
2056
|
+
}
|
|
2057
|
+
[data-theme-mode="dark"] .openagent-empty-state__text,
|
|
2058
|
+
[data-theme="dark"] .openagent-empty-state__text {
|
|
2059
|
+
color: rgba(224, 224, 224, 0.8);
|
|
2060
|
+
}
|
|
2061
|
+
[data-theme-mode="dark"] .openagent-empty-state__close,
|
|
2062
|
+
[data-theme="dark"] .openagent-empty-state__close {
|
|
2063
|
+
}
|
|
2064
|
+
[data-theme-mode="dark"] .openagent-empty-state__close:hover,
|
|
2065
|
+
[data-theme="dark"] .openagent-empty-state__close:hover {
|
|
2066
|
+
background: #333;
|
|
2067
|
+
}
|
|
2068
|
+
|
|
1874
2069
|
/* ── Agent 列表(section stack) ── */
|
|
1875
2070
|
.openagent-agent-list {
|
|
1876
2071
|
overflow-y: auto;
|
|
@@ -1926,9 +2121,9 @@ function injectStyles() {
|
|
|
1926
2121
|
|
|
1927
2122
|
/* ── 分组标题 ── */
|
|
1928
2123
|
.openagent-section-heading {
|
|
1929
|
-
font-size:
|
|
2124
|
+
font-size: 16px;
|
|
1930
2125
|
font-weight: 400;
|
|
1931
|
-
line-height:
|
|
2126
|
+
line-height: 16px;
|
|
1932
2127
|
color: rgba(47, 47, 51, 0.80);
|
|
1933
2128
|
padding: 0 12px 0 12px;
|
|
1934
2129
|
letter-spacing: 0;
|
|
@@ -1999,6 +2194,23 @@ function injectStyles() {
|
|
|
1999
2194
|
gap: 0;
|
|
2000
2195
|
flex-wrap: wrap;
|
|
2001
2196
|
}
|
|
2197
|
+
/* 星标+数字 紧密组合(Figma gap 1.5px) */
|
|
2198
|
+
.agent-card__stat-group {
|
|
2199
|
+
display: flex;
|
|
2200
|
+
align-items: center;
|
|
2201
|
+
gap: 1.5px;
|
|
2202
|
+
}
|
|
2203
|
+
.agent-card__stat-icon {
|
|
2204
|
+
display: inline-flex;
|
|
2205
|
+
align-items: center;
|
|
2206
|
+
justify-content: center;
|
|
2207
|
+
width: 12px;
|
|
2208
|
+
height: 12px;
|
|
2209
|
+
font-size: 14px;
|
|
2210
|
+
line-height: 1;
|
|
2211
|
+
color: #666;
|
|
2212
|
+
flex-shrink: 0;
|
|
2213
|
+
}
|
|
2002
2214
|
.agent-card__stat {
|
|
2003
2215
|
font-family: "PingFang SC", sans-serif;
|
|
2004
2216
|
font-size: 13.5px;
|
|
@@ -2024,96 +2236,80 @@ function injectStyles() {
|
|
|
2024
2236
|
white-space: nowrap;
|
|
2025
2237
|
}
|
|
2026
2238
|
|
|
2027
|
-
/* ── mode: mention(Figma Agent
|
|
2239
|
+
/* ── mode: mention(Figma Agent 卡片 142:3392) ── */
|
|
2028
2240
|
.agent-card--mention {
|
|
2029
2241
|
flex-direction: row;
|
|
2030
|
-
align-items:
|
|
2031
|
-
gap:
|
|
2032
|
-
padding:
|
|
2033
|
-
border-radius:
|
|
2034
|
-
border:
|
|
2035
|
-
background:
|
|
2036
|
-
min-height:
|
|
2242
|
+
align-items: center;
|
|
2243
|
+
gap: 10px;
|
|
2244
|
+
padding: 15px;
|
|
2245
|
+
border-radius: 20px;
|
|
2246
|
+
border: 0.5px solid #dbdbdb;
|
|
2247
|
+
background: #fff;
|
|
2248
|
+
min-height: 0;
|
|
2037
2249
|
min-width: 0;
|
|
2250
|
+
box-sizing: border-box;
|
|
2038
2251
|
}
|
|
2039
2252
|
.agent-card--mention:hover {
|
|
2040
2253
|
background: rgba(0, 0, 0, 0.02);
|
|
2041
2254
|
}
|
|
2042
|
-
/*
|
|
2043
|
-
.agent-card--mention.openagent-card-selected {
|
|
2044
|
-
background: rgba(99, 102, 241, 0.06);
|
|
2045
|
-
outline: 2px solid rgba(99, 102, 241, 0.3);
|
|
2046
|
-
outline-offset: -2px;
|
|
2047
|
-
}
|
|
2048
|
-
[data-theme-mode="dark"] .agent-card--mention.openagent-card-selected {
|
|
2049
|
-
background: rgba(99, 102, 241, 0.12);
|
|
2050
|
-
outline-color: rgba(99, 102, 241, 0.4);
|
|
2051
|
-
}
|
|
2052
|
-
|
|
2053
|
-
/* avart 外壳: Figma px 12, centered */
|
|
2255
|
+
/* avart 外壳简化 — 不再需要 */
|
|
2054
2256
|
.agent-card--mention .agent-card__avart {
|
|
2055
|
-
display:
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
gap: 0;
|
|
2059
|
-
padding: 0 10px;
|
|
2060
|
-
flex: 1;
|
|
2257
|
+
display: contents;
|
|
2258
|
+
padding: 0;
|
|
2259
|
+
flex: none;
|
|
2061
2260
|
min-width: 0;
|
|
2062
|
-
box-sizing: border-box;
|
|
2063
2261
|
}
|
|
2064
2262
|
|
|
2065
|
-
/* 第一行:
|
|
2263
|
+
/* 第一行: 内容区 + 按钮 */
|
|
2066
2264
|
.agent-card--mention .agent-card__row1 {
|
|
2067
|
-
display:
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
gap: 16px;
|
|
2071
|
-
width: 100%;
|
|
2265
|
+
display: contents;
|
|
2266
|
+
gap: 0;
|
|
2267
|
+
width: auto;
|
|
2072
2268
|
min-width: 0;
|
|
2073
2269
|
}
|
|
2074
2270
|
|
|
2075
|
-
/* 内容组:
|
|
2271
|
+
/* 内容组: 头像 + 信息列 */
|
|
2076
2272
|
.agent-card--mention .agent-card__content-group {
|
|
2077
2273
|
display: flex;
|
|
2078
2274
|
flex-direction: row;
|
|
2079
|
-
align-items:
|
|
2080
|
-
gap:
|
|
2275
|
+
align-items: center;
|
|
2276
|
+
gap: 10px;
|
|
2081
2277
|
flex: 1;
|
|
2082
2278
|
min-width: 0;
|
|
2083
2279
|
}
|
|
2084
2280
|
|
|
2085
|
-
/*
|
|
2281
|
+
/* 头像: 50×50 */
|
|
2086
2282
|
.agent-card--mention .agent-card__avatar {
|
|
2087
|
-
width:
|
|
2088
|
-
height:
|
|
2283
|
+
width: 50px;
|
|
2284
|
+
height: 50px;
|
|
2089
2285
|
border-radius: 50%;
|
|
2090
2286
|
border: none;
|
|
2091
2287
|
flex-shrink: 0;
|
|
2092
2288
|
margin-top: 0;
|
|
2093
2289
|
}
|
|
2094
2290
|
|
|
2095
|
-
/*
|
|
2291
|
+
/* 信息列 */
|
|
2096
2292
|
.agent-card--mention .agent-card__info {
|
|
2097
2293
|
display: flex;
|
|
2098
2294
|
flex-direction: column;
|
|
2099
|
-
gap:
|
|
2100
|
-
padding:
|
|
2295
|
+
gap: 6px;
|
|
2296
|
+
padding: 0;
|
|
2101
2297
|
flex: 1;
|
|
2102
2298
|
min-width: 0;
|
|
2103
2299
|
}
|
|
2104
2300
|
|
|
2105
2301
|
.agent-card--mention .agent-card__name {
|
|
2106
|
-
font-size:
|
|
2302
|
+
font-size: 15px;
|
|
2107
2303
|
font-weight: 600;
|
|
2108
|
-
line-height:
|
|
2109
|
-
color:
|
|
2304
|
+
line-height: 1;
|
|
2305
|
+
color: #333;
|
|
2306
|
+
width:200px;
|
|
2110
2307
|
}
|
|
2111
2308
|
.agent-card--mention .agent-card__bio {
|
|
2112
|
-
font-size:
|
|
2309
|
+
font-size: 14px;
|
|
2113
2310
|
font-weight: 400;
|
|
2114
|
-
line-height:
|
|
2115
|
-
color: rgba(47, 47, 51, 0.
|
|
2116
|
-
text-align: justify;
|
|
2311
|
+
line-height: 1.5;
|
|
2312
|
+
color: rgba(47, 47, 51, 0.80);
|
|
2117
2313
|
overflow: hidden;
|
|
2118
2314
|
text-overflow: ellipsis;
|
|
2119
2315
|
display: -webkit-box;
|
|
@@ -2122,37 +2318,31 @@ function injectStyles() {
|
|
|
2122
2318
|
margin-top: 0;
|
|
2123
2319
|
}
|
|
2124
2320
|
|
|
2125
|
-
/*
|
|
2321
|
+
/* @召唤 按钮 */
|
|
2126
2322
|
.agent-card--mention .agent-card__action {
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
color: rgba(47, 47, 51, 1);
|
|
2323
|
+
height: 36px;
|
|
2324
|
+
padding: 0 18px;
|
|
2325
|
+
border-radius: 23px;
|
|
2326
|
+
background: transparent;
|
|
2327
|
+
border: 0.5px solid #dbdbdb;
|
|
2328
|
+
color: #333;
|
|
2134
2329
|
font-family: "PingFang SC", sans-serif;
|
|
2135
|
-
font-size:
|
|
2330
|
+
font-size: 16px;
|
|
2136
2331
|
font-weight: 500;
|
|
2137
|
-
line-height:
|
|
2332
|
+
line-height: 15.43px;
|
|
2138
2333
|
text-transform: capitalize;
|
|
2139
2334
|
flex-shrink: 0;
|
|
2140
2335
|
display: inline-flex;
|
|
2141
2336
|
align-items: center;
|
|
2142
2337
|
justify-content: center;
|
|
2338
|
+
width: auto;
|
|
2143
2339
|
}
|
|
2144
|
-
.agent-card--mention .agent-card__action::before { content:
|
|
2340
|
+
.agent-card--mention .agent-card__action::before { content: none; }
|
|
2145
2341
|
.agent-card--mention .agent-card__action:hover {
|
|
2146
|
-
background:
|
|
2342
|
+
background: rgba(0, 0, 0, 0.04);
|
|
2147
2343
|
}
|
|
2148
2344
|
|
|
2149
|
-
/*
|
|
2150
|
-
.agent-card--mention .agent-card__row2 {
|
|
2151
|
-
display: none;
|
|
2152
|
-
flex-direction: row;
|
|
2153
|
-
align-items: center;
|
|
2154
|
-
padding-left: 60px;
|
|
2155
|
-
}
|
|
2345
|
+
/* 统计行 */
|
|
2156
2346
|
.agent-card--mention .agent-card__stats {
|
|
2157
2347
|
display: flex;
|
|
2158
2348
|
align-items: center;
|
|
@@ -2160,16 +2350,21 @@ function injectStyles() {
|
|
|
2160
2350
|
margin-top: 0;
|
|
2161
2351
|
}
|
|
2162
2352
|
.agent-card--mention .agent-card__stat--claws {
|
|
2163
|
-
color:
|
|
2164
|
-
font-size:
|
|
2165
|
-
line-height:
|
|
2166
|
-
letter-spacing:
|
|
2353
|
+
color: #666;
|
|
2354
|
+
font-size: 14px;
|
|
2355
|
+
line-height: 1;
|
|
2356
|
+
letter-spacing: 1.5px;
|
|
2167
2357
|
}
|
|
2168
2358
|
.agent-card--mention .agent-card__stat--owner {
|
|
2169
|
-
color:
|
|
2170
|
-
font-size:
|
|
2171
|
-
line-height:
|
|
2172
|
-
letter-spacing:
|
|
2359
|
+
color: #666;
|
|
2360
|
+
font-size: 14px;
|
|
2361
|
+
line-height: 1;
|
|
2362
|
+
letter-spacing: 1.5px;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
/* row2 (legacy compat) */
|
|
2366
|
+
.agent-card--mention .agent-card__row2 {
|
|
2367
|
+
display: none;
|
|
2173
2368
|
}
|
|
2174
2369
|
|
|
2175
2370
|
/* ── mode: search(有输入搜索结果,沿用旧式单列行) ── */
|
|
@@ -2179,18 +2374,14 @@ function injectStyles() {
|
|
|
2179
2374
|
width: 100%;
|
|
2180
2375
|
min-height: 64px;
|
|
2181
2376
|
padding: 10px 12px;
|
|
2182
|
-
border-radius:
|
|
2377
|
+
border-radius: 20px;
|
|
2183
2378
|
background: transparent;
|
|
2379
|
+
border: 0.5px solid transparent;
|
|
2184
2380
|
box-sizing: border-box;
|
|
2185
2381
|
}
|
|
2186
2382
|
.agent-card--search:hover {
|
|
2187
2383
|
background: rgba(0, 0, 0, 0.02);
|
|
2188
2384
|
}
|
|
2189
|
-
.agent-card--search.openagent-card-selected {
|
|
2190
|
-
background: rgba(99, 102, 241, 0.06);
|
|
2191
|
-
outline: 2px solid rgba(99, 102, 241, 0.3);
|
|
2192
|
-
outline-offset: -2px;
|
|
2193
|
-
}
|
|
2194
2385
|
.agent-card--search .agent-card__avatar {
|
|
2195
2386
|
width: 40px;
|
|
2196
2387
|
height: 40px;
|
|
@@ -2204,48 +2395,50 @@ function injectStyles() {
|
|
|
2204
2395
|
min-width: 0;
|
|
2205
2396
|
}
|
|
2206
2397
|
.agent-card--search .agent-card__name {
|
|
2207
|
-
font-size:
|
|
2398
|
+
font-size: 15px;
|
|
2208
2399
|
line-height: 16px;
|
|
2209
2400
|
font-weight: 600;
|
|
2210
|
-
color:
|
|
2401
|
+
color: #333;
|
|
2211
2402
|
}
|
|
2212
2403
|
.agent-card--search .agent-card__bio {
|
|
2213
|
-
font-size:
|
|
2214
|
-
line-height:
|
|
2215
|
-
color: rgba(47, 47, 51, 0.
|
|
2404
|
+
font-size: 14px;
|
|
2405
|
+
line-height: 1.5;
|
|
2406
|
+
color: rgba(47, 47, 51, 0.80);
|
|
2216
2407
|
-webkit-line-clamp: 1;
|
|
2217
2408
|
}
|
|
2218
2409
|
.agent-card--search .agent-card__stats {
|
|
2219
2410
|
margin-top: 0;
|
|
2220
2411
|
}
|
|
2221
2412
|
.agent-card--search .agent-card__stat--claws {
|
|
2222
|
-
font-size:
|
|
2223
|
-
line-height:
|
|
2224
|
-
color:
|
|
2413
|
+
font-size: 14px;
|
|
2414
|
+
line-height: 1;
|
|
2415
|
+
color: #666;
|
|
2416
|
+
letter-spacing: 1.5px;
|
|
2225
2417
|
}
|
|
2226
2418
|
.agent-card--search .agent-card__stat--owner {
|
|
2227
|
-
font-size:
|
|
2228
|
-
line-height:
|
|
2229
|
-
color:
|
|
2419
|
+
font-size: 14px;
|
|
2420
|
+
line-height: 1;
|
|
2421
|
+
color: #666;
|
|
2422
|
+
letter-spacing: 1.5px;
|
|
2230
2423
|
}
|
|
2231
2424
|
.agent-card--search .agent-card__action {
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
color: rgba(47, 47, 51, 1);
|
|
2425
|
+
height: 36px;
|
|
2426
|
+
padding: 0 18px;
|
|
2427
|
+
border-radius: 23px;
|
|
2428
|
+
background: transparent;
|
|
2429
|
+
border: 0.5px solid #dbdbdb;
|
|
2430
|
+
color: #333;
|
|
2239
2431
|
font-family: "PingFang SC", sans-serif;
|
|
2240
|
-
font-size:
|
|
2241
|
-
|
|
2432
|
+
font-size: 16px;
|
|
2433
|
+
font-weight: 500;
|
|
2434
|
+
line-height: 15.43px;
|
|
2242
2435
|
display: inline-flex;
|
|
2243
2436
|
align-items: center;
|
|
2244
2437
|
justify-content: center;
|
|
2245
2438
|
}
|
|
2246
|
-
.agent-card--search .agent-card__action::before { content:
|
|
2439
|
+
.agent-card--search .agent-card__action::before { content: none; }
|
|
2247
2440
|
.agent-card--search .agent-card__action:hover {
|
|
2248
|
-
background:
|
|
2441
|
+
background: rgba(0, 0, 0, 0.04);
|
|
2249
2442
|
}
|
|
2250
2443
|
|
|
2251
2444
|
@media (max-width: 980px) {
|
|
@@ -2313,9 +2506,9 @@ function injectStyles() {
|
|
|
2313
2506
|
[data-theme-mode="dark"] .openagent-panel-title,
|
|
2314
2507
|
[data-theme="dark"] .openagent-panel-title { color: rgba(224, 224, 224, 0.8); }
|
|
2315
2508
|
[data-theme-mode="dark"] .openagent-panel-close,
|
|
2316
|
-
[data-theme="dark"] .openagent-panel-close { background: #2a2a2a;
|
|
2509
|
+
[data-theme="dark"] .openagent-panel-close { background: #2a2a2a; }
|
|
2317
2510
|
[data-theme-mode="dark"] .openagent-panel-close:hover,
|
|
2318
|
-
[data-theme="dark"] .openagent-panel-close:hover { background: #333;
|
|
2511
|
+
[data-theme="dark"] .openagent-panel-close:hover { background: #333; }
|
|
2319
2512
|
[data-theme-mode="dark"] .openagent-section-heading,
|
|
2320
2513
|
[data-theme="dark"] .openagent-section-heading { color: rgba(224, 224, 224, 0.45); }
|
|
2321
2514
|
[data-theme-mode="dark"] .openagent-parent-heading,
|
|
@@ -2331,28 +2524,39 @@ function injectStyles() {
|
|
|
2331
2524
|
[data-theme="dark"] .agent-card__stat { color: #64748b; }
|
|
2332
2525
|
|
|
2333
2526
|
[data-theme-mode="dark"] .agent-card--mention,
|
|
2334
|
-
[data-theme="dark"] .agent-card--mention { background:
|
|
2527
|
+
[data-theme="dark"] .agent-card--mention { background: #1c1c1c; border-color: rgba(255,255,255,0.12); }
|
|
2335
2528
|
[data-theme-mode="dark"] .agent-card--mention:hover,
|
|
2336
2529
|
[data-theme="dark"] .agent-card--mention:hover { background: #252525; }
|
|
2530
|
+
[data-theme-mode="dark"] .agent-card--mention .agent-card__name,
|
|
2531
|
+
[data-theme="dark"] .agent-card--mention .agent-card__name { color: #e0e0e0; }
|
|
2532
|
+
[data-theme-mode="dark"] .agent-card--mention .agent-card__bio,
|
|
2533
|
+
[data-theme="dark"] .agent-card--mention .agent-card__bio { color: rgba(224,224,224,0.7); }
|
|
2534
|
+
[data-theme-mode="dark"] .agent-card--mention .agent-card__stat--claws,
|
|
2535
|
+
[data-theme="dark"] .agent-card--mention .agent-card__stat--claws { color: #aaa; }
|
|
2536
|
+
[data-theme-mode="dark"] .agent-card--mention .agent-card__stat--owner,
|
|
2537
|
+
[data-theme="dark"] .agent-card--mention .agent-card__stat--owner { color: #aaa; }
|
|
2337
2538
|
[data-theme-mode="dark"] .agent-card--mention .agent-card__action,
|
|
2338
2539
|
[data-theme="dark"] .agent-card--mention .agent-card__action {
|
|
2339
|
-
background:
|
|
2540
|
+
background: transparent; border-color: rgba(255,255,255,0.2); color: #ddd;
|
|
2340
2541
|
}
|
|
2341
2542
|
[data-theme-mode="dark"] .agent-card--mention .agent-card__action:hover,
|
|
2342
|
-
[data-theme="dark"] .agent-card--mention .agent-card__action:hover { background:
|
|
2543
|
+
[data-theme="dark"] .agent-card--mention .agent-card__action:hover { background: rgba(255,255,255,0.06); }
|
|
2343
2544
|
[data-theme-mode="dark"] .agent-card--search:hover,
|
|
2344
2545
|
[data-theme="dark"] .agent-card--search:hover { background: #252525; }
|
|
2345
|
-
[data-theme-mode="dark"] .agent-card--search.
|
|
2346
|
-
[data-theme="dark"] .agent-card--search.
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2546
|
+
[data-theme-mode="dark"] .agent-card--search .agent-card__name,
|
|
2547
|
+
[data-theme="dark"] .agent-card--search .agent-card__name { color: #e0e0e0; }
|
|
2548
|
+
[data-theme-mode="dark"] .agent-card--search .agent-card__bio,
|
|
2549
|
+
[data-theme="dark"] .agent-card--search .agent-card__bio { color: rgba(224, 224, 224, 0.65); }
|
|
2550
|
+
[data-theme-mode="dark"] .agent-card--search .agent-card__stat--claws,
|
|
2551
|
+
[data-theme="dark"] .agent-card--search .agent-card__stat--claws { color: #aaa; }
|
|
2552
|
+
[data-theme-mode="dark"] .agent-card--search .agent-card__stat--owner,
|
|
2553
|
+
[data-theme="dark"] .agent-card--search .agent-card__stat--owner { color: #aaa; }
|
|
2350
2554
|
[data-theme-mode="dark"] .agent-card--search .agent-card__action,
|
|
2351
2555
|
[data-theme="dark"] .agent-card--search .agent-card__action {
|
|
2352
|
-
background:
|
|
2556
|
+
background: transparent; border-color: rgba(255,255,255,0.2); color: #ddd;
|
|
2353
2557
|
}
|
|
2354
2558
|
[data-theme-mode="dark"] .agent-card--search .agent-card__action:hover,
|
|
2355
|
-
[data-theme="dark"] .agent-card--search .agent-card__action:hover { background:
|
|
2559
|
+
[data-theme="dark"] .agent-card--search .agent-card__action:hover { background: rgba(255,255,255,0.06); }
|
|
2356
2560
|
|
|
2357
2561
|
|
|
2358
2562
|
[data-theme-mode="dark"] .agent-card--inline,
|
|
@@ -2370,7 +2574,8 @@ function injectStyles() {
|
|
|
2370
2574
|
[data-theme="dark"] .agent-card__loading {
|
|
2371
2575
|
background: #1e1b3a; border-color: #2d2b55; color: #64748b;
|
|
2372
2576
|
}
|
|
2373
|
-
|
|
2577
|
+
|
|
2578
|
+
`;
|
|
2374
2579
|
document.head.appendChild(style);
|
|
2375
2580
|
}
|
|
2376
2581
|
|
|
@@ -2636,9 +2841,9 @@ panel.innerHTML = `
|
|
|
2636
2841
|
<path d="M39 31H42C44.2091 31 46 29.2091 46 27V17C46 14.7909 44.2091 13 42 13H24C21.7909 13 20 14.7909 20 17V27C20 29.2091 21.7909 31 24 31H30.0652C30.236 31 30.3282 31.2004 30.217 31.3302L27.5 34.5" stroke="#12CCF6" stroke-width="3.3" stroke-linecap="round"/>
|
|
2637
2842
|
<path d="M27 25.5L32.5 21" stroke="#12CCF6" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/>
|
|
2638
2843
|
</svg>
|
|
2639
|
-
<span class="panel-title-text">
|
|
2844
|
+
<span class="panel-title-text">OpenAgent</span>
|
|
2640
2845
|
</span>
|
|
2641
|
-
<button class="openagent-panel-close"
|
|
2846
|
+
<button class="openagent-panel-close"><svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21" fill="none"><path d="M5.625 5.625L15.375 15.375" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.375 5.625L5.625 15.375" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
|
|
2642
2847
|
</div>
|
|
2643
2848
|
<hr class="openagent-panel-divider" />
|
|
2644
2849
|
<div class="openagent-agent-list">
|
|
@@ -2651,6 +2856,15 @@ panel.querySelector('.openagent-panel-close').addEventListener('click', () => {
|
|
|
2651
2856
|
closePanel();
|
|
2652
2857
|
});
|
|
2653
2858
|
|
|
2859
|
+
|
|
2860
|
+
// 提示栏关闭按钮
|
|
2861
|
+
const hintClose = panel.querySelector('.openagent-hint-bar__close');
|
|
2862
|
+
if (hintClose) {
|
|
2863
|
+
hintClose.addEventListener('click', () => {
|
|
2864
|
+
const hintBar = panel.querySelector('.openagent-hint-bar');
|
|
2865
|
+
if (hintBar) hintBar.style.display = 'none';
|
|
2866
|
+
});
|
|
2867
|
+
}
|
|
2654
2868
|
// 挂到 body(与 backdrop 同级,z-index 自然生效)
|
|
2655
2869
|
document.body.appendChild(panel);
|
|
2656
2870
|
return panel;
|
|
@@ -2689,6 +2903,12 @@ return textarea.value.replace(/@/g, ' ').replace(/\s+/g, ' ').trim();
|
|
|
2689
2903
|
}
|
|
2690
2904
|
|
|
2691
2905
|
function openPanel(textarea) {
|
|
2906
|
+
// 清除上次的空状态弹窗
|
|
2907
|
+
var oldToast = document.querySelector('.openagent-empty-toast');
|
|
2908
|
+
if (oldToast) oldToast.remove();
|
|
2909
|
+
var oldEmpty = document.querySelector('.openagent-empty-state');
|
|
2910
|
+
if (oldEmpty) oldEmpty.remove();
|
|
2911
|
+
|
|
2692
2912
|
const p = ensurePanel();
|
|
2693
2913
|
_positionPanel(); // 动态定位到 input 上方
|
|
2694
2914
|
p.classList.add('visible');
|
|
@@ -2872,14 +3092,82 @@ function _appendSearchResults(container, agents, textarea, renderedAgents) {
|
|
|
2872
3092
|
container.appendChild(list);
|
|
2873
3093
|
}
|
|
2874
3094
|
|
|
3095
|
+
/**
|
|
3096
|
+
* 空状态组件(Figma 144:3444)— 未匹配到 Agent 时显示
|
|
3097
|
+
*/
|
|
3098
|
+
/** 关闭已有空状态浮层 */
|
|
3099
|
+
function _dismissEmptyToast() {
|
|
3100
|
+
var existing = document.querySelector('.openagent-empty-toast');
|
|
3101
|
+
if (existing) existing.remove();
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
/** 独立浮层空状态(不在面板内) */
|
|
3105
|
+
function _showEmptyToast(query) {
|
|
3106
|
+
_dismissEmptyToast();
|
|
3107
|
+
var toast = _el('div', 'openagent-empty-toast');
|
|
3108
|
+
|
|
3109
|
+
var iconWrap = _el('div', 'openagent-empty-state__icon');
|
|
3110
|
+
iconWrap.innerHTML = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none">' +
|
|
3111
|
+
'<path d="M7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 8.69527 11.7389 10.2145 10.5237 11.2559L13.0303 13.7626C13.3232 14.0555 13.3232 14.5303 13.0303 14.8232C12.7374 15.1161 12.2626 15.1161 11.9697 14.8232L9.38402 12.2376C8.53401 12.7803 7.49507 13.1079 6.37793 13.1079L7 12.5C6.99363 12.5008 6.98726 12.5012 6.98089 12.5012C3.9368 12.5307 1.46927 10.0632 1.49878 7.01908C1.52829 3.97499 3.99398 1.50537 7.03789 1.5H7ZM7 3C4.79086 3 3 4.79086 3 7C3 9.20914 4.79086 11 7 11C9.20914 11 11 9.20914 11 7C11 4.79086 9.20914 3 7 3Z" fill="#8274ff" fill-opacity="0.6"/>' +
|
|
3112
|
+
'</svg>';
|
|
3113
|
+
toast.appendChild(iconWrap);
|
|
3114
|
+
|
|
3115
|
+
toast.appendChild(_text('span', 'openagent-empty-state__text',
|
|
3116
|
+
query ? '暂未匹配到您想要的Agent 我们将持续上新~' : '暂无在线 Agent,请输入关键词搜索'));
|
|
3117
|
+
|
|
3118
|
+
var closeBtn = _el('button', 'openagent-empty-state__close');
|
|
3119
|
+
closeBtn.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none">' +
|
|
3120
|
+
'<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>' +
|
|
3121
|
+
'</svg>';
|
|
3122
|
+
closeBtn.addEventListener('click', function() { toast.remove(); });
|
|
3123
|
+
toast.appendChild(closeBtn);
|
|
3124
|
+
|
|
3125
|
+
// 定位到输入框上方
|
|
3126
|
+
if (inputWrapperRef) {
|
|
3127
|
+
var rect = inputWrapperRef.getBoundingClientRect();
|
|
3128
|
+
toast.style.position = 'fixed';
|
|
3129
|
+
toast.style.left = Math.max(16, rect.left) + 'px';
|
|
3130
|
+
toast.style.width = Math.min(rect.width, window.innerWidth - 32) + 'px';
|
|
3131
|
+
toast.style.bottom = (window.innerHeight - rect.top + 8) + 'px';
|
|
3132
|
+
toast.style.zIndex = '100000';
|
|
3133
|
+
}
|
|
3134
|
+
document.body.appendChild(toast);
|
|
3135
|
+
}
|
|
3136
|
+
|
|
3137
|
+
function _createEmptyState(query) {
|
|
3138
|
+
var wrapper = _el('div', 'openagent-empty-state');
|
|
3139
|
+
var row = _el('div', 'openagent-empty-state__row');
|
|
3140
|
+
|
|
3141
|
+
var iconWrap = _el('div', 'openagent-empty-state__icon');
|
|
3142
|
+
iconWrap.innerHTML = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none">' +
|
|
3143
|
+
'<path d="M7 1.5C10.0376 1.5 12.5 3.96243 12.5 7C12.5 8.69527 11.7389 10.2145 10.5237 11.2559L13.0303 13.7626C13.3232 14.0555 13.3232 14.5303 13.0303 14.8232C12.7374 15.1161 12.2626 15.1161 11.9697 14.8232L9.38402 12.2376C8.53401 12.7803 7.49507 13.1079 6.37793 13.1079L7 12.5C6.99363 12.5008 6.98726 12.5012 6.98089 12.5012C3.9368 12.5307 1.46927 10.0632 1.49878 7.01908C1.52829 3.97499 3.99398 1.50537 7.03789 1.5H7ZM7 3C4.79086 3 3 4.79086 3 7C3 9.20914 4.79086 11 7 11C9.20914 11 11 9.20914 11 7C11 4.79086 9.20914 3 7 3Z" fill="#8274ff" fill-opacity="0.6"/>' +
|
|
3144
|
+
'</svg>';
|
|
3145
|
+
row.appendChild(iconWrap);
|
|
3146
|
+
|
|
3147
|
+
var text = _text('span', 'openagent-empty-state__text',
|
|
3148
|
+
query ? '暂未匹配到您想要的Agent 我们将持续上新~' : '暂无在线 Agent,请输入关键词搜索');
|
|
3149
|
+
row.appendChild(text);
|
|
3150
|
+
|
|
3151
|
+
var closeBtn = _el('button', 'openagent-empty-state__close');
|
|
3152
|
+
closeBtn.innerHTML = '<svg width="12" height="12" viewBox="0 0 12 12" fill="none">' +
|
|
3153
|
+
'<path d="M1 1L11 11M11 1L1 11" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/>' +
|
|
3154
|
+
'</svg>';
|
|
3155
|
+
closeBtn.addEventListener('click', function() {
|
|
3156
|
+
wrapper.style.display = 'none';
|
|
3157
|
+
});
|
|
3158
|
+
row.appendChild(closeBtn);
|
|
3159
|
+
|
|
3160
|
+
wrapper.appendChild(row);
|
|
3161
|
+
return wrapper;
|
|
3162
|
+
}
|
|
3163
|
+
|
|
2875
3164
|
function renderAgentList(container, agents, textarea, query) {
|
|
2876
|
-
if (!agents.length) {
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
return;
|
|
3165
|
+
if (!agents.length) {
|
|
3166
|
+
_currentAgents = [];
|
|
3167
|
+
_currentTextarea = textarea;
|
|
3168
|
+
closePanel();
|
|
3169
|
+
_showEmptyToast(query);
|
|
3170
|
+
return;
|
|
2883
3171
|
}
|
|
2884
3172
|
|
|
2885
3173
|
console.log('[openagent] renderAgentList:', agents.length, 'agents, textarea:', !!textarea);
|
|
@@ -3213,6 +3501,8 @@ function tryInject() {
|
|
|
3213
3501
|
const pos = ta.selectionStart;
|
|
3214
3502
|
// 如果光标前已经是 @,不重复插入
|
|
3215
3503
|
if (pos > 0 && val[pos - 1] === '@') {
|
|
3504
|
+
// 按钮主动触发 → 清除 dismissed 状态,确保弹窗能打开
|
|
3505
|
+
if (typeof resetMention === 'function') resetMention();
|
|
3216
3506
|
_handleStateChange(ta);
|
|
3217
3507
|
return;
|
|
3218
3508
|
}
|
|
@@ -3271,9 +3561,53 @@ function tryInject() {
|
|
|
3271
3561
|
|
|
3272
3562
|
console.log('[openagent] ✅ Agent Book UI injected (v3 hook-driven)');
|
|
3273
3563
|
|
|
3564
|
+
// ── 提示栏(Figma 141:3293):页面加载即显示 ──
|
|
3565
|
+
_injectHintBar(inputContainer || textarea.parentElement);
|
|
3566
|
+
|
|
3274
3567
|
return true;
|
|
3275
3568
|
}
|
|
3276
3569
|
|
|
3570
|
+
/** 注入提示栏到输入区域上方 */
|
|
3571
|
+
function _injectHintBar(anchorEl) {
|
|
3572
|
+
if (!anchorEl || document.querySelector('.openagent-hint-bar')) return;
|
|
3573
|
+
|
|
3574
|
+
const hintBar = document.createElement('div');
|
|
3575
|
+
hintBar.className = 'openagent-hint-bar';
|
|
3576
|
+
hintBar.innerHTML = '' +
|
|
3577
|
+
'<div class="openagent-hint-bar__content">' +
|
|
3578
|
+
'<div class="openagent-hint-bar__icon">' +
|
|
3579
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="27" height="27" viewBox="0 0 27 27" fill="none">' +
|
|
3580
|
+
'<rect width="27" height="27" rx="6" fill="url(#paint0_linear_141_3277)" fill-opacity="0.1"/>' +
|
|
3581
|
+
'<path d="M13.5 6.75098C16.8137 6.75098 19.5 9.43727 19.5 12.751C19.5 14.3288 18.8894 15.7629 17.8936 16.834L20.7803 19.7207C21.0732 20.0136 21.0732 20.4884 20.7803 20.7812C20.4874 21.0741 20.0126 21.0741 19.7197 20.7812L16.7383 17.7998C15.8038 18.4004 14.6933 18.751 13.5 18.751C10.1863 18.751 7.5 16.0647 7.5 12.751C7.5 9.43727 10.1863 6.75098 13.5 6.75098ZM13.5 8.25098C11.0147 8.25098 9 10.2657 9 12.751C9 15.2363 11.0147 17.251 13.5 17.251C15.9853 17.251 18 15.2363 18 12.751C18 10.2657 15.9853 8.25098 13.5 8.25098Z" fill="url(#paint1_linear_141_3277)"/>' +
|
|
3582
|
+
'<defs>' +
|
|
3583
|
+
'<linearGradient id="paint0_linear_141_3277" x1="0" y1="13.5" x2="27" y2="13.5" gradientUnits="userSpaceOnUse">' +
|
|
3584
|
+
'<stop stop-color="#8274FF"/>' +
|
|
3585
|
+
'<stop offset="1" stop-color="#3890FF"/>' +
|
|
3586
|
+
'</linearGradient>' +
|
|
3587
|
+
'<linearGradient id="paint1_linear_141_3277" x1="7.5" y1="13.8759" x2="20.9999" y2="13.8759" gradientUnits="userSpaceOnUse">' +
|
|
3588
|
+
'<stop stop-color="#8274FF"/>' +
|
|
3589
|
+
'<stop offset="1" stop-color="#3890FF"/>' +
|
|
3590
|
+
'</linearGradient>' +
|
|
3591
|
+
'</defs>' +
|
|
3592
|
+
'</svg>' +
|
|
3593
|
+
'</div>' +
|
|
3594
|
+
'<span class="openagent-hint-bar__text">输入你的需求,调配远端Agent为你解决</span>' +
|
|
3595
|
+
'</div>' +
|
|
3596
|
+
'<button class="openagent-hint-bar__close">' +
|
|
3597
|
+
'<svg xmlns="http://www.w3.org/2000/svg" width="21" height="21" viewBox="0 0 21 21" fill="none">' +
|
|
3598
|
+
'<path d="M5.625 5.625L15.375 15.375" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>' +
|
|
3599
|
+
'<path d="M15.375 5.625L5.625 15.375" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>' +
|
|
3600
|
+
'</svg>' +
|
|
3601
|
+
'</button>';
|
|
3602
|
+
|
|
3603
|
+
hintBar.querySelector('.openagent-hint-bar__close').addEventListener('click', () => {
|
|
3604
|
+
hintBar.style.display = 'none';
|
|
3605
|
+
});
|
|
3606
|
+
|
|
3607
|
+
// 插入到 wrapper 外面、上方
|
|
3608
|
+
anchorEl.parentElement.insertBefore(hintBar, anchorEl);
|
|
3609
|
+
}
|
|
3610
|
+
|
|
3277
3611
|
// ════════════════════════════════════════════════════════════════
|
|
3278
3612
|
// ── window.__clMention — OC 注入钩子的桥接对象 ──
|
|
3279
3613
|
// ════════════════════════════════════════════════════════════════
|
|
@@ -5731,7 +6065,8 @@ function _clScan() {
|
|
|
5731
6065
|
// 注意:不使用 .chat-tool-card 类名,避免 scanner.js 误匹配。
|
|
5732
6066
|
|
|
5733
6067
|
(function _clInjectRemoteAgentStyles() {
|
|
5734
|
-
|
|
6068
|
+
var oldStyle = document.getElementById('cl-remote-agent-styles');
|
|
6069
|
+
if (oldStyle) oldStyle.remove();
|
|
5735
6070
|
var style = document.createElement('style');
|
|
5736
6071
|
style.id = 'cl-remote-agent-styles';
|
|
5737
6072
|
style.textContent = [
|
|
@@ -5794,7 +6129,20 @@ function _clScan() {
|
|
|
5794
6129
|
' border: 0 !important;',
|
|
5795
6130
|
' background: transparent !important;',
|
|
5796
6131
|
' box-shadow: none !important;',
|
|
5797
|
-
' padding
|
|
6132
|
+
' padding: 10px 0 !important;',
|
|
6133
|
+
' width: 100%;',
|
|
6134
|
+
' max-width: 100% !important;',
|
|
6135
|
+
' overflow: hidden !important;',
|
|
6136
|
+
'}',
|
|
6137
|
+
'.chat-tool-msg-collapse.chat-tool-msg-collapse--manual.is-open:has(.cl-remote-agent-card) {',
|
|
6138
|
+
' margin-left: 0 !important;',
|
|
6139
|
+
'}',
|
|
6140
|
+
// ── 外层活动组容器 ──
|
|
6141
|
+
'.chat-activity-group__body:has(.cl-remote-agent-card) {',
|
|
6142
|
+
' border-radius: 14px;',
|
|
6143
|
+
' border: 1px solid #E5E5EA;',
|
|
6144
|
+
' background: #F8F9FA;',
|
|
6145
|
+
' margin: 8px;',
|
|
5798
6146
|
' padding-bottom: 0 !important;',
|
|
5799
6147
|
'}',
|
|
5800
6148
|
'.chat-bubble:has(.cl-remote-agent-card) > .chat-text,',
|
|
@@ -5825,567 +6173,578 @@ function _clScan() {
|
|
|
5825
6173
|
'.cl-remote-agent-card {',
|
|
5826
6174
|
' max-height: none;',
|
|
5827
6175
|
' overflow: visible;',
|
|
5828
|
-
' width:
|
|
6176
|
+
' width: 100%;',
|
|
5829
6177
|
' max-width: 100%;',
|
|
5830
|
-
' border: 1px solid
|
|
5831
|
-
' border-radius:
|
|
5832
|
-
'
|
|
5833
|
-
' background: var(--card, #fff);',
|
|
6178
|
+
' border: 1px solid rgba(0,0,0,0.05);',
|
|
6179
|
+
' border-radius: 14px;',
|
|
6180
|
+
' background: #fff;',
|
|
5834
6181
|
' display: flex;',
|
|
5835
6182
|
' flex-direction: column;',
|
|
5836
|
-
' gap:
|
|
6183
|
+
' gap: 10px;',
|
|
5837
6184
|
' box-sizing: border-box;',
|
|
5838
6185
|
'}',
|
|
5839
6186
|
|
|
5840
6187
|
// ── 顶部 OpenAgent 标题条 ──
|
|
5841
6188
|
'.cl-openagent-header {',
|
|
5842
|
-
' width: fit-content;',
|
|
5843
6189
|
' max-width: 100%;',
|
|
5844
|
-
' min-height: var(--cl-native-summary-min-height, 34px);',
|
|
5845
6190
|
' display: flex;',
|
|
5846
6191
|
' align-items: center;',
|
|
5847
|
-
' gap:
|
|
5848
|
-
'
|
|
6192
|
+
' gap: 6px;',
|
|
6193
|
+
' height: 34px;',
|
|
6194
|
+
' padding: 6px 0;',
|
|
6195
|
+
' border-radius: 10px;',
|
|
5849
6196
|
' box-sizing: border-box;',
|
|
5850
|
-
' border:
|
|
5851
|
-
'
|
|
5852
|
-
' background: color-mix(in srgb, var(--bg-hover, #F4F5F7) 50%, transparent);',
|
|
5853
|
-
' color: var(--text, #2F2F33);',
|
|
6197
|
+
' border: none;',
|
|
6198
|
+
' background: transparent;',
|
|
5854
6199
|
' font-family: "PingFang SC", sans-serif;',
|
|
5855
|
-
' font-size: var(--cl-native-summary-font-size, 13px);',
|
|
5856
|
-
' line-height: var(--cl-native-summary-line-height, 1.2);',
|
|
5857
6200
|
'}',
|
|
5858
|
-
'.cl-openagent-header
|
|
5859
|
-
' width: 6px;',
|
|
5860
|
-
' color: var(--muted, rgba(47,47,51,0.45));',
|
|
5861
|
-
' font-size: 8px;',
|
|
5862
|
-
' line-height: 1;',
|
|
5863
|
-
' flex: 0 0 auto;',
|
|
6201
|
+
'.cl-openagent-header:hover {',
|
|
5864
6202
|
'}',
|
|
5865
|
-
'
|
|
5866
|
-
'
|
|
6203
|
+
'/* Output mode (Figma 373:12082) */',
|
|
6204
|
+
'.cl-openagent-header--output,',
|
|
6205
|
+
'.cl-exec-v2 .cl-openagent-header--output {',
|
|
6206
|
+
' border-radius: 10px 10px 0 0 !important;',
|
|
6207
|
+
' border: 1px solid rgba(229, 229, 234, 0.75) !important;',
|
|
6208
|
+
' background: linear-gradient(90deg, rgba(220, 38, 38, 0.09) 0%, rgba(220, 38, 38, 0) 34%),',
|
|
6209
|
+
' linear-gradient(90deg, rgb(253, 253, 254) 0%, rgb(253, 253, 254) 100%) !important;',
|
|
6210
|
+
' box-shadow: 0px 8px 11px rgba(0, 0, 0, 0.12);',
|
|
6211
|
+
' padding: 8px 6px !important;',
|
|
6212
|
+
'}',
|
|
6213
|
+
'.cl-openagent-header--output .cl-openagent-agent,',
|
|
6214
|
+
'.cl-exec-v2 .cl-openagent-header--output .cl-openagent-agent {',
|
|
6215
|
+
' display: none;',
|
|
6216
|
+
'}',
|
|
6217
|
+
'.cl-openagent-header--output:hover,',
|
|
6218
|
+
'.cl-exec-v2 .cl-openagent-header--output:hover {',
|
|
6219
|
+
' border-color: rgba(0,0,0,0.1);',
|
|
6220
|
+
'}',
|
|
6221
|
+
'.cl-openagent-expand-icon {',
|
|
6222
|
+
' display: flex;',
|
|
6223
|
+
' align-items: center;',
|
|
6224
|
+
' justify-content: center;',
|
|
5867
6225
|
' width: 15px;',
|
|
5868
|
-
' height:
|
|
5869
|
-
' flex: 0
|
|
6226
|
+
' height: 15px;',
|
|
6227
|
+
' flex-shrink: 0;',
|
|
6228
|
+
' transition: transform 0.2s ease;',
|
|
5870
6229
|
'}',
|
|
5871
|
-
'.cl-openagent-
|
|
5872
|
-
'
|
|
5873
|
-
' content: "";',
|
|
5874
|
-
' position: absolute;',
|
|
5875
|
-
' width: 8px;',
|
|
5876
|
-
' height: 8px;',
|
|
5877
|
-
' border: 1.5px solid #10BDEB;',
|
|
5878
|
-
' border-radius: 2px;',
|
|
5879
|
-
' box-sizing: border-box;',
|
|
6230
|
+
'.cl-openagent-expand-icon.cl-openagent-expanded {',
|
|
6231
|
+
' transform: rotate(180deg);',
|
|
5880
6232
|
'}',
|
|
5881
|
-
'.cl-openagent-
|
|
5882
|
-
'
|
|
5883
|
-
'
|
|
6233
|
+
'.cl-openagent-badge {',
|
|
6234
|
+
' width: 14px;',
|
|
6235
|
+
' height: 14px;',
|
|
6236
|
+
' border-radius: 14px;',
|
|
6237
|
+
' background: url(./icon.png) center/cover no-repeat;',
|
|
6238
|
+
' flex-shrink: 0;',
|
|
6239
|
+
' overflow: hidden;',
|
|
6240
|
+
'}',
|
|
6241
|
+
'.cl-openagent-text-row {',
|
|
5884
6242
|
' display: flex;',
|
|
5885
6243
|
' align-items: center;',
|
|
5886
|
-
' gap:
|
|
6244
|
+
' gap: 6px;',
|
|
5887
6245
|
' min-width: 0;',
|
|
6246
|
+
' line-height: 1.32;',
|
|
6247
|
+
'}',
|
|
6248
|
+
'.cl-openagent-label {',
|
|
6249
|
+
' font-size: 12px;',
|
|
6250
|
+
' font-weight: 500;',
|
|
6251
|
+
' color: #333;',
|
|
5888
6252
|
' white-space: nowrap;',
|
|
5889
6253
|
'}',
|
|
5890
|
-
'.cl-openagent-
|
|
5891
|
-
'
|
|
5892
|
-
' font-weight:
|
|
5893
|
-
'
|
|
5894
|
-
'
|
|
6254
|
+
'.cl-openagent-agent {',
|
|
6255
|
+
' font-size: 12px;',
|
|
6256
|
+
' font-weight: 500;',
|
|
6257
|
+
' color: #333;',
|
|
6258
|
+
' white-space: nowrap;',
|
|
5895
6259
|
'}',
|
|
5896
|
-
'.cl-openagent-
|
|
5897
|
-
'
|
|
6260
|
+
'.cl-openagent-status {',
|
|
6261
|
+
' font-size: 11px;',
|
|
5898
6262
|
' font-weight: 400;',
|
|
6263
|
+
' color: #666;',
|
|
6264
|
+
' white-space: nowrap;',
|
|
5899
6265
|
'}',
|
|
5900
|
-
// ── Figma
|
|
6266
|
+
// ── Execution detail card (Figma 346:181) ──
|
|
5901
6267
|
'.cl-thought-chain-content {',
|
|
5902
|
-
' width: 100%;',
|
|
5903
|
-
' min-height: 0;',
|
|
5904
|
-
' box-sizing: border-box;',
|
|
5905
|
-
' border: 1px solid color-mix(in srgb, var(--border, rgba(0,0,0,0.04)) 60%, transparent);',
|
|
5906
|
-
' border-radius: 8px;',
|
|
5907
|
-
' background: var(--card, #fff);',
|
|
5908
|
-
' padding: 8px;',
|
|
5909
6268
|
' display: flex;',
|
|
5910
6269
|
' flex-direction: column;',
|
|
5911
|
-
'
|
|
5912
|
-
' gap: 12px;',
|
|
5913
|
-
'}',
|
|
5914
|
-
// ── 共享展开态宿主清理 ──
|
|
5915
|
-
'details.chat-tools-collapse:has(.cl-thought-chain-content--execution),',
|
|
5916
|
-
'details.chat-tools-collapse:has(.cl-output-result),',
|
|
5917
|
-
'details.chat-tool-msg-collapse:has(.cl-thought-chain-content--execution),',
|
|
5918
|
-
'details.chat-tool-msg-collapse:has(.cl-output-result),',
|
|
5919
|
-
'.chat-tools-collapse:has(.cl-thought-chain-content--execution),',
|
|
5920
|
-
'.chat-tools-collapse:has(.cl-output-result),',
|
|
5921
|
-
'.chat-tool-msg-collapse:has(.cl-thought-chain-content--execution),',
|
|
5922
|
-
'.chat-tool-msg-collapse:has(.cl-output-result) {',
|
|
5923
|
-
' max-width: 100% !important;',
|
|
5924
|
-
' display: block !important;',
|
|
5925
|
-
' box-sizing: border-box !important;',
|
|
6270
|
+
' gap: 16px;',
|
|
5926
6271
|
'}',
|
|
5927
|
-
|
|
5928
|
-
'
|
|
5929
|
-
'
|
|
5930
|
-
'
|
|
6272
|
+
'.cl-exec-detail-card {',
|
|
6273
|
+
' padding: 8px 16px 8px 12px;',
|
|
6274
|
+
' border-radius: 8px;',
|
|
6275
|
+
' background: #f8f8f8 url(./bg.png) no-repeat;',
|
|
6276
|
+
' background-size: 100% 100%;',
|
|
6277
|
+
' background-position: center;',
|
|
6278
|
+
' width: 460px;',
|
|
6279
|
+
' max-width: 100%;',
|
|
5931
6280
|
' box-sizing: border-box;',
|
|
5932
6281
|
'}',
|
|
5933
|
-
'.cl-
|
|
5934
|
-
'
|
|
5935
|
-
'
|
|
6282
|
+
'.cl-exec-detail-row {',
|
|
6283
|
+
' display: flex;',
|
|
6284
|
+
' align-items: center;',
|
|
6285
|
+
' gap: 16px;',
|
|
5936
6286
|
'}',
|
|
5937
|
-
'.cl-
|
|
5938
|
-
' width:
|
|
6287
|
+
'.cl-exec-agent-avatar {',
|
|
6288
|
+
' width: 68px;',
|
|
6289
|
+
' height: 68px;',
|
|
6290
|
+
' border-radius: 50%;',
|
|
6291
|
+
' object-fit: cover;',
|
|
6292
|
+
' flex-shrink: 0;',
|
|
5939
6293
|
'}',
|
|
5940
|
-
|
|
5941
|
-
'
|
|
5942
|
-
'
|
|
6294
|
+
'.cl-exec-detail-info {',
|
|
6295
|
+
' display: flex;',
|
|
6296
|
+
' flex-direction: column;',
|
|
6297
|
+
' gap: 6px;',
|
|
6298
|
+
' flex: 1;',
|
|
6299
|
+
' min-width: 0;',
|
|
5943
6300
|
'}',
|
|
5944
|
-
'.cl-
|
|
5945
|
-
'
|
|
6301
|
+
'.cl-exec-name-row {',
|
|
6302
|
+
' display: flex;',
|
|
6303
|
+
' align-items: center;',
|
|
6304
|
+
' justify-content: space-between;',
|
|
6305
|
+
' gap: 8px;',
|
|
6306
|
+
' margin-bottom: 6px;',
|
|
5946
6307
|
'}',
|
|
5947
|
-
|
|
5948
|
-
'
|
|
5949
|
-
'
|
|
5950
|
-
'
|
|
5951
|
-
'
|
|
5952
|
-
'
|
|
6308
|
+
'.cl-exec-agent-name {',
|
|
6309
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6310
|
+
' font-size: 17px;',
|
|
6311
|
+
' font-weight: 500;',
|
|
6312
|
+
' color: #000;',
|
|
6313
|
+
' margin: 0;',
|
|
6314
|
+
' line-height: 1;',
|
|
5953
6315
|
'}',
|
|
5954
|
-
|
|
5955
|
-
'
|
|
5956
|
-
' display: inline-flex;',
|
|
6316
|
+
'.cl-exec-star-badge {',
|
|
6317
|
+
' display: flex;',
|
|
5957
6318
|
' align-items: center;',
|
|
5958
|
-
'
|
|
5959
|
-
'
|
|
5960
|
-
'
|
|
5961
|
-
'
|
|
5962
|
-
'
|
|
5963
|
-
'
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
'
|
|
5968
|
-
'
|
|
6319
|
+
' gap: 2px;',
|
|
6320
|
+
' padding: 2px 10px 2px 8px;',
|
|
6321
|
+
' border-radius: 30px;',
|
|
6322
|
+
' background: #ebebeb;',
|
|
6323
|
+
' flex-shrink: 0;',
|
|
6324
|
+
'}',
|
|
6325
|
+
,
|
|
6326
|
+
,
|
|
6327
|
+
,
|
|
6328
|
+
'.cl-exec-star-count {',
|
|
6329
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6330
|
+
' font-size: 11px;',
|
|
6331
|
+
' font-weight: 500;',
|
|
6332
|
+
' color: #555;',
|
|
6333
|
+
' white-space: nowrap;',
|
|
6334
|
+
'}',
|
|
6335
|
+
'.cl-exec-agent-bio {',
|
|
6336
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6337
|
+
' font-size: 14px;',
|
|
6338
|
+
' font-weight: 400;',
|
|
6339
|
+
' color: #555;',
|
|
5969
6340
|
' margin: 0;',
|
|
6341
|
+
' line-height: 1;',
|
|
5970
6342
|
'}',
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
'
|
|
5974
|
-
'
|
|
5975
|
-
' object-fit: cover;',
|
|
5976
|
-
' flex: 0 0 24px;',
|
|
5977
|
-
' border: 0.6px solid rgba(47,47,51,0.20);',
|
|
5978
|
-
' box-sizing: border-box;',
|
|
6343
|
+
|
|
6344
|
+
// ── Progress text (Figma 346:253) ──
|
|
6345
|
+
'.cl-thought-chain-content.cl-content-collapsed {',
|
|
6346
|
+
' display: none;',
|
|
5979
6347
|
'}',
|
|
5980
|
-
|
|
5981
|
-
|
|
6348
|
+
,
|
|
6349
|
+
'.cl-exec-progress-row {',
|
|
6350
|
+
' display: flex;',
|
|
5982
6351
|
' align-items: center;',
|
|
6352
|
+
' gap: 2px;',
|
|
6353
|
+
'}',
|
|
6354
|
+
'.cl-exec-progress-text {',
|
|
5983
6355
|
' font-family: "PingFang SC", sans-serif;',
|
|
5984
|
-
' font-size:
|
|
5985
|
-
'
|
|
6356
|
+
' font-size: 14px;',
|
|
6357
|
+
' font-weight: 400;',
|
|
5986
6358
|
' line-height: 1.2;',
|
|
5987
|
-
'
|
|
6359
|
+
' margin: 0;',
|
|
5988
6360
|
' white-space: nowrap;',
|
|
6361
|
+
' background-image: linear-gradient(90deg, #555 0%, #555 36%, #eee 55%, #555 77%, #555 100%);',
|
|
6362
|
+
' background-size: 200% 100%;',
|
|
6363
|
+
' -webkit-background-clip: text;',
|
|
6364
|
+
' background-clip: text;',
|
|
6365
|
+
' -webkit-text-fill-color: transparent;',
|
|
6366
|
+
' animation: cl-progress-shimmer 2.5s ease-in-out infinite;',
|
|
5989
6367
|
'}',
|
|
5990
|
-
'.cl-
|
|
5991
|
-
'.cl-agent-pill-label { font-weight: 400; }',
|
|
5992
|
-
'.cl-thought-chain-pill-slot {',
|
|
6368
|
+
'.cl-exec-progress-arrow {',
|
|
5993
6369
|
' display: flex;',
|
|
5994
6370
|
' align-items: center;',
|
|
5995
|
-
'
|
|
5996
|
-
'}',
|
|
5997
|
-
'.cl-thought-chain-divider {',
|
|
5998
|
-
' display: none;',
|
|
6371
|
+
' flex-shrink: 0;',
|
|
5999
6372
|
'}',
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
'
|
|
6004
|
-
'
|
|
6373
|
+
|
|
6374
|
+
|
|
6375
|
+
// ── Progress shimmer keyframes ──
|
|
6376
|
+
'@keyframes cl-progress-shimmer {',
|
|
6377
|
+
' 0% { background-position: 200% 0; }',
|
|
6378
|
+
' 100% { background-position: -200% 0; }',
|
|
6005
6379
|
'}',
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
'
|
|
6009
|
-
'
|
|
6010
|
-
'
|
|
6011
|
-
' border:
|
|
6012
|
-
'
|
|
6013
|
-
'
|
|
6380
|
+
|
|
6381
|
+
// ── Output card(Figma 160:6681) ──
|
|
6382
|
+
'.cl-output-card {',
|
|
6383
|
+
' background: #fff !important;',
|
|
6384
|
+
' border: 1.2px solid rgba(47,47,51,0.1) !important;',
|
|
6385
|
+
' border-radius: 24px !important;',
|
|
6386
|
+
' padding: 10px 15px !important;',
|
|
6387
|
+
' gap: 10px !important;',
|
|
6014
6388
|
'}',
|
|
6015
|
-
'.cl-
|
|
6016
|
-
'
|
|
6017
|
-
'
|
|
6018
|
-
'
|
|
6389
|
+
'.cl-output-card > .cl-thought-chain-content {',
|
|
6390
|
+
' background: #fff;',
|
|
6391
|
+
' border: 1px solid #f4f4f4;',
|
|
6392
|
+
' border-radius: 12px;',
|
|
6393
|
+
' padding: 20px 30px;',
|
|
6394
|
+
' overflow: hidden;',
|
|
6395
|
+
' max-width: 100%;',
|
|
6396
|
+
' box-sizing: border-box;',
|
|
6019
6397
|
'}',
|
|
6020
|
-
'.cl-
|
|
6021
|
-
'
|
|
6022
|
-
'
|
|
6398
|
+
'.cl-output-card > .cl-thought-chain-content * {',
|
|
6399
|
+
' max-width: 100%;',
|
|
6400
|
+
' box-sizing: border-box;',
|
|
6023
6401
|
'}',
|
|
6024
|
-
'.cl-
|
|
6025
|
-
'
|
|
6026
|
-
'
|
|
6027
|
-
'
|
|
6028
|
-
'
|
|
6029
|
-
' border: 0;',
|
|
6030
|
-
' border-radius: 9px;',
|
|
6031
|
-
' box-shadow: inset 0 0 0 1.2px rgba(47,47,51,0.06);',
|
|
6402
|
+
'.cl-output-card > .cl-thought-chain-content pre,',
|
|
6403
|
+
'.cl-output-card > .cl-thought-chain-content code {',
|
|
6404
|
+
' overflow-x: auto;',
|
|
6405
|
+
' white-space: pre-wrap;',
|
|
6406
|
+
' word-break: break-all;',
|
|
6032
6407
|
'}',
|
|
6033
|
-
|
|
6034
|
-
'
|
|
6035
|
-
'
|
|
6036
|
-
'
|
|
6408
|
+
// V2 output card:统一 border/padding 与 execution card 一致
|
|
6409
|
+
'.cl-exec-v2.cl-output-card {',
|
|
6410
|
+
' border: 1px solid rgba(0,0,0,0.05) !important;',
|
|
6411
|
+
' border-radius: 14px !important;',
|
|
6412
|
+
' padding: 0 !important;',
|
|
6037
6413
|
'}',
|
|
6038
|
-
|
|
6039
|
-
'
|
|
6040
|
-
'
|
|
6414
|
+
// V2 output card:去掉 content 区多余的内边距,detail card 自带动间距
|
|
6415
|
+
'.cl-exec-v2.cl-output-card > .cl-thought-chain-content {',
|
|
6416
|
+
' background: transparent;',
|
|
6417
|
+
' border: none;',
|
|
6418
|
+
' border-radius: 0;',
|
|
6419
|
+
' padding: 0 14px !important;',
|
|
6041
6420
|
'}',
|
|
6042
6421
|
|
|
6043
|
-
// ── Figma
|
|
6044
|
-
'.cl-
|
|
6045
|
-
'
|
|
6046
|
-
' display: flex;',
|
|
6047
|
-
' flex-direction: column;',
|
|
6048
|
-
' align-items: flex-start;',
|
|
6049
|
-
' gap: 4px;',
|
|
6050
|
-
' padding: 4px 0;',
|
|
6051
|
-
' box-sizing: border-box;',
|
|
6422
|
+
// ── Collapsed state(Figma 145:3466) ──
|
|
6423
|
+
'.cl-remote-agent-card:has(.cl-content-collapsed) {',
|
|
6424
|
+
' padding: 0 !important;',
|
|
6052
6425
|
'}',
|
|
6053
|
-
|
|
6426
|
+
// ── Output card Footer(Figma 131:2091) ──
|
|
6427
|
+
'.cl-output-footer {',
|
|
6054
6428
|
' display: flex;',
|
|
6055
6429
|
' align-items: center;',
|
|
6056
|
-
' gap: 0;',
|
|
6057
|
-
' padding: 0;',
|
|
6058
|
-
' cursor: default;',
|
|
6059
|
-
' user-select: none;',
|
|
6060
|
-
'}',
|
|
6061
|
-
'.cl-tools-collapse-header:hover { opacity: 1; }',
|
|
6062
|
-
'.cl-tools-collapse-header-icon { display: none; }',
|
|
6063
|
-
'.cl-tools-collapse-header-title {',
|
|
6064
|
-
' font-family: "PingFang SC", sans-serif;',
|
|
6065
|
-
' font-size: 10px;',
|
|
6066
|
-
' font-weight: 600;',
|
|
6067
|
-
' line-height: 1.2;',
|
|
6068
|
-
' color: rgba(47,47,51,0.90);',
|
|
6069
|
-
'}',
|
|
6070
|
-
'.cl-tools-collapse-body {',
|
|
6071
|
-
' position: relative;',
|
|
6072
|
-
' display: flex;',
|
|
6073
|
-
' flex-direction: column;',
|
|
6074
6430
|
' gap: 4px;',
|
|
6075
|
-
'
|
|
6076
|
-
'
|
|
6077
|
-
'
|
|
6078
|
-
' transition: max-height 0.25s ease, opacity 0.2s ease;',
|
|
6079
|
-
'}',
|
|
6080
|
-
'.cl-tools-collapse-body::before {',
|
|
6081
|
-
' content: "";',
|
|
6082
|
-
' position: absolute;',
|
|
6083
|
-
' left: 7px;',
|
|
6084
|
-
' top: 14px;',
|
|
6085
|
-
' bottom: 14px;',
|
|
6086
|
-
' width: 1px;',
|
|
6087
|
-
' background: rgba(47,47,51,0.10);',
|
|
6431
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6432
|
+
' font-size: 14px;',
|
|
6433
|
+
' color: #999;',
|
|
6088
6434
|
'}',
|
|
6089
|
-
'.cl-
|
|
6090
|
-
'
|
|
6091
|
-
'.cl-tools-collapse-step {',
|
|
6092
|
-
' position: relative;',
|
|
6093
|
-
' display: block;',
|
|
6094
|
-
' width: 100%;',
|
|
6095
|
-
' padding: 0;',
|
|
6096
|
-
' z-index: 1;',
|
|
6435
|
+
'.cl-output-footer-text {',
|
|
6436
|
+
' white-space: nowrap;',
|
|
6097
6437
|
'}',
|
|
6098
|
-
'.cl-
|
|
6438
|
+
'.cl-output-footer-star {',
|
|
6099
6439
|
' display: flex;',
|
|
6100
6440
|
' align-items: center;',
|
|
6101
|
-
'
|
|
6102
|
-
' min-height: 14px;',
|
|
6441
|
+
' flex-shrink: 0;',
|
|
6103
6442
|
'}',
|
|
6104
|
-
'.cl-
|
|
6105
|
-
'
|
|
6106
|
-
'
|
|
6107
|
-
' flex: 0 0 14px;',
|
|
6108
|
-
' display: flex;',
|
|
6109
|
-
' align-items: center;',
|
|
6110
|
-
' justify-content: center;',
|
|
6111
|
-
' background: #fff;',
|
|
6443
|
+
'.cl-output-footer-count {',
|
|
6444
|
+
' font-weight: 500;',
|
|
6445
|
+
' white-space: nowrap;',
|
|
6112
6446
|
'}',
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
'
|
|
6116
|
-
'
|
|
6117
|
-
'
|
|
6118
|
-
'
|
|
6447
|
+
|
|
6448
|
+
/* ── Sidebar 面板(Figma 145:5712) ── */
|
|
6449
|
+
'.chat-sidebar {',
|
|
6450
|
+
' background: #fff !important;',
|
|
6451
|
+
' border: 1px solid rgba(0,0,0,0.05) !important;',
|
|
6452
|
+
' border-radius: 14px !important;',
|
|
6453
|
+
' padding: 16px 20px !important;',
|
|
6454
|
+
' box-sizing: border-box !important;',
|
|
6455
|
+
' display: flex !important;',
|
|
6456
|
+
' flex-direction: column !important;',
|
|
6457
|
+
' gap: 16px !important;',
|
|
6119
6458
|
'}',
|
|
6120
|
-
'.
|
|
6121
|
-
'
|
|
6122
|
-
'
|
|
6123
|
-
'
|
|
6124
|
-
'
|
|
6459
|
+
'.chat-sidebar > .sidebar-panel {',
|
|
6460
|
+
' display: flex !important;',
|
|
6461
|
+
' flex-direction: column !important;',
|
|
6462
|
+
' gap: 16px !important;',
|
|
6463
|
+
' width: 100% !important;',
|
|
6464
|
+
' background: transparent !important;',
|
|
6125
6465
|
'}',
|
|
6126
|
-
'.
|
|
6127
|
-
'
|
|
6128
|
-
'
|
|
6129
|
-
'
|
|
6130
|
-
'
|
|
6131
|
-
'
|
|
6466
|
+
'.chat-sidebar .sidebar-header {',
|
|
6467
|
+
' display: flex !important;',
|
|
6468
|
+
' align-items: center !important;',
|
|
6469
|
+
' justify-content: space-between !important;',
|
|
6470
|
+
' padding: 6px 0 !important;',
|
|
6471
|
+
' border-radius: 10px !important;',
|
|
6472
|
+
' width: 100% !important;',
|
|
6473
|
+
' border: none !important;',
|
|
6474
|
+
' background: transparent !important;',
|
|
6132
6475
|
'}',
|
|
6133
|
-
'.
|
|
6134
|
-
'
|
|
6135
|
-
'
|
|
6136
|
-
'
|
|
6137
|
-
'
|
|
6138
|
-
'
|
|
6139
|
-
' height: 7px;',
|
|
6140
|
-
' border: solid #fff;',
|
|
6141
|
-
' border-width: 0 1.3px 1.3px 0;',
|
|
6142
|
-
' transform: rotate(45deg);',
|
|
6476
|
+
'.chat-sidebar .sidebar-title {',
|
|
6477
|
+
' font-family: "PingFang SC", sans-serif !important;',
|
|
6478
|
+
' font-weight: 500 !important;',
|
|
6479
|
+
' font-size: 18px !important;',
|
|
6480
|
+
' color: #333 !important;',
|
|
6481
|
+
' line-height: 1.32 !important;',
|
|
6143
6482
|
'}',
|
|
6144
|
-
'.
|
|
6145
|
-
'
|
|
6146
|
-
'
|
|
6147
|
-
'
|
|
6148
|
-
'
|
|
6149
|
-
'
|
|
6150
|
-
'
|
|
6151
|
-
'
|
|
6152
|
-
' text-overflow: ellipsis;',
|
|
6483
|
+
'.chat-sidebar .sidebar-header button {',
|
|
6484
|
+
' width: 16px !important;',
|
|
6485
|
+
' height: 16px !important;',
|
|
6486
|
+
' padding: 0 !important;',
|
|
6487
|
+
' border: none !important;',
|
|
6488
|
+
' background: transparent !important;',
|
|
6489
|
+
' cursor: pointer !important;',
|
|
6490
|
+
' flex-shrink: 0 !important;',
|
|
6153
6491
|
'}',
|
|
6154
|
-
'.
|
|
6155
|
-
'
|
|
6156
|
-
' font-
|
|
6157
|
-
' font-
|
|
6158
|
-
' line-height: 1.
|
|
6159
|
-
' color:
|
|
6492
|
+
'.chat-sidebar .sidebar-content {',
|
|
6493
|
+
' font-family: "PingFang SC", sans-serif !important;',
|
|
6494
|
+
' font-size: 14px !important;',
|
|
6495
|
+
' font-weight: 400 !important;',
|
|
6496
|
+
' line-height: 1.8 !important;',
|
|
6497
|
+
' color: #333 !important;',
|
|
6498
|
+
' width: 100% !important;',
|
|
6499
|
+
' padding: 0 !important;',
|
|
6160
6500
|
'}',
|
|
6161
|
-
'.
|
|
6162
|
-
'
|
|
6163
|
-
'
|
|
6501
|
+
'.chat-sidebar .sidebar-markdown {',
|
|
6502
|
+
' font-family: "PingFang SC", sans-serif !important;',
|
|
6503
|
+
' font-size: 14px !important;',
|
|
6504
|
+
' font-weight: 400 !important;',
|
|
6505
|
+
' line-height: 1.8 !important;',
|
|
6506
|
+
' color: #333 !important;',
|
|
6507
|
+
' background: transparent !important;',
|
|
6508
|
+
' border: none !important;',
|
|
6509
|
+
' padding: 0 !important;',
|
|
6164
6510
|
'}',
|
|
6165
|
-
|
|
6166
|
-
'
|
|
6167
|
-
'
|
|
6511
|
+
// 隐藏宿主 sidebar 自带的 "Rendered Markdown / View Raw Text" 工具栏
|
|
6512
|
+
'.chat-sidebar .sidebar-markdown-shell__toolbar {',
|
|
6513
|
+
' display: none !important;',
|
|
6168
6514
|
'}',
|
|
6169
|
-
|
|
6170
|
-
|
|
6515
|
+
// ═══════════════════════════════════════════════════════════════
|
|
6516
|
+
// V2 执行卡片样式(2026.6.9+ 新版 UI)
|
|
6517
|
+
// 所有 V2 样式在 .cl-exec-v2 下隔离,不影响旧版
|
|
6518
|
+
// ═══════════════════════════════════════════════════════════════
|
|
6519
|
+
|
|
6520
|
+
// ── V2 容器 ──
|
|
6521
|
+
'.cl-exec-v2 {',
|
|
6522
|
+
' position: relative;',
|
|
6171
6523
|
'}',
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
'
|
|
6175
|
-
'
|
|
6176
|
-
'
|
|
6177
|
-
'
|
|
6178
|
-
'
|
|
6179
|
-
'
|
|
6524
|
+
|
|
6525
|
+
// ── V2 Header(Figma 371:6987 — 红晕渐变背景 + 独立边框)──
|
|
6526
|
+
'.cl-exec-v2 .cl-openagent-header-v2 {',
|
|
6527
|
+
' background: linear-gradient(90deg, rgba(220, 38, 38, 0.09) 0%, rgba(220, 38, 38, 0) 34%),',
|
|
6528
|
+
' linear-gradient(90deg, rgb(253, 253, 254) 0%, rgb(253, 253, 254) 100%) !important;',
|
|
6529
|
+
' border-bottom: 1px solid rgba(229, 229, 234, 0.75) !important;',
|
|
6530
|
+
' padding: 8px 6px !important;',
|
|
6531
|
+
' margin: 0 !important;',
|
|
6532
|
+
' border-radius: 10px 10px 0 0;',
|
|
6533
|
+
' height: auto !important;',
|
|
6534
|
+
' min-height: auto !important;',
|
|
6535
|
+
' box-sizing: border-box;',
|
|
6180
6536
|
'}',
|
|
6181
|
-
'.cl-
|
|
6182
|
-
'
|
|
6183
|
-
'
|
|
6537
|
+
'.cl-exec-v2 .cl-openagent-header-v2:hover {',
|
|
6538
|
+
' background: linear-gradient(90deg, rgba(220, 38, 38, 0.12) 0%, rgba(220, 38, 38, 0) 34%),',
|
|
6539
|
+
' linear-gradient(90deg, rgb(250, 250, 251) 0%, rgb(250, 250, 251) 100%) !important;',
|
|
6184
6540
|
'}',
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
'
|
|
6188
|
-
'
|
|
6541
|
+
|
|
6542
|
+
// ── V2 圆形灰色头像(替代小徽章)──
|
|
6543
|
+
'.cl-exec-v2 .cl-openagent-avatar-v2 {',
|
|
6544
|
+
' display: inline-block;',
|
|
6545
|
+
' width: 24px;',
|
|
6546
|
+
' height: 24px;',
|
|
6547
|
+
' border-radius: 50%;',
|
|
6548
|
+
' background: #d0d0d0;',
|
|
6549
|
+
' flex-shrink: 0;',
|
|
6550
|
+
' margin-right: 4px;',
|
|
6189
6551
|
'}',
|
|
6190
|
-
|
|
6191
|
-
|
|
6192
|
-
'
|
|
6193
|
-
'
|
|
6552
|
+
|
|
6553
|
+
// ── V2 隐藏旧版 OASN 小徽章和 @agentName ──
|
|
6554
|
+
'.cl-exec-v2 .cl-openagent-badge,',
|
|
6555
|
+
'.cl-exec-v2 .cl-openagent-agent {',
|
|
6556
|
+
' display: none !important;',
|
|
6194
6557
|
'}',
|
|
6195
|
-
|
|
6196
|
-
'
|
|
6197
|
-
'
|
|
6198
|
-
' background: #DCDCDC;',
|
|
6558
|
+
// ── V2 隐藏步骤标题栏(▼ + "思考中..."),保留进度文字行 ──
|
|
6559
|
+
'.cl-exec-v2 .cl-tools-collapse-header-v2 {',
|
|
6560
|
+
' display: none !important;',
|
|
6199
6561
|
'}',
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
'
|
|
6203
|
-
' width:
|
|
6204
|
-
'
|
|
6205
|
-
'
|
|
6562
|
+
|
|
6563
|
+
// ── V2 Detail Card(大头像 + 右置星级 + 网格点背景)──
|
|
6564
|
+
'.cl-exec-v2 .cl-exec-detail-card-v2 {',
|
|
6565
|
+
' max-width: 488px !important;',
|
|
6566
|
+
' width: 100% !important;',
|
|
6567
|
+
' padding: 8px 16px 8px 12px !important;',
|
|
6568
|
+
' padding-right: 90px !important;',
|
|
6569
|
+
' border-radius: 12px !important;',
|
|
6570
|
+
' background: #f7f7f8 !important;',
|
|
6571
|
+
' margin: 12px 14px 14px 14px !important;',
|
|
6572
|
+
' margin-left: 0 !important;',
|
|
6573
|
+
' position: relative;',
|
|
6574
|
+
' overflow: hidden;',
|
|
6575
|
+
' box-sizing: border-box;',
|
|
6206
6576
|
'}',
|
|
6207
|
-
|
|
6208
|
-
'
|
|
6209
|
-
'
|
|
6577
|
+
/* 四角网格点装饰 */
|
|
6578
|
+
'.cl-exec-v2 .cl-exec-detail-card-v2::before,',
|
|
6579
|
+
'.cl-exec-v2 .cl-exec-detail-card-v2::after {',
|
|
6580
|
+
' content: "";',
|
|
6581
|
+
' position: absolute;',
|
|
6582
|
+
' width: 40px;',
|
|
6583
|
+
' height: 40px;',
|
|
6584
|
+
' background-image: radial-gradient(circle, #ddd 1px, transparent 1px);',
|
|
6585
|
+
' background-size: 8px 8px;',
|
|
6586
|
+
' opacity: 0.5;',
|
|
6210
6587
|
'}',
|
|
6211
|
-
'.cl-
|
|
6212
|
-
'
|
|
6588
|
+
'.cl-exec-v2 .cl-exec-detail-card-v2::before {',
|
|
6589
|
+
' top: 8px;',
|
|
6590
|
+
' left: 8px;',
|
|
6591
|
+
'}',
|
|
6592
|
+
'.cl-exec-v2 .cl-exec-detail-card-v2::after {',
|
|
6593
|
+
' bottom: 8px;',
|
|
6594
|
+
' right: 8px;',
|
|
6213
6595
|
'}',
|
|
6214
6596
|
|
|
6215
|
-
|
|
6216
|
-
'
|
|
6217
|
-
'
|
|
6218
|
-
'
|
|
6219
|
-
'.chat-tool-msg-collapse:has(.cl-output-card--pending) {',
|
|
6220
|
-
' display: none !important;',
|
|
6597
|
+
'.cl-exec-v2 .cl-exec-detail-row-v2 {',
|
|
6598
|
+
' display: flex;',
|
|
6599
|
+
' align-items: flex-start;',
|
|
6600
|
+
' gap: 16px;',
|
|
6221
6601
|
'}',
|
|
6222
|
-
|
|
6223
|
-
'
|
|
6602
|
+
|
|
6603
|
+
'.cl-exec-v2 .cl-exec-detail-info-v2 {',
|
|
6604
|
+
' display: flex;',
|
|
6605
|
+
' flex-direction: column;',
|
|
6606
|
+
' gap: 6px;',
|
|
6607
|
+
' flex: 1;',
|
|
6608
|
+
' min-width: 0;',
|
|
6224
6609
|
'}',
|
|
6225
6610
|
|
|
6226
|
-
// ──
|
|
6227
|
-
'.cl-
|
|
6228
|
-
'
|
|
6229
|
-
'
|
|
6230
|
-
'
|
|
6231
|
-
'
|
|
6232
|
-
'
|
|
6233
|
-
' word-break: break-word;',
|
|
6611
|
+
// ── V2 大头像 80×80 ──
|
|
6612
|
+
'.cl-exec-v2 .cl-exec-agent-avatar-v2 {',
|
|
6613
|
+
' width: 80px !important;',
|
|
6614
|
+
' height: 80px !important;',
|
|
6615
|
+
' border-radius: 16px !important;',
|
|
6616
|
+
' object-fit: cover;',
|
|
6617
|
+
' flex-shrink: 0;',
|
|
6234
6618
|
'}',
|
|
6235
|
-
|
|
6236
|
-
|
|
6619
|
+
|
|
6620
|
+
// ── V2 名称 ~20px/600/黑色 ──
|
|
6621
|
+
'.cl-exec-v2 .cl-exec-agent-name-v2 {',
|
|
6622
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6623
|
+
' font-size: 20px !important;',
|
|
6624
|
+
' font-weight: 600 !important;',
|
|
6625
|
+
' color: #000 !important;',
|
|
6626
|
+
' margin: 0;',
|
|
6627
|
+
' line-height: 1.3;',
|
|
6237
6628
|
'}',
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
'
|
|
6241
|
-
'
|
|
6242
|
-
'
|
|
6243
|
-
'
|
|
6244
|
-
'
|
|
6245
|
-
'
|
|
6246
|
-
'
|
|
6247
|
-
' border-radius: 0;',
|
|
6248
|
-
' background: transparent;',
|
|
6249
|
-
' font-size: 14.25px;',
|
|
6250
|
-
' line-height: 1.42;',
|
|
6251
|
-
' color: rgba(47,47,51,0.50);',
|
|
6252
|
-
' scrollbar-width: thin;',
|
|
6253
|
-
' scrollbar-color: #ECECEC transparent;',
|
|
6629
|
+
|
|
6630
|
+
// ── V2 描述 ~14px/400/灰色 ──
|
|
6631
|
+
'.cl-exec-v2 .cl-exec-agent-bio-v2 {',
|
|
6632
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6633
|
+
' font-size: 14px !important;',
|
|
6634
|
+
' font-weight: 400;',
|
|
6635
|
+
' color: #888 !important;',
|
|
6636
|
+
' margin: 0;',
|
|
6637
|
+
' line-height: 1.4;',
|
|
6254
6638
|
'}',
|
|
6255
|
-
|
|
6256
|
-
|
|
6639
|
+
|
|
6640
|
+
// ── V2 星级右置到卡片右上角 ──
|
|
6641
|
+
'.cl-exec-v2 .cl-exec-star-badge-v2 {',
|
|
6642
|
+
' position: absolute;',
|
|
6643
|
+
' right: 24px;',
|
|
6644
|
+
' top: 20px;',
|
|
6645
|
+
' display: flex;',
|
|
6646
|
+
' align-items: center;',
|
|
6647
|
+
' gap: 4px;',
|
|
6648
|
+
' padding: 4px 12px;',
|
|
6649
|
+
' border-radius: 30px;',
|
|
6650
|
+
' background: #ebebeb;',
|
|
6651
|
+
' z-index: 1;',
|
|
6257
6652
|
'}',
|
|
6258
|
-
'.cl-
|
|
6259
|
-
'
|
|
6653
|
+
'.cl-exec-v2 .cl-exec-star-count-v2 {',
|
|
6654
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6655
|
+
' font-size: 13px;',
|
|
6656
|
+
' font-weight: 500;',
|
|
6657
|
+
' color: #555;',
|
|
6658
|
+
' white-space: nowrap;',
|
|
6260
6659
|
'}',
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
'
|
|
6660
|
+
|
|
6661
|
+
// ── V2 Progress Row(Figma 373:9765 — shimmer 渐变文字 + 箭头)──
|
|
6662
|
+
'.cl-exec-v2 .cl-exec-progress-row-v2 {',
|
|
6663
|
+
' display: flex;',
|
|
6664
|
+
' align-items: center;',
|
|
6665
|
+
' gap: 2px;',
|
|
6666
|
+
' margin-top: 16px;',
|
|
6667
|
+
' padding: 0 4px;',
|
|
6264
6668
|
'}',
|
|
6265
|
-
'.cl-
|
|
6266
|
-
'
|
|
6267
|
-
'
|
|
6268
|
-
' font-
|
|
6269
|
-
' font-weight: 600;',
|
|
6669
|
+
'.cl-exec-v2 .cl-exec-progress-row-v2 .cl-exec-progress-text {',
|
|
6670
|
+
' font-family: "PingFang SC", sans-serif;',
|
|
6671
|
+
' font-size: 14px;',
|
|
6672
|
+
' font-weight: 400;',
|
|
6270
6673
|
' line-height: 1.2;',
|
|
6271
|
-
'
|
|
6674
|
+
' margin: 0;',
|
|
6675
|
+
' white-space: nowrap;',
|
|
6676
|
+
' background-image: linear-gradient(90deg, #555 0%, #555 36%, #eee 55%, #555 77%, #555 100%);',
|
|
6677
|
+
' background-size: 200% 100%;',
|
|
6678
|
+
' -webkit-background-clip: text;',
|
|
6679
|
+
' background-clip: text;',
|
|
6680
|
+
' -webkit-text-fill-color: transparent;',
|
|
6681
|
+
' animation: cl-progress-shimmer 2.5s ease-in-out infinite;',
|
|
6272
6682
|
'}',
|
|
6273
|
-
'.cl-
|
|
6274
|
-
'
|
|
6275
|
-
'
|
|
6683
|
+
'.cl-exec-v2 .cl-exec-progress-row-v2 .cl-exec-progress-arrow {',
|
|
6684
|
+
' display: flex;',
|
|
6685
|
+
' align-items: center;',
|
|
6686
|
+
' flex-shrink: 0;',
|
|
6687
|
+
' opacity: 1;',
|
|
6276
6688
|
'}',
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
'
|
|
6280
|
-
'
|
|
6281
|
-
'
|
|
6282
|
-
' color: rgba(47,47,51,0.90);',
|
|
6689
|
+
|
|
6690
|
+
// ── V2 隐藏旧版 name-row(星级原来在名称旁边)──
|
|
6691
|
+
'.cl-exec-v2 .cl-exec-name-row,',
|
|
6692
|
+
'.cl-exec-v2 .cl-exec-star-badge:not(.cl-exec-star-badge-v2) {',
|
|
6693
|
+
' display: none !important;',
|
|
6283
6694
|
'}',
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
'
|
|
6287
|
-
'
|
|
6288
|
-
' color: rgba(47,47,51,0.50);',
|
|
6695
|
+
|
|
6696
|
+
// ─ V2 步骤列表样式(覆盖 thought-chain-card.js 默认值)──
|
|
6697
|
+
'.cl-exec-v2 .cl-tools-collapse-body-v2 {',
|
|
6698
|
+
' padding: 4px 0 8px;',
|
|
6289
6699
|
'}',
|
|
6290
|
-
'.cl-
|
|
6291
|
-
'
|
|
6292
|
-
'
|
|
6293
|
-
' color: rgba(47,47,51,0.90) !important;',
|
|
6294
|
-
' font-weight: 600;',
|
|
6700
|
+
'.cl-exec-v2 .cl-tools-collapse-step {',
|
|
6701
|
+
' padding: 5px 0;',
|
|
6702
|
+
' gap: 10px;',
|
|
6295
6703
|
'}',
|
|
6296
|
-
'.cl-
|
|
6297
|
-
'
|
|
6298
|
-
'
|
|
6299
|
-
' margin: 6px 0;',
|
|
6704
|
+
'.cl-exec-v2 .cl-tools-collapse-step-title {',
|
|
6705
|
+
' font-size: 13px;',
|
|
6706
|
+
' color: #555;',
|
|
6300
6707
|
'}',
|
|
6301
|
-
'.cl-
|
|
6302
|
-
'
|
|
6303
|
-
'
|
|
6304
|
-
'
|
|
6708
|
+
'.cl-exec-v2 .cl-tools-collapse-step-check {',
|
|
6709
|
+
' width: 12px;',
|
|
6710
|
+
' height: 12px;',
|
|
6711
|
+
' background: #ccc;',
|
|
6305
6712
|
'}',
|
|
6306
|
-
'.cl-
|
|
6307
|
-
'
|
|
6308
|
-
'
|
|
6309
|
-
'
|
|
6310
|
-
'
|
|
6311
|
-
'
|
|
6312
|
-
'
|
|
6713
|
+
'.cl-exec-v2 .cl-tools-collapse-step-dot {',
|
|
6714
|
+
' width: 14px;',
|
|
6715
|
+
' height: 14px;',
|
|
6716
|
+
'}',
|
|
6717
|
+
'.cl-exec-v2 .cl-tools-collapse-step-dot::before,',
|
|
6718
|
+
'.cl-exec-v2 .cl-tools-collapse-step-dot::after,',
|
|
6719
|
+
'.cl-exec-v2 .cl-tools-collapse-step-dot span {',
|
|
6720
|
+
' width: 3px;',
|
|
6721
|
+
' height: 3px;',
|
|
6722
|
+
' background: #bbb;',
|
|
6313
6723
|
'}',
|
|
6314
6724
|
|
|
6315
|
-
// ──
|
|
6316
|
-
'.cl-
|
|
6725
|
+
// ── V2 Footer(-由xxx完成 + 星级)──
|
|
6726
|
+
'.cl-exec-v2 .cl-output-footer-v2 {',
|
|
6317
6727
|
' display: flex;',
|
|
6318
|
-
' flex-wrap: wrap;',
|
|
6319
|
-
' gap: 8px;',
|
|
6320
|
-
' width: 100%;',
|
|
6321
|
-
' box-sizing: border-box;',
|
|
6322
|
-
' padding: 6px 18px 12px;',
|
|
6323
|
-
'}',
|
|
6324
|
-
'.cl-openagent-media-link {',
|
|
6325
|
-
' display: inline-grid;',
|
|
6326
|
-
' grid-template-columns: auto auto;',
|
|
6327
|
-
' grid-template-areas: "icon action" "icon file";',
|
|
6328
6728
|
' align-items: center;',
|
|
6329
|
-
'
|
|
6330
|
-
' row-gap: 1px;',
|
|
6331
|
-
' max-width: min(100%, 360px);',
|
|
6332
|
-
' box-sizing: border-box;',
|
|
6333
|
-
' padding: 8px 10px;',
|
|
6334
|
-
' border: 1px solid rgba(47,47,51,0.12);',
|
|
6335
|
-
' border-radius: 8px;',
|
|
6336
|
-
' background: rgba(47,47,51,0.03);',
|
|
6337
|
-
' color: rgba(47,47,51,0.90) !important;',
|
|
6338
|
-
' text-decoration: none !important;',
|
|
6729
|
+
' gap: 4px;',
|
|
6339
6730
|
' font-family: "PingFang SC", sans-serif;',
|
|
6340
|
-
'}',
|
|
6341
|
-
'.cl-openagent-media-link:hover {',
|
|
6342
|
-
' background: rgba(16,189,235,0.08);',
|
|
6343
|
-
' border-color: rgba(16,189,235,0.35);',
|
|
6344
|
-
'}',
|
|
6345
|
-
'.cl-openagent-media-link-icon {',
|
|
6346
|
-
' grid-area: icon;',
|
|
6347
|
-
' width: 28px;',
|
|
6348
|
-
' height: 28px;',
|
|
6349
|
-
' border-radius: 6px;',
|
|
6350
|
-
' background: rgba(16,189,235,0.12);',
|
|
6351
|
-
' color: #088BAE;',
|
|
6352
|
-
' display: inline-flex;',
|
|
6353
|
-
' align-items: center;',
|
|
6354
|
-
' justify-content: center;',
|
|
6355
|
-
' font-size: 11px;',
|
|
6356
|
-
' font-weight: 700;',
|
|
6357
|
-
'}',
|
|
6358
|
-
'.cl-openagent-media-link-text {',
|
|
6359
|
-
' grid-area: action;',
|
|
6360
|
-
' min-width: 0;',
|
|
6361
6731
|
' font-size: 13px;',
|
|
6362
|
-
'
|
|
6363
|
-
'
|
|
6732
|
+
' color: #999;',
|
|
6733
|
+
' padding: 12px;',
|
|
6734
|
+
' margin-top: 8px;',
|
|
6364
6735
|
'}',
|
|
6365
|
-
'.cl-
|
|
6366
|
-
' grid-area: file;',
|
|
6367
|
-
' min-width: 0;',
|
|
6368
|
-
' overflow: hidden;',
|
|
6369
|
-
' text-overflow: ellipsis;',
|
|
6736
|
+
'.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-text {',
|
|
6370
6737
|
' white-space: nowrap;',
|
|
6371
|
-
' font-size: 11px;',
|
|
6372
|
-
' line-height: 1.2;',
|
|
6373
|
-
' color: rgba(47,47,51,0.50);',
|
|
6374
6738
|
'}',
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
'
|
|
6378
|
-
'
|
|
6379
|
-
'
|
|
6380
|
-
'}',
|
|
6381
|
-
|
|
6382
|
-
// ── Header 折叠/展开 ──
|
|
6383
|
-
'.cl-openagent-header:hover {',
|
|
6384
|
-
' background: color-mix(in srgb, var(--bg-hover, #ECEDF0) 75%, transparent);',
|
|
6385
|
-
' transition: background 0.15s ease;',
|
|
6739
|
+
'.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-star {',
|
|
6740
|
+
' display: flex;',
|
|
6741
|
+
' align-items: center;',
|
|
6742
|
+
' flex-shrink: 0;',
|
|
6743
|
+
' margin-left: 2px;',
|
|
6386
6744
|
'}',
|
|
6387
|
-
'.cl-
|
|
6388
|
-
'
|
|
6745
|
+
'.cl-exec-v2 .cl-output-footer-v2 .cl-output-footer-count {',
|
|
6746
|
+
' font-weight: 500;',
|
|
6747
|
+
' white-space: nowrap;',
|
|
6389
6748
|
'}',
|
|
6390
6749
|
].join('\n');
|
|
6391
6750
|
document.head.appendChild(style);
|
|
@@ -7016,6 +7375,8 @@ function _clParseToolCardModel(card) {
|
|
|
7016
7375
|
var agentId = args.agent_id || args.agentId || null;
|
|
7017
7376
|
var agentName = args.agent_name || args.agentName || agentId || 'Remote Agent';
|
|
7018
7377
|
var agentAvatar = args.agent_avatar || args.agentAvatar || args.avatar || args.avatar_url || args.avatarUrl || null;
|
|
7378
|
+
var agentBio = args.agent_bio || args.agentBio || args.description || args.agent_description || args.MOM || '';
|
|
7379
|
+
var agentStars = args.agent_stars || args.agentStars || args.stars || args.claws || '3.2万';
|
|
7019
7380
|
var taskText = args.task || args.message || args.instruction || '';
|
|
7020
7381
|
|
|
7021
7382
|
// 从 text 解析思考步骤 / 最终文本
|
|
@@ -7031,10 +7392,14 @@ function _clParseToolCardModel(card) {
|
|
|
7031
7392
|
agentId: agentId,
|
|
7032
7393
|
agentName: agentName,
|
|
7033
7394
|
agentAvatar: agentAvatar,
|
|
7395
|
+
agentBio: agentBio,
|
|
7396
|
+
agentStars: agentStars,
|
|
7034
7397
|
taskText: taskText,
|
|
7035
7398
|
toolCallId: card.toolCallId || '',
|
|
7036
7399
|
status: hasOutput ? 'completed' : 'executing',
|
|
7037
7400
|
rawText: rawText,
|
|
7401
|
+
text: rawText,
|
|
7402
|
+
outputText: rawText,
|
|
7038
7403
|
chunks: chunks,
|
|
7039
7404
|
isError: isError,
|
|
7040
7405
|
inferredKind: inferredKind,
|
|
@@ -7065,6 +7430,11 @@ function _clParseToolCardModel(card) {
|
|
|
7065
7430
|
// UI 结构使用 shared thought-chain styles,数据来源是 RenderHook model。
|
|
7066
7431
|
|
|
7067
7432
|
function _clRenderExecutionCard(model) {
|
|
7433
|
+
// ── V2 版本判断:≥ 2026.6.9 启用新版 UI ──
|
|
7434
|
+
if (typeof _clIsHostVersionGte === 'function' && _clIsHostVersionGte('2026.6.9')) {
|
|
7435
|
+
return _clRenderExecutionCardV2(model);
|
|
7436
|
+
}
|
|
7437
|
+
|
|
7068
7438
|
var container = document.createElement('div');
|
|
7069
7439
|
container.className = 'cl-remote-agent-card cl-thought-chain';
|
|
7070
7440
|
if (CL && typeof CL.diagMarkCard === 'function') {
|
|
@@ -7074,111 +7444,45 @@ function _clRenderExecutionCard(model) {
|
|
|
7074
7444
|
container.appendChild(_clCreateOpenAgentHeader(model));
|
|
7075
7445
|
|
|
7076
7446
|
var content = document.createElement('div');
|
|
7077
|
-
content.className = 'cl-thought-chain-content cl-thought-chain-content--execution';
|
|
7447
|
+
content.className = 'cl-thought-chain-content cl-thought-chain-content--execution cl-content-collapsed';
|
|
7078
7448
|
container.appendChild(content);
|
|
7079
7449
|
|
|
7080
|
-
// ── Agent
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
// ──
|
|
7089
|
-
var
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
headerIcon.className = 'cl-tools-collapse-header-icon';
|
|
7103
|
-
headerIcon.textContent = '▼';
|
|
7104
|
-
|
|
7105
|
-
var headerTitle = document.createElement('span');
|
|
7106
|
-
headerTitle.className = 'cl-tools-collapse-header-title';
|
|
7107
|
-
|
|
7108
|
-
// 从 chunks 提取步骤
|
|
7109
|
-
var steps = [];
|
|
7110
|
-
for (var i = 0; i < model.chunks.length; i++) {
|
|
7111
|
-
var chunk = model.chunks[i];
|
|
7112
|
-
if (chunk.type === 'step') {
|
|
7113
|
-
steps.push({ title: chunk.title, detail: chunk.detail || '' });
|
|
7114
|
-
}
|
|
7115
|
-
}
|
|
7116
|
-
|
|
7117
|
-
// 合并预缓冲步骤(WS 先于 Lit 渲染到达时)
|
|
7118
|
-
if (model._bufferedSteps && model._bufferedSteps.length > 0) {
|
|
7119
|
-
steps = model._bufferedSteps;
|
|
7120
|
-
}
|
|
7121
|
-
if (typeof _cl_compactThoughtSteps === 'function') {
|
|
7122
|
-
steps = _cl_compactThoughtSteps(steps);
|
|
7123
|
-
}
|
|
7124
|
-
|
|
7125
|
-
headerTitle.textContent = '思考中...';
|
|
7126
|
-
|
|
7127
|
-
header.appendChild(headerIcon);
|
|
7128
|
-
header.appendChild(headerTitle);
|
|
7129
|
-
|
|
7130
|
-
// 步骤列表(可折叠)
|
|
7131
|
-
var body = document.createElement('div');
|
|
7132
|
-
body.className = 'cl-tools-collapse-body cl-expanded';
|
|
7133
|
-
|
|
7134
|
-
for (var si = 0; si < steps.length; si++) {
|
|
7135
|
-
var isLatest = (si === steps.length - 1);
|
|
7136
|
-
var stepEl = _clCreateStepElement(steps[si], isLatest);
|
|
7137
|
-
body.appendChild(stepEl);
|
|
7138
|
-
}
|
|
7139
|
-
|
|
7140
|
-
// 折叠/展开
|
|
7141
|
-
header.style.cursor = 'pointer';
|
|
7142
|
-
header.addEventListener('click', function(evt) {
|
|
7143
|
-
evt.stopPropagation(); // 防止外层容器拦截
|
|
7144
|
-
var isExpanded = body.classList.contains('cl-expanded');
|
|
7145
|
-
console.log('[cl-exec] 🖱️ header click: expanded=' + isExpanded + ' bodyChildren=' + body.childElementCount);
|
|
7146
|
-
if (isExpanded) {
|
|
7147
|
-
body.classList.remove('cl-expanded');
|
|
7148
|
-
body.classList.add('cl-collapsed');
|
|
7149
|
-
headerIcon.classList.add('cl-collapsed');
|
|
7150
|
-
if (typeof _cl_setCardUiState === 'function') {
|
|
7151
|
-
_cl_setCardUiState(model, { stepsExpanded: false });
|
|
7152
|
-
}
|
|
7153
|
-
} else {
|
|
7154
|
-
body.classList.remove('cl-collapsed');
|
|
7155
|
-
body.classList.add('cl-expanded');
|
|
7156
|
-
headerIcon.classList.remove('cl-collapsed');
|
|
7157
|
-
if (typeof _cl_setCardUiState === 'function') {
|
|
7158
|
-
_cl_setCardUiState(model, { stepsExpanded: true });
|
|
7159
|
-
}
|
|
7160
|
-
}
|
|
7161
|
-
});
|
|
7162
|
-
|
|
7163
|
-
stepsSection.appendChild(header);
|
|
7164
|
-
stepsSection.appendChild(body);
|
|
7165
|
-
content.appendChild(stepsSection);
|
|
7450
|
+
// ── Agent 详情卡片(Figma 346:181) ──
|
|
7451
|
+
try {
|
|
7452
|
+
var detailCard = _clCreateAgentDetailCard(model);
|
|
7453
|
+
content.appendChild(detailCard);
|
|
7454
|
+
} catch(e) {
|
|
7455
|
+
console.warn('[cl-exec] detail card creation failed:', e);
|
|
7456
|
+
}
|
|
7457
|
+
|
|
7458
|
+
// ── 进度文字(Figma 346:253) — 动态读取 response.progress?.safe_status_message ──
|
|
7459
|
+
var progressRow = document.createElement('div');
|
|
7460
|
+
progressRow.className = 'cl-exec-progress-row';
|
|
7461
|
+
var progressText = document.createElement('p');
|
|
7462
|
+
progressText.className = 'cl-exec-progress-text';
|
|
7463
|
+
progressText.textContent = (model.progressMessage || model.rawText || '').trim() || '思考中,正在了解你的需求';
|
|
7464
|
+
progressRow.appendChild(progressText);
|
|
7465
|
+
// 箭头图标
|
|
7466
|
+
var arrowIcon = document.createElement('span');
|
|
7467
|
+
arrowIcon.className = 'cl-exec-progress-arrow';
|
|
7468
|
+
arrowIcon.innerHTML = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M5 4L9 7L5 10" stroke="#555" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
7469
|
+
progressRow.appendChild(arrowIcon);
|
|
7470
|
+
content.appendChild(progressRow);
|
|
7471
|
+
if (model.status === 'completed') progressRow.style.display = 'none';
|
|
7166
7472
|
|
|
7167
7473
|
// ── 异步更新真实 Agent 身份 ──
|
|
7168
7474
|
if ((model.agentId || model.agentName) && typeof fetchAgentById === 'function') {
|
|
7169
7475
|
fetchAgentById(model.agentId, model.agentName).then(function(agent) {
|
|
7170
7476
|
if (!agent) return;
|
|
7171
|
-
var
|
|
7172
|
-
var
|
|
7173
|
-
|
|
7174
|
-
|
|
7175
|
-
|
|
7176
|
-
|
|
7177
|
-
|
|
7178
|
-
|
|
7179
|
-
|
|
7180
|
-
}
|
|
7181
|
-
_clSetAgentPillName(container, agent.name || model.agentName);
|
|
7477
|
+
var avatarEl = container.querySelector('.cl-exec-agent-avatar');
|
|
7478
|
+
var nameEl = container.querySelector('.cl-exec-agent-name');
|
|
7479
|
+
var bioEl = container.querySelector('.cl-exec-agent-bio');
|
|
7480
|
+
// avatar 保持 icon.png,不覆盖
|
|
7481
|
+
if (nameEl) nameEl.textContent = agent.name || model.agentName;
|
|
7482
|
+
if (bioEl && (agent.bio || agent.description)) bioEl.textContent = agent.bio || agent.description;
|
|
7483
|
+
var starsEl = container.querySelector('.cl-exec-star-count');
|
|
7484
|
+
if (starsEl && agent.claws) starsEl.textContent = _cl_formatStarCount(agent.claws);
|
|
7485
|
+
if (starsEl && agent.stars && !agent.claws) starsEl.textContent = _cl_formatStarCount(agent.stars);
|
|
7182
7486
|
_clSetOpenAgentHeaderAgent(container, agent.name || model.agentName);
|
|
7183
7487
|
}).catch(function() {});
|
|
7184
7488
|
}
|
|
@@ -7187,40 +7491,103 @@ function _clRenderExecutionCard(model) {
|
|
|
7187
7491
|
_cl_applyCardUiState(container, model);
|
|
7188
7492
|
}
|
|
7189
7493
|
|
|
7190
|
-
console.log('[cl-exec]
|
|
7494
|
+
console.log('[cl-exec] execution card built');
|
|
7191
7495
|
return container;
|
|
7192
7496
|
}
|
|
7193
7497
|
|
|
7498
|
+
// ── Agent 详情卡片(Figma 266:11136) ──
|
|
7499
|
+
function _clCreateAgentDetailCard(model) {
|
|
7500
|
+
var card = document.createElement('div');
|
|
7501
|
+
card.className = 'cl-exec-detail-card';
|
|
7502
|
+
|
|
7503
|
+
var row = document.createElement('div');
|
|
7504
|
+
row.className = 'cl-exec-detail-row';
|
|
7505
|
+
|
|
7506
|
+
// 头像 68×68
|
|
7507
|
+
var avatar = document.createElement('img');
|
|
7508
|
+
avatar.className = 'cl-exec-agent-avatar';
|
|
7509
|
+
avatar.alt = model.agentName || '';
|
|
7510
|
+
avatar.src = './icon.png';
|
|
7511
|
+
avatar.onerror = function() { this.style.visibility = 'hidden'; };
|
|
7512
|
+
row.appendChild(avatar);
|
|
7513
|
+
|
|
7514
|
+
// 信息列
|
|
7515
|
+
var info = document.createElement('div');
|
|
7516
|
+
info.className = 'cl-exec-detail-info';
|
|
7517
|
+
|
|
7518
|
+
// 名称行:名称 + 星级徽章
|
|
7519
|
+
var nameRow = document.createElement('div');
|
|
7520
|
+
nameRow.className = 'cl-exec-name-row';
|
|
7521
|
+
|
|
7522
|
+
var nameEl = document.createElement('p');
|
|
7523
|
+
nameEl.className = 'cl-exec-agent-name';
|
|
7524
|
+
nameEl.textContent = model.agentName || 'Remote Agent';
|
|
7525
|
+
nameRow.appendChild(nameEl);
|
|
7526
|
+
|
|
7527
|
+
// 星级徽章
|
|
7528
|
+
var starBadge = document.createElement('div');
|
|
7529
|
+
starBadge.className = 'cl-exec-star-badge';
|
|
7530
|
+
var starSvgOutline = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1.16L8.356 5.33H12.78L9.195 7.94L10.565 12.1L7 9.51L3.435 12.1L4.805 7.94L1.22 5.33H5.644L7 1.16Z" stroke="#999" stroke-width="0.8"/></svg>';
|
|
7531
|
+
starBadge.innerHTML = starSvgOutline +
|
|
7532
|
+
'<span class="cl-exec-star-count">' + (model.agentStars || '3.2万') + '</span>';
|
|
7533
|
+
nameRow.appendChild(starBadge);
|
|
7534
|
+
info.appendChild(nameRow);
|
|
7535
|
+
|
|
7536
|
+
var bioEl = document.createElement('p');
|
|
7537
|
+
bioEl.className = 'cl-exec-agent-bio';
|
|
7538
|
+
bioEl.textContent = model.agentBio || '智能行程规划·定制每日行程·优化路线安排';
|
|
7539
|
+
info.appendChild(bioEl);
|
|
7540
|
+
|
|
7541
|
+
row.appendChild(info);
|
|
7542
|
+
card.appendChild(row);
|
|
7543
|
+
|
|
7544
|
+
return card;
|
|
7545
|
+
}
|
|
7546
|
+
|
|
7194
7547
|
// ── 共用 DOM 构建函数 ──
|
|
7195
7548
|
|
|
7196
7549
|
function _clCreateOpenAgentHeader(model) {
|
|
7197
7550
|
var header = document.createElement('div');
|
|
7198
7551
|
header.className = 'cl-openagent-header';
|
|
7552
|
+
if (model._outputMode) header.classList.add('cl-openagent-header--output');
|
|
7199
7553
|
header.style.cursor = 'pointer';
|
|
7200
7554
|
|
|
7201
|
-
|
|
7202
|
-
|
|
7203
|
-
|
|
7204
|
-
|
|
7205
|
-
|
|
7206
|
-
|
|
7207
|
-
|
|
7208
|
-
|
|
7209
|
-
|
|
7210
|
-
|
|
7211
|
-
var
|
|
7212
|
-
|
|
7213
|
-
|
|
7214
|
-
|
|
7215
|
-
|
|
7216
|
-
|
|
7217
|
-
|
|
7218
|
-
|
|
7219
|
-
|
|
7220
|
-
|
|
7221
|
-
|
|
7222
|
-
|
|
7223
|
-
|
|
7555
|
+
// 展开/收起图标
|
|
7556
|
+
var expandIcon = document.createElement('span');
|
|
7557
|
+
expandIcon.className = 'cl-openagent-expand-icon';
|
|
7558
|
+
// 收起态三角(向右)
|
|
7559
|
+
expandIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M9.75 6.79978C10.0833 6.99223 10.0833 7.47336 9.75 7.66581L6.75 9.39786C6.41667 9.59031 6 9.34975 6 8.96485L6 5.50075C6 5.11585 6.41667 4.87528 6.75 5.06773L9.75 6.79978Z" fill="#666666"/></svg>';
|
|
7560
|
+
// 展开态三角(向下)
|
|
7561
|
+
var expandedSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M8.43313 8.98291C8.24068 9.31624 7.75955 9.31624 7.5671 8.98291L5.83505 5.98291C5.6426 5.64958 5.88316 5.23291 6.26806 5.23291L9.73216 5.23291C10.1171 5.23291 10.3576 5.64958 10.1652 5.98291L8.43313 8.98291Z" fill="#666666"/></svg>';
|
|
7562
|
+
header.appendChild(expandIcon);
|
|
7563
|
+
|
|
7564
|
+
// OASN 小图标
|
|
7565
|
+
var oasnBadge = document.createElement('span');
|
|
7566
|
+
oasnBadge.className = 'cl-openagent-badge';
|
|
7567
|
+
oasnBadge.style.backgroundImage = "url(./icon.png)";
|
|
7568
|
+
oasnBadge.style.backgroundSize = 'cover';
|
|
7569
|
+
header.appendChild(oasnBadge);
|
|
7570
|
+
|
|
7571
|
+
// 文字行
|
|
7572
|
+
var textRow = document.createElement('span');
|
|
7573
|
+
textRow.className = 'cl-openagent-text-row';
|
|
7574
|
+
|
|
7575
|
+
var labelOpenAgent = document.createElement('span');
|
|
7576
|
+
labelOpenAgent.className = 'cl-openagent-label';
|
|
7577
|
+
labelOpenAgent.textContent = 'OpenAgent';
|
|
7578
|
+
textRow.appendChild(labelOpenAgent);
|
|
7579
|
+
|
|
7580
|
+
var labelAgent = document.createElement('span');
|
|
7581
|
+
labelAgent.className = 'cl-openagent-agent';
|
|
7582
|
+
labelAgent.textContent = '@' + (model.agentName || 'Remote Agent');
|
|
7583
|
+
textRow.appendChild(labelAgent);
|
|
7584
|
+
|
|
7585
|
+
var labelStatus = document.createElement('span');
|
|
7586
|
+
labelStatus.className = 'cl-openagent-status';
|
|
7587
|
+
labelStatus.textContent = (model.status === 'completed') ? '执行已完成' : '正在执行任务';
|
|
7588
|
+
textRow.appendChild(labelStatus);
|
|
7589
|
+
|
|
7590
|
+
header.appendChild(textRow);
|
|
7224
7591
|
|
|
7225
7592
|
// 点击 header 折叠/展开卡片内容
|
|
7226
7593
|
header.addEventListener('click', function(e) {
|
|
@@ -7230,7 +7597,10 @@ function _clCreateOpenAgentHeader(model) {
|
|
|
7230
7597
|
var content = card.querySelector('.cl-thought-chain-content');
|
|
7231
7598
|
if (!content) return;
|
|
7232
7599
|
var isCollapsed = content.classList.toggle('cl-content-collapsed');
|
|
7233
|
-
|
|
7600
|
+
// 切换图标
|
|
7601
|
+
expandIcon.innerHTML = isCollapsed
|
|
7602
|
+
? '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M9.75 6.79978C10.0833 6.99223 10.0833 7.47336 9.75 7.66581L6.75 9.39786C6.41667 9.59031 6 9.34975 6 8.96485L6 5.50075C6 5.11585 6.41667 4.87528 6.75 5.06773L9.75 6.79978Z" fill="#666666"/></svg>'
|
|
7603
|
+
: '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M8.43313 8.98291C8.24068 9.31624 7.75955 9.31624 7.5671 8.98291L5.83505 5.98291C5.6426 5.64958 5.88316 5.23291 6.26806 5.23291L9.73216 5.23291C10.1171 5.23291 10.3576 5.64958 10.1652 5.98291L8.43313 8.98291Z" fill="#666666"/></svg>';
|
|
7234
7604
|
if (typeof _cl_setCardUiState === 'function') {
|
|
7235
7605
|
_cl_setCardUiState(model, { contentCollapsed: isCollapsed });
|
|
7236
7606
|
}
|
|
@@ -7240,8 +7610,8 @@ function _clCreateOpenAgentHeader(model) {
|
|
|
7240
7610
|
}
|
|
7241
7611
|
|
|
7242
7612
|
function _clSetOpenAgentHeaderAgent(container, agentName) {
|
|
7243
|
-
var
|
|
7244
|
-
if (
|
|
7613
|
+
var label = container && container.querySelector('.cl-openagent-agent');
|
|
7614
|
+
if (label) label.textContent = '@' + (agentName || 'Remote Agent');
|
|
7245
7615
|
}
|
|
7246
7616
|
|
|
7247
7617
|
function _clCreateAgentPill(agentName, agentId, agentAvatar) {
|
|
@@ -7263,7 +7633,7 @@ function _clCreateAgentPill(agentName, agentId, agentAvatar) {
|
|
|
7263
7633
|
console.log('[cl-diag][pill] create agentName=' + JSON.stringify(agentName || '')
|
|
7264
7634
|
+ ' agentId=' + JSON.stringify(agentId || '')
|
|
7265
7635
|
+ ' src=' + JSON.stringify(avatar.getAttribute('src')));
|
|
7266
|
-
avatar.onerror = function() { this.style.
|
|
7636
|
+
avatar.onerror = function() { this.style.visibility = 'hidden'; };
|
|
7267
7637
|
pill.appendChild(avatar);
|
|
7268
7638
|
|
|
7269
7639
|
var nameEl = document.createElement('span');
|
|
@@ -7322,6 +7692,224 @@ function _clCreateStepElement(step, isLatest) {
|
|
|
7322
7692
|
return item;
|
|
7323
7693
|
}
|
|
7324
7694
|
|
|
7695
|
+
|
|
7696
|
+
// ── 动态更新 header 状态文字 ──
|
|
7697
|
+
function _clUpdateAgentStatusText(cardNode, status) {
|
|
7698
|
+
var label = cardNode && cardNode.querySelector('.cl-openagent-status');
|
|
7699
|
+
if (label) label.textContent = (status === 'completed') ? '执行已完成' : '正在执行任务';
|
|
7700
|
+
var progressRow = cardNode && cardNode.querySelector('.cl-exec-progress-row');
|
|
7701
|
+
if (progressRow) progressRow.style.display = (status === 'completed') ? 'none' : '';
|
|
7702
|
+
}
|
|
7703
|
+
|
|
7704
|
+
function _cl_formatStarCount(count) {
|
|
7705
|
+
var n = Number(count);
|
|
7706
|
+
if (!isFinite(n)) return '3.2万';
|
|
7707
|
+
if (n >= 10000) return (n / 10000).toFixed(1).replace(/.0$/, '') + '万';
|
|
7708
|
+
if (n >= 1000) return (n / 1000).toFixed(1).replace(/.0$/, '') + 'k';
|
|
7709
|
+
return String(Math.floor(n));
|
|
7710
|
+
}
|
|
7711
|
+
|
|
7712
|
+
// ═══════════════════════════════════════════════════════════════
|
|
7713
|
+
// V2 执行卡片渲染(2026.6.9+ 新版 UI)
|
|
7714
|
+
// ═══════════════════════════════════════════════════════════════
|
|
7715
|
+
|
|
7716
|
+
function _clRenderExecutionCardV2(model) {
|
|
7717
|
+
var container = document.createElement('div');
|
|
7718
|
+
container.className = 'cl-remote-agent-card cl-thought-chain cl-exec-v2';
|
|
7719
|
+
if (CL && typeof CL.diagMarkCard === 'function') {
|
|
7720
|
+
CL.diagMarkCard(container, 'execution', { tcid: model.toolCallId || '' });
|
|
7721
|
+
}
|
|
7722
|
+
|
|
7723
|
+
container.appendChild(_clCreateOpenAgentHeaderV2(model));
|
|
7724
|
+
|
|
7725
|
+
var content = document.createElement('div');
|
|
7726
|
+
content.className = 'cl-thought-chain-content cl-thought-chain-content--execution cl-content-collapsed';
|
|
7727
|
+
container.appendChild(content);
|
|
7728
|
+
|
|
7729
|
+
// ── Agent 详情卡片 V2 ──
|
|
7730
|
+
try {
|
|
7731
|
+
var detailCard = _clCreateAgentDetailCardV2(model);
|
|
7732
|
+
content.appendChild(detailCard);
|
|
7733
|
+
} catch(e) {
|
|
7734
|
+
console.warn('[cl-exec-v2] detail card creation failed:', e);
|
|
7735
|
+
}
|
|
7736
|
+
|
|
7737
|
+
// ── 进度文字 V2 ──
|
|
7738
|
+
var progressRow = document.createElement('div');
|
|
7739
|
+
progressRow.className = 'cl-exec-progress-row cl-exec-progress-row-v2';
|
|
7740
|
+
var progressText = document.createElement('p');
|
|
7741
|
+
progressText.className = 'cl-exec-progress-text';
|
|
7742
|
+
progressText.textContent = (model.progressMessage || model.rawText || '').trim() || '思考中,正在了解你的需求';
|
|
7743
|
+
progressRow.appendChild(progressText);
|
|
7744
|
+
var arrowIcon = document.createElement('span');
|
|
7745
|
+
arrowIcon.className = 'cl-exec-progress-arrow';
|
|
7746
|
+
arrowIcon.innerHTML = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M5 4L9 7L5 10" stroke="#555" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/></svg>';
|
|
7747
|
+
progressRow.appendChild(arrowIcon);
|
|
7748
|
+
content.appendChild(progressRow);
|
|
7749
|
+
if (model.status === 'completed') progressRow.style.display = 'none';
|
|
7750
|
+
|
|
7751
|
+
// ── 步骤列表容器(供 _cl_updateCardSteps 使用)──
|
|
7752
|
+
var stepsHeader = document.createElement('div');
|
|
7753
|
+
stepsHeader.className = 'cl-tools-collapse-header cl-tools-collapse-header-v2';
|
|
7754
|
+
var stepsHeaderIcon = document.createElement('span');
|
|
7755
|
+
stepsHeaderIcon.className = 'cl-tools-collapse-header-icon';
|
|
7756
|
+
stepsHeaderIcon.textContent = '▼';
|
|
7757
|
+
stepsHeader.appendChild(stepsHeaderIcon);
|
|
7758
|
+
var stepsHeaderTitle = document.createElement('span');
|
|
7759
|
+
stepsHeaderTitle.className = 'cl-tools-collapse-header-title cl-tools-collapse-header-title-v2';
|
|
7760
|
+
stepsHeaderTitle.textContent = '思考中...';
|
|
7761
|
+
stepsHeader.appendChild(stepsHeaderTitle);
|
|
7762
|
+
content.appendChild(stepsHeader);
|
|
7763
|
+
|
|
7764
|
+
var stepsBody = document.createElement('div');
|
|
7765
|
+
stepsBody.className = 'cl-tools-collapse-body cl-tools-collapse-body-v2 cl-expanded';
|
|
7766
|
+
content.appendChild(stepsBody);
|
|
7767
|
+
|
|
7768
|
+
// ─ Footer(Figma: -由xxx完成 + 星级)──
|
|
7769
|
+
var footer = document.createElement('div');
|
|
7770
|
+
footer.className = 'cl-output-footer cl-output-footer-v2';
|
|
7771
|
+
footer.innerHTML = '<span class="cl-output-footer-text">-由' + (model.agentName || 'Remote Agent') + '完成</span>'
|
|
7772
|
+
+ '<span class="cl-output-footer-star"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1.16L8.356 5.33H12.78L9.195 7.94L10.565 12.1L7 9.51L3.435 12.1L4.805 7.94L1.22 5.33H5.644L7 1.16Z" stroke="#999" stroke-width="0.8"/></svg></span>'
|
|
7773
|
+
+ '<span class="cl-output-footer-count">' + (model.agentStars || '3.2万') + '</span>';
|
|
7774
|
+
container.appendChild(footer);
|
|
7775
|
+
|
|
7776
|
+
// ── 异步更新真实 Agent 身份 ──
|
|
7777
|
+
if ((model.agentId || model.agentName) && typeof fetchAgentById === 'function') {
|
|
7778
|
+
fetchAgentById(model.agentId, model.agentName).then(function(agent) {
|
|
7779
|
+
if (!agent) return;
|
|
7780
|
+
var avatarEl = container.querySelector('.cl-exec-agent-avatar-v2');
|
|
7781
|
+
var nameEl = container.querySelector('.cl-exec-agent-name-v2');
|
|
7782
|
+
var bioEl = container.querySelector('.cl-exec-agent-bio-v2');
|
|
7783
|
+
if (nameEl) nameEl.textContent = agent.name || model.agentName;
|
|
7784
|
+
if (bioEl && (agent.bio || agent.description)) bioEl.textContent = agent.bio || agent.description;
|
|
7785
|
+
var starsEl = container.querySelector('.cl-exec-star-count-v2');
|
|
7786
|
+
if (starsEl && agent.claws) starsEl.textContent = _cl_formatStarCount(agent.claws);
|
|
7787
|
+
if (starsEl && agent.stars && !agent.claws) starsEl.textContent = _cl_formatStarCount(agent.stars);
|
|
7788
|
+
}).catch(function() {});
|
|
7789
|
+
}
|
|
7790
|
+
|
|
7791
|
+
if (typeof _cl_applyCardUiState === 'function') {
|
|
7792
|
+
_cl_applyCardUiState(container, model);
|
|
7793
|
+
}
|
|
7794
|
+
|
|
7795
|
+
console.log('[cl-exec-v2] execution card built');
|
|
7796
|
+
return container;
|
|
7797
|
+
}
|
|
7798
|
+
|
|
7799
|
+
// ── V2 Header(粉色背景 + 圆形头像 + 无 @agentName)──
|
|
7800
|
+
function _clCreateOpenAgentHeaderV2(model) {
|
|
7801
|
+
var header = document.createElement('div');
|
|
7802
|
+
header.className = 'cl-openagent-header cl-openagent-header-v2';
|
|
7803
|
+
if (model._outputMode) header.classList.add('cl-openagent-header--output');
|
|
7804
|
+
header.style.cursor = 'pointer';
|
|
7805
|
+
|
|
7806
|
+
// 展开/收起图标
|
|
7807
|
+
var expandIcon = document.createElement('span');
|
|
7808
|
+
expandIcon.className = 'cl-openagent-expand-icon';
|
|
7809
|
+
expandIcon.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M9.75 6.79978C10.0833 6.99223 10.0833 7.47336 9.75 7.66581L6.75 9.39786C6.41667 9.59031 6 9.34975 6 8.96485L6 5.50075C6 5.11585 6.41667 4.87528 6.75 5.06773L9.75 6.79978Z" fill="#666666"/></svg>';
|
|
7810
|
+
var expandedSvg = '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M8.43313 8.98291C8.24068 9.31624 7.75955 9.31624 7.5671 8.98291L5.83505 5.98291C5.6426 5.64958 5.88316 5.23291 6.26806 5.23291L9.73216 5.23291C10.1171 5.23291 10.3576 5.64958 10.1652 5.98291L8.43313 8.98291Z" fill="#666666"/></svg>';
|
|
7811
|
+
header.appendChild(expandIcon);
|
|
7812
|
+
|
|
7813
|
+
// 圆形灰色头像(替代小徽章)
|
|
7814
|
+
var avatar = document.createElement('span');
|
|
7815
|
+
avatar.className = 'cl-openagent-avatar-v2';
|
|
7816
|
+
header.appendChild(avatar);
|
|
7817
|
+
|
|
7818
|
+
// 文字行:OpenAgent + 状态文字(去掉 @agentName)
|
|
7819
|
+
var textRow = document.createElement('span');
|
|
7820
|
+
textRow.className = 'cl-openagent-text-row';
|
|
7821
|
+
|
|
7822
|
+
var labelOpenAgent = document.createElement('span');
|
|
7823
|
+
labelOpenAgent.className = 'cl-openagent-label';
|
|
7824
|
+
labelOpenAgent.textContent = 'OpenAgent';
|
|
7825
|
+
textRow.appendChild(labelOpenAgent);
|
|
7826
|
+
|
|
7827
|
+
var labelStatus = document.createElement('span');
|
|
7828
|
+
labelStatus.className = 'cl-openagent-status';
|
|
7829
|
+
labelStatus.textContent = (model.status === 'completed') ? '执行已完成' : '正在执行任务';
|
|
7830
|
+
textRow.appendChild(labelStatus);
|
|
7831
|
+
|
|
7832
|
+
header.appendChild(textRow);
|
|
7833
|
+
|
|
7834
|
+
// 点击 header 折叠/展开卡片内容
|
|
7835
|
+
header.addEventListener('click', function(e) {
|
|
7836
|
+
e.stopPropagation();
|
|
7837
|
+
var card = header.closest('.cl-remote-agent-card');
|
|
7838
|
+
if (!card) return;
|
|
7839
|
+
var content = card.querySelector('.cl-thought-chain-content');
|
|
7840
|
+
if (!content) return;
|
|
7841
|
+
var isCollapsed = content.classList.toggle('cl-content-collapsed');
|
|
7842
|
+
expandIcon.innerHTML = isCollapsed
|
|
7843
|
+
? '<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 15 15" fill="none"><path d="M9.75 6.79978C10.0833 6.99223 10.0833 7.47336 9.75 7.66581L6.75 9.39786C6.41667 9.59031 6 9.34975 6 8.96485L6 5.50075C6 5.11585 6.41667 4.87528 6.75 5.06773L9.75 6.79978Z" fill="#666666"/></svg>'
|
|
7844
|
+
: expandedSvg;
|
|
7845
|
+
if (typeof _cl_setCardUiState === 'function') {
|
|
7846
|
+
_cl_setCardUiState(model, { contentCollapsed: isCollapsed });
|
|
7847
|
+
}
|
|
7848
|
+
});
|
|
7849
|
+
|
|
7850
|
+
return header;
|
|
7851
|
+
}
|
|
7852
|
+
|
|
7853
|
+
// ─ V2 Agent 详情卡片(大头像 + 右置星级 + 网格点背景)──
|
|
7854
|
+
function _clCreateAgentDetailCardV2(model) {
|
|
7855
|
+
var card = document.createElement('div');
|
|
7856
|
+
card.className = 'cl-exec-detail-card cl-exec-detail-card-v2';
|
|
7857
|
+
|
|
7858
|
+
var row = document.createElement('div');
|
|
7859
|
+
row.className = 'cl-exec-detail-row cl-exec-detail-row-v2';
|
|
7860
|
+
|
|
7861
|
+
// 大头像 80×80
|
|
7862
|
+
var avatar = document.createElement('img');
|
|
7863
|
+
avatar.className = 'cl-exec-agent-avatar cl-exec-agent-avatar-v2';
|
|
7864
|
+
avatar.alt = model.agentName || '';
|
|
7865
|
+
avatar.src = './icon.png';
|
|
7866
|
+
avatar.onerror = function() { this.style.visibility = 'hidden'; };
|
|
7867
|
+
row.appendChild(avatar);
|
|
7868
|
+
|
|
7869
|
+
// 信息列
|
|
7870
|
+
var info = document.createElement('div');
|
|
7871
|
+
info.className = 'cl-exec-detail-info cl-exec-detail-info-v2';
|
|
7872
|
+
|
|
7873
|
+
// 名称(无星级徽章,星级右置到卡片右上角)
|
|
7874
|
+
var nameEl = document.createElement('p');
|
|
7875
|
+
nameEl.className = 'cl-exec-agent-name cl-exec-agent-name-v2';
|
|
7876
|
+
nameEl.textContent = model.agentName || 'Remote Agent';
|
|
7877
|
+
info.appendChild(nameEl);
|
|
7878
|
+
|
|
7879
|
+
// 描述文字
|
|
7880
|
+
var bioEl = document.createElement('p');
|
|
7881
|
+
bioEl.className = 'cl-exec-agent-bio cl-exec-agent-bio-v2';
|
|
7882
|
+
bioEl.textContent = model.agentBio || '智能行程规划·定制每日行程·优化路线安排';
|
|
7883
|
+
info.appendChild(bioEl);
|
|
7884
|
+
|
|
7885
|
+
row.appendChild(info);
|
|
7886
|
+
card.appendChild(row);
|
|
7887
|
+
|
|
7888
|
+
// 星级徽章右置到卡片右上角
|
|
7889
|
+
var starBadge = document.createElement('div');
|
|
7890
|
+
starBadge.className = 'cl-exec-star-badge cl-exec-star-badge-v2';
|
|
7891
|
+
var starSvgOutline = '<svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1.16L8.356 5.33H12.78L9.195 7.94L10.565 12.1L7 9.51L3.435 12.1L4.805 7.94L1.22 5.33H5.644L7 1.16Z" stroke="#999" stroke-width="0.8"/></svg>';
|
|
7892
|
+
starBadge.innerHTML = starSvgOutline +
|
|
7893
|
+
'<span class="cl-exec-star-count cl-exec-star-count-v2">' + (model.agentStars || '3.2万') + '</span>';
|
|
7894
|
+
card.appendChild(starBadge);
|
|
7895
|
+
|
|
7896
|
+
return card;
|
|
7897
|
+
}
|
|
7898
|
+
|
|
7899
|
+
// ── V2 状态文字更新 ──
|
|
7900
|
+
function _clUpdateAgentStatusTextV2(cardNode, status) {
|
|
7901
|
+
var label = cardNode && cardNode.querySelector('.cl-openagent-status');
|
|
7902
|
+
if (label) label.textContent = (status === 'completed') ? '执行已完成' : '正在执行任务';
|
|
7903
|
+
// 进度文字行:完成后隐藏
|
|
7904
|
+
var progressRow = cardNode && cardNode.querySelector('.cl-exec-progress-row-v2');
|
|
7905
|
+
if (progressRow) progressRow.style.display = (status === 'completed') ? 'none' : '';
|
|
7906
|
+
// 步骤列表:完成后隐藏
|
|
7907
|
+
var stepsBody = cardNode && cardNode.querySelector('.cl-tools-collapse-body-v2');
|
|
7908
|
+
if (stepsBody) stepsBody.style.display = (status === 'completed') ? 'none' : '';
|
|
7909
|
+
var stepsHeader = cardNode && cardNode.querySelector('.cl-tools-collapse-header-v2');
|
|
7910
|
+
if (stepsHeader) stepsHeader.style.display = (status === 'completed') ? 'none' : '';
|
|
7911
|
+
}
|
|
7912
|
+
|
|
7325
7913
|
// ════════════════════════════════════════════════════════════════
|
|
7326
7914
|
// MODULE: remote-agent/markdown-renderer.js
|
|
7327
7915
|
// ════════════════════════════════════════════════════════════════
|
|
@@ -7779,11 +8367,20 @@ function _clRenderOutputCard(model, onOpenSidebar) {
|
|
|
7779
8367
|
}
|
|
7780
8368
|
}
|
|
7781
8369
|
|
|
8370
|
+
// ── V2 版本判断 ──
|
|
8371
|
+
var isV2 = typeof _clIsHostVersionGte === 'function' && _clIsHostVersionGte('2026.6.9');
|
|
8372
|
+
|
|
7782
8373
|
if (resultTexts.length === 0 && mediaLinks.length === 0) {
|
|
7783
8374
|
var placeholder = document.createElement('span');
|
|
7784
8375
|
placeholder.className = 'cl-remote-agent-card cl-remote-agent-output-placeholder';
|
|
7785
8376
|
placeholder.style.display = 'none';
|
|
7786
8377
|
placeholder.__clEmptyOutput = true;
|
|
8378
|
+
// 防止 OpenClaw native 代码读 .textContent 报 undefined.trim()
|
|
8379
|
+
var hiddenText = document.createElement('span');
|
|
8380
|
+
hiddenText.className = 'chat-text';
|
|
8381
|
+
hiddenText.style.display = 'none';
|
|
8382
|
+
hiddenText.textContent = '';
|
|
8383
|
+
placeholder.appendChild(hiddenText);
|
|
7787
8384
|
if (model.toolCallId) {
|
|
7788
8385
|
placeholder.dataset.clCardTcid = model.toolCallId;
|
|
7789
8386
|
}
|
|
@@ -7792,34 +8389,54 @@ function _clRenderOutputCard(model, onOpenSidebar) {
|
|
|
7792
8389
|
}
|
|
7793
8390
|
|
|
7794
8391
|
var container = document.createElement('div');
|
|
7795
|
-
|
|
8392
|
+
var cardClasses = 'cl-remote-agent-card cl-thought-chain cl-output-card'
|
|
7796
8393
|
+ (resultTexts.length > 0 ? ' cl-output-card--pending' : '');
|
|
8394
|
+
if (isV2) cardClasses += ' cl-exec-v2';
|
|
8395
|
+
container.className = cardClasses;
|
|
7797
8396
|
container.dataset.clCardRole = 'output';
|
|
8397
|
+
// 防止 OpenClaw native 代码读 .textContent 报 undefined.trim()
|
|
8398
|
+
var safetyText = document.createElement('div');
|
|
8399
|
+
safetyText.className = 'chat-text';
|
|
8400
|
+
safetyText.style.display = 'none';
|
|
8401
|
+
safetyText.textContent = '';
|
|
8402
|
+
container.appendChild(safetyText);
|
|
8403
|
+
if (model.toolCallId) container.dataset.clCardTcid = model.toolCallId;
|
|
8404
|
+
// 阻止点击冒泡到原生 tool card handler
|
|
8405
|
+
container.addEventListener('click', function(e) { e.stopPropagation(); });
|
|
7798
8406
|
if (CL && typeof CL.diagMarkCard === 'function') {
|
|
7799
8407
|
CL.diagMarkCard(container, 'output', { tcid: model.toolCallId || '' });
|
|
7800
8408
|
}
|
|
7801
8409
|
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
if (
|
|
7805
|
-
|
|
8410
|
+
model._outputMode = true;
|
|
8411
|
+
model.status = 'completed';
|
|
8412
|
+
if (isV2) {
|
|
8413
|
+
var v2Header = _clCreateOpenAgentHeaderV2(model);
|
|
8414
|
+
v2Header.classList.remove('cl-openagent-header--output');
|
|
8415
|
+
container.appendChild(v2Header);
|
|
8416
|
+
if (typeof _clUpdateAgentStatusTextV2 === 'function') {
|
|
8417
|
+
_clUpdateAgentStatusTextV2(container, 'completed');
|
|
8418
|
+
}
|
|
8419
|
+
} else {
|
|
8420
|
+
var shellHeader = _clCreateOpenAgentHeader(model);
|
|
8421
|
+
container.appendChild(shellHeader);
|
|
8422
|
+
if (typeof _clSetOpenAgentHeaderAgent === 'function') {
|
|
8423
|
+
_clSetOpenAgentHeaderAgent(container, model.agentName || model.agentId || 'Remote Agent');
|
|
8424
|
+
}
|
|
7806
8425
|
}
|
|
7807
8426
|
|
|
7808
8427
|
var content = document.createElement('div');
|
|
7809
8428
|
content.className = 'cl-thought-chain-content';
|
|
7810
8429
|
container.appendChild(content);
|
|
7811
8430
|
|
|
7812
|
-
// ── Agent
|
|
7813
|
-
|
|
7814
|
-
|
|
7815
|
-
|
|
7816
|
-
|
|
7817
|
-
|
|
7818
|
-
|
|
7819
|
-
|
|
7820
|
-
|
|
7821
|
-
divider.className = 'cl-thought-chain-divider';
|
|
7822
|
-
content.appendChild(divider);
|
|
8431
|
+
// ── V2 Agent 详情卡片 ──
|
|
8432
|
+
if (isV2) {
|
|
8433
|
+
try {
|
|
8434
|
+
var detailCard = _clCreateAgentDetailCardV2(model);
|
|
8435
|
+
content.appendChild(detailCard);
|
|
8436
|
+
} catch(e) {
|
|
8437
|
+
console.warn('[cl-output-v2] detail card creation failed:', e);
|
|
8438
|
+
}
|
|
8439
|
+
}
|
|
7823
8440
|
|
|
7824
8441
|
// ── 附件下载链接 ──
|
|
7825
8442
|
if (mediaLinks.length > 0 && typeof _clCreateOpenagentMediaLinksSection === 'function') {
|
|
@@ -7864,12 +8481,23 @@ function _clRenderOutputCard(model, onOpenSidebar) {
|
|
|
7864
8481
|
}
|
|
7865
8482
|
|
|
7866
8483
|
// ── onOpenSidebar 支持:点击展开到侧边栏 ──
|
|
7867
|
-
|
|
8484
|
+
// 宿主 sidebar 渲染器要求 content 为 { kind: 'markdown', content, rawText } 对象,
|
|
8485
|
+
// kind 必须为 'markdown' 才会进入 markdown 渲染路径,否则显示 "No previewable markdown content."。
|
|
8486
|
+
// travel card 标签(<sh_card>等)sidebar 原生 markdown 解析不认,先 strip 再传。
|
|
8487
|
+
var sidebarRaw = resultText || model.rawText || '';
|
|
8488
|
+
var sidebarText = String(sidebarRaw).replace(/<\/?[a-z]+_card[^>]*>/gi, '');
|
|
8489
|
+
if (typeof _clStripSuppressedTravelTags === 'function') {
|
|
8490
|
+
sidebarText = _clStripSuppressedTravelTags(sidebarText);
|
|
8491
|
+
}
|
|
8492
|
+
if (onOpenSidebar && sidebarText.trim()) {
|
|
7868
8493
|
container.style.cursor = 'pointer';
|
|
7869
8494
|
container.addEventListener('click', function(e) {
|
|
7870
|
-
// 不拦截折叠/展开点击
|
|
7871
8495
|
if (e.target.closest('.cl-tools-collapse-header')) return;
|
|
7872
|
-
onOpenSidebar(
|
|
8496
|
+
onOpenSidebar({ kind: 'markdown', content: sidebarText, rawText: sidebarText });
|
|
8497
|
+
setTimeout(function() {
|
|
8498
|
+
var titleEl = document.querySelector('.chat-sidebar .sidebar-title');
|
|
8499
|
+
if (titleEl) titleEl.textContent = 'OpenAgent @' + (model.agentName || 'Remote Agent');
|
|
8500
|
+
}, 100);
|
|
7873
8501
|
});
|
|
7874
8502
|
}
|
|
7875
8503
|
|
|
@@ -7877,18 +8505,18 @@ function _clRenderOutputCard(model, onOpenSidebar) {
|
|
|
7877
8505
|
if ((model.agentId || model.agentName) && typeof fetchAgentById === 'function') {
|
|
7878
8506
|
fetchAgentById(model.agentId, model.agentName).then(function(agent) {
|
|
7879
8507
|
if (!agent) return;
|
|
7880
|
-
|
|
7881
|
-
|
|
7882
|
-
|
|
7883
|
-
var
|
|
7884
|
-
|
|
7885
|
-
|
|
7886
|
-
|
|
7887
|
-
|
|
7888
|
-
|
|
8508
|
+
if (isV2) {
|
|
8509
|
+
var avatarElV2 = container.querySelector('.cl-exec-agent-avatar-v2');
|
|
8510
|
+
var nameElV2 = container.querySelector('.cl-exec-agent-name-v2');
|
|
8511
|
+
var bioElV2 = container.querySelector('.cl-exec-agent-bio-v2');
|
|
8512
|
+
if (nameElV2) nameElV2.textContent = agent.name || model.agentName;
|
|
8513
|
+
if (bioElV2 && (agent.bio || agent.description)) bioElV2.textContent = agent.bio || agent.description;
|
|
8514
|
+
var starsElV2 = container.querySelector('.cl-exec-star-count-v2');
|
|
8515
|
+
if (starsElV2 && agent.claws) starsElV2.textContent = _cl_formatStarCount(agent.claws);
|
|
8516
|
+
if (starsElV2 && agent.stars && !agent.claws) starsElV2.textContent = _cl_formatStarCount(agent.stars);
|
|
8517
|
+
} else {
|
|
8518
|
+
_clSetOpenAgentHeaderAgent(container, agent.name || model.agentName);
|
|
7889
8519
|
}
|
|
7890
|
-
_clSetAgentPillName(container, agent.name || model.agentName);
|
|
7891
|
-
_clSetOpenAgentHeaderAgent(container, agent.name || model.agentName);
|
|
7892
8520
|
}).catch(function() {});
|
|
7893
8521
|
}
|
|
7894
8522
|
|
|
@@ -7896,7 +8524,25 @@ function _clRenderOutputCard(model, onOpenSidebar) {
|
|
|
7896
8524
|
_cl_applyCardUiState(container, model);
|
|
7897
8525
|
}
|
|
7898
8526
|
|
|
7899
|
-
|
|
8527
|
+
// ── Footer ──
|
|
8528
|
+
if (isV2) {
|
|
8529
|
+
var footerV2 = document.createElement('div');
|
|
8530
|
+
footerV2.className = 'cl-output-footer cl-output-footer-v2';
|
|
8531
|
+
footerV2.innerHTML = '<span class="cl-output-footer-text">-由' + (model.agentName || 'Remote Agent') + '完成</span>'
|
|
8532
|
+
+ '<span class="cl-output-footer-star"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1.16L8.356 5.33H12.78L9.195 7.94L10.565 12.1L7 9.51L3.435 12.1L4.805 7.94L1.22 5.33H5.644L7 1.16Z" stroke="#999" stroke-width="0.8"/></svg></span>'
|
|
8533
|
+
+ '<span class="cl-output-footer-count">' + (model.agentStars || '3.2万') + '</span>';
|
|
8534
|
+
container.appendChild(footerV2);
|
|
8535
|
+
} else {
|
|
8536
|
+
// ── Footer(Figma 131:2091) ──
|
|
8537
|
+
var footer = document.createElement('div');
|
|
8538
|
+
footer.className = 'cl-output-footer';
|
|
8539
|
+
footer.innerHTML = '<span class="cl-output-footer-text">-由' + (model.agentName || 'Remote Agent') + '完成</span>'
|
|
8540
|
+
+ '<span class="cl-output-footer-star"><svg width="14" height="14" viewBox="0 0 14 14" fill="none"><path d="M7 1.16L8.356 5.33H12.78L9.195 7.94L10.565 12.1L7 9.51L3.435 12.1L4.805 7.94L1.22 5.33H5.644L7 1.16Z" stroke="#999" stroke-width="0.8"/></svg></span>'
|
|
8541
|
+
+ '<span class="cl-output-footer-count">' + (model.agentStars || '3.2万') + '</span>';
|
|
8542
|
+
container.appendChild(footer);
|
|
8543
|
+
}
|
|
8544
|
+
|
|
8545
|
+
console.log('[cl-output] ✅ output card built: results=' + resultTexts.length + ' v2=' + isV2);
|
|
7900
8546
|
return container;
|
|
7901
8547
|
}
|
|
7902
8548
|
|
|
@@ -8020,6 +8666,8 @@ function _clScheduleOutputCardProcessing(resultSection, model) {
|
|
|
8020
8666
|
setTimeout(run, 0);
|
|
8021
8667
|
}
|
|
8022
8668
|
|
|
8669
|
+
// ── Sidebar Figma 145:5712 内联样式 ──
|
|
8670
|
+
|
|
8023
8671
|
// ════════════════════════════════════════════════════════════════
|
|
8024
8672
|
// MODULE: remote-agent/render-hooks.js
|
|
8025
8673
|
// ════════════════════════════════════════════════════════════════
|
|
@@ -8039,8 +8687,14 @@ var __cl_toolStates = new Map();
|
|
|
8039
8687
|
// 每个 entry: { steps: [], phase: 'active'|'completed', cardNode: null, args: {} }
|
|
8040
8688
|
|
|
8041
8689
|
var __cl_lastCallModel = null; // 同一 render cycle 里 call card 的 model(供 result card 读取 agent 身份)
|
|
8042
|
-
var __cl_outputCardCache = new Map();
|
|
8043
|
-
var
|
|
8690
|
+
var __cl_outputCardCache = new Map(); // toolCallId → cached output DOM
|
|
8691
|
+
var __cl_executionCardCache = new Map(); // toolCallId → cached historical execution DOM
|
|
8692
|
+
var __cl_cardUiStates = new Map(); // execution/output 展开状态,避免 OpenClaw rerender 覆盖用户操作
|
|
8693
|
+
var __cl_progressMessageMap = new Map(); // toolCallId → 动态进度文字(来自 response.progress?.safe_status_message)
|
|
8694
|
+
|
|
8695
|
+
// ── 诊断:渲染频率计数器 ──
|
|
8696
|
+
var __clDiag = { renderCalls: 0, lastDiagTs: 0, version: 'v4-oneshot-20260630' };
|
|
8697
|
+
console.log('[cl-diag] render-hooks loaded, version=' + __clDiag.version);
|
|
8044
8698
|
|
|
8045
8699
|
var CL_REMOTE_AGENT_PROGRESS_MODE_TRAVEL_TITLE = 'travel-title';
|
|
8046
8700
|
var CL_REMOTE_AGENT_PROGRESS_MODE_GENERIC_STREAM = 'generic-stream';
|
|
@@ -8336,6 +8990,16 @@ function _cl_ensureRemoteToolState(toolCallId, data, rawText) {
|
|
|
8336
8990
|
// ═══════════════════════════════════════════════════════════════
|
|
8337
8991
|
|
|
8338
8992
|
window.__openagentRenderToolCard = function(card, onOpenSidebar) {
|
|
8993
|
+
// ── 诊断:渲染频率计数器 ──
|
|
8994
|
+
__clDiag.renderCalls++;
|
|
8995
|
+
var diagNow = Date.now();
|
|
8996
|
+
if (diagNow - __clDiag.lastDiagTs > 2000) {
|
|
8997
|
+
var rps = (__clDiag.renderCalls / ((diagNow - __clDiag.lastDiagTs) / 1000)).toFixed(1);
|
|
8998
|
+
console.log('[cl-diag] render rate: ' + rps + ' calls/sec, total=' + __clDiag.renderCalls + ', version=' + __clDiag.version);
|
|
8999
|
+
__clDiag.renderCalls = 0;
|
|
9000
|
+
__clDiag.lastDiagTs = diagNow;
|
|
9001
|
+
}
|
|
9002
|
+
|
|
8339
9003
|
var n = (card && card.name || '').toLowerCase();
|
|
8340
9004
|
var cardTcid = card && (card.toolCallId || '');
|
|
8341
9005
|
var cardKind = typeof _clInferToolCardKind === 'function' ? _clInferToolCardKind(card) : (card && card.kind || '');
|
|
@@ -8373,19 +9037,34 @@ window.__openagentRenderToolCard = function(card, onOpenSidebar) {
|
|
|
8373
9037
|
}
|
|
8374
9038
|
if (state.phase === 'active') {
|
|
8375
9039
|
model.status = 'executing';
|
|
9040
|
+
if (typeof _clUpdateAgentStatusTextV2 === 'function' && state.cardNode && state.cardNode.classList.contains('cl-exec-v2')) {
|
|
9041
|
+
_clUpdateAgentStatusTextV2(state.cardNode, 'executing');
|
|
9042
|
+
} else if (typeof _clUpdateAgentStatusText === 'function') {
|
|
9043
|
+
_clUpdateAgentStatusText(state.cardNode, 'executing');
|
|
9044
|
+
}
|
|
8376
9045
|
}
|
|
8377
9046
|
// 有 streaming 状态 — 复用或新建
|
|
8378
9047
|
if (state.cardNode) {
|
|
8379
9048
|
// Lit 重复调用会复用同一个 DOM 节点;但 OpenClaw 外层 native
|
|
8380
9049
|
// <details> 可能被 rerender 成 closed。这里重新打开的是外层原生
|
|
8381
|
-
// details
|
|
9050
|
+
// details,不影响卡片内部的”思考中/思考完成”折叠状态。
|
|
8382
9051
|
_cl_applyCardUiState(state.cardNode, { toolCallId: tcid, cardKind: 'call' });
|
|
8383
9052
|
if (state.phase === 'active') {
|
|
8384
9053
|
_cl_autoOpenStepsIfUncontrolled(state.cardNode);
|
|
8385
9054
|
}
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
9055
|
+
// ── 更新进度文字:来自 response.progress?.safe_status_message ──
|
|
9056
|
+
var progressEl = state.cardNode.querySelector('.cl-exec-progress-text');
|
|
9057
|
+
if (progressEl && model.rawText) {
|
|
9058
|
+
var msg = (model.rawText || '').trim();
|
|
9059
|
+
if (msg) progressEl.textContent = msg;
|
|
9060
|
+
}
|
|
9061
|
+
// ── 一次性外壳初始化:首次渲染时打开 native details + 隐藏 raw text,之后永久跳过 ──
|
|
9062
|
+
if (!state.cardNode.__clShellReady) {
|
|
9063
|
+
state.cardNode.__clShellReady = true;
|
|
9064
|
+
_cl_forceOpenNativeToolDetails(state.cardNode, 'execution-cache', tcid);
|
|
9065
|
+
if (typeof _cl_scheduleHostShellMark === 'function') _cl_scheduleHostShellMark(state.cardNode);
|
|
9066
|
+
_cl_hideHostRawText(state.cardNode);
|
|
9067
|
+
}
|
|
8389
9068
|
return state.cardNode;
|
|
8390
9069
|
}
|
|
8391
9070
|
|
|
@@ -8423,6 +9102,20 @@ window.__openagentRenderToolCard = function(card, onOpenSidebar) {
|
|
|
8423
9102
|
|
|
8424
9103
|
// 无状态 → 刷新/历史态。前端 store 如果有同一 toolCallId 的卡片快照,
|
|
8425
9104
|
// 就用快照参数重建 steps;没有 store 时仍展示完成态外壳。
|
|
9105
|
+
|
|
9106
|
+
// 缓存:历史态 execution card 只创建一次,Lit 重复调用时复用(与 output card 逻辑一致)
|
|
9107
|
+
var cachedExecution = tcid ? __cl_executionCardCache.get(tcid) : null;
|
|
9108
|
+
if (cachedExecution && cachedExecution.isConnected) {
|
|
9109
|
+
_cl_applyCardUiState(cachedExecution, { toolCallId: tcid, cardKind: 'call' });
|
|
9110
|
+
if (!cachedExecution.__clShellReady) {
|
|
9111
|
+
cachedExecution.__clShellReady = true;
|
|
9112
|
+
_cl_forceOpenNativeToolDetails(cachedExecution, 'execution-history-cache', tcid);
|
|
9113
|
+
if (typeof _cl_scheduleHostShellMark === 'function') _cl_scheduleHostShellMark(cachedExecution);
|
|
9114
|
+
_cl_hideHostRawText(cachedExecution);
|
|
9115
|
+
}
|
|
9116
|
+
return cachedExecution;
|
|
9117
|
+
}
|
|
9118
|
+
|
|
8426
9119
|
var storedCallRecord = tcid && typeof _clRemoteAgentProgressStore !== 'undefined' && _clRemoteAgentProgressStore
|
|
8427
9120
|
? _clRemoteAgentProgressStore.get(tcid)
|
|
8428
9121
|
: null;
|
|
@@ -8439,10 +9132,16 @@ window.__openagentRenderToolCard = function(card, onOpenSidebar) {
|
|
|
8439
9132
|
model.cardKind = 'call';
|
|
8440
9133
|
model.status = 'completed';
|
|
8441
9134
|
var historyNode = _clRenderExecutionCard(model);
|
|
9135
|
+
if (historyNode && historyNode.classList && historyNode.classList.contains('cl-exec-v2')) {
|
|
9136
|
+
if (typeof _clUpdateAgentStatusTextV2 === 'function') _clUpdateAgentStatusTextV2(historyNode, 'completed');
|
|
9137
|
+
} else if (typeof _clUpdateAgentStatusText === 'function') {
|
|
9138
|
+
_clUpdateAgentStatusText(historyNode, 'completed');
|
|
9139
|
+
}
|
|
8442
9140
|
_cl_finalizeCard(historyNode, model._bufferedSteps || []);
|
|
8443
9141
|
_cl_forceOpenNativeToolDetails(historyNode, 'execution-history', tcid);
|
|
8444
9142
|
if (typeof _cl_scheduleHostShellMark === 'function') _cl_scheduleHostShellMark(historyNode);
|
|
8445
9143
|
_cl_hideHostRawText(historyNode);
|
|
9144
|
+
if (tcid) __cl_executionCardCache.set(tcid, historyNode);
|
|
8446
9145
|
console.log('[cl-render] 🗂️ built historical call card, tcid=' + tcid.substring(0, 8));
|
|
8447
9146
|
return historyNode;
|
|
8448
9147
|
}
|
|
@@ -8495,9 +9194,13 @@ window.__openagentRenderToolCard = function(card, onOpenSidebar) {
|
|
|
8495
9194
|
var cachedOutput = resTcid ? __cl_outputCardCache.get(resTcid) : null;
|
|
8496
9195
|
if (cachedOutput && cachedOutput.isConnected) {
|
|
8497
9196
|
_cl_applyCardUiState(cachedOutput, { toolCallId: resTcid, cardKind: 'result' });
|
|
8498
|
-
|
|
8499
|
-
if (
|
|
8500
|
-
|
|
9197
|
+
// ── 一次性外壳初始化:首次渲染时打开 native details + 隐藏 raw text,之后永久跳过 ──
|
|
9198
|
+
if (!cachedOutput.__clShellReady) {
|
|
9199
|
+
cachedOutput.__clShellReady = true;
|
|
9200
|
+
_cl_forceOpenNativeToolDetails(cachedOutput, 'output-cache', resTcid);
|
|
9201
|
+
if (typeof _cl_scheduleHostShellMark === 'function') _cl_scheduleHostShellMark(cachedOutput);
|
|
9202
|
+
_cl_hideHostRawText(cachedOutput);
|
|
9203
|
+
}
|
|
8501
9204
|
return cachedOutput;
|
|
8502
9205
|
}
|
|
8503
9206
|
|
|
@@ -8580,6 +9283,8 @@ function _cl_replayBufferedSteps(toolCallId, state) {
|
|
|
8580
9283
|
|
|
8581
9284
|
function _cl_hideHostRawText(cardNode) {
|
|
8582
9285
|
if (!cardNode) return;
|
|
9286
|
+
// 幂等性守卫:如果父链已经标记为隐藏,跳过重复操作
|
|
9287
|
+
if (cardNode.closest && cardNode.closest('.cl-remote-agent-raw-hidden')) return;
|
|
8583
9288
|
function hide() {
|
|
8584
9289
|
var hosts = _cl_collectRawTextHosts(cardNode);
|
|
8585
9290
|
for (var h = 0; h < hosts.length; h++) {
|
|
@@ -8589,10 +9294,7 @@ function _cl_hideHostRawText(cardNode) {
|
|
|
8589
9294
|
hide();
|
|
8590
9295
|
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(hide);
|
|
8591
9296
|
setTimeout(hide, 0);
|
|
8592
|
-
setTimeout(hide,
|
|
8593
|
-
setTimeout(hide, 250);
|
|
8594
|
-
setTimeout(hide, 800);
|
|
8595
|
-
setTimeout(hide, 2000);
|
|
9297
|
+
setTimeout(hide, 200);
|
|
8596
9298
|
}
|
|
8597
9299
|
|
|
8598
9300
|
function _cl_isRemoteToolNameText(text) {
|
|
@@ -8826,8 +9528,6 @@ function _cl_forceOpenNativeToolDetails(node, source, tcid) {
|
|
|
8826
9528
|
// openNearest 是幂等的(已 open 不重复操作),不需要防抖。
|
|
8827
9529
|
openNearest();
|
|
8828
9530
|
if (typeof requestAnimationFrame === 'function') requestAnimationFrame(openNearest);
|
|
8829
|
-
setTimeout(openNearest, 0);
|
|
8830
|
-
setTimeout(openNearest, 80);
|
|
8831
9531
|
setTimeout(openNearest, 300); // 兜底:慢速 Lit render / 异步 wrapper 挂载
|
|
8832
9532
|
}
|
|
8833
9533
|
|
|
@@ -8921,6 +9621,12 @@ function _cl_applyStoredRecordToModel(model, record) {
|
|
|
8921
9621
|
if (!model.agentAvatar) {
|
|
8922
9622
|
model.agentAvatar = args.agent_avatar || args.agentAvatar || args.avatar || args.avatar_url || args.avatarUrl || null;
|
|
8923
9623
|
}
|
|
9624
|
+
if (!model.agentBio) {
|
|
9625
|
+
model.agentBio = args.agent_bio || args.agentBio || '';
|
|
9626
|
+
}
|
|
9627
|
+
if (!model.agentStars) {
|
|
9628
|
+
model.agentStars = args.agent_stars || args.agentStars || '3.2万';
|
|
9629
|
+
}
|
|
8924
9630
|
var identity = CL && typeof CL.getAgentIdentity === 'function'
|
|
8925
9631
|
? CL.getAgentIdentity(model.agentId, model.agentName)
|
|
8926
9632
|
: null;
|
|
@@ -9326,8 +10032,6 @@ function _cl_updateCardSteps(card, steps) {
|
|
|
9326
10032
|
var stepEl = _clCreateStepElement(steps[i], i === steps.length - 1);
|
|
9327
10033
|
body.appendChild(stepEl);
|
|
9328
10034
|
}
|
|
9329
|
-
|
|
9330
|
-
_cl_forceOpenNativeToolDetails(card, 'steps-update', card.dataset && card.dataset.clCardTcid || '');
|
|
9331
10035
|
}
|
|
9332
10036
|
|
|
9333
10037
|
function _cl_autoOpenStepsIfUncontrolled(card) {
|
|
@@ -9335,7 +10039,11 @@ function _cl_autoOpenStepsIfUncontrolled(card) {
|
|
|
9335
10039
|
var uiState = _cl_getCardUiState(card);
|
|
9336
10040
|
if (uiState && uiState.stepsExpanded !== undefined) return;
|
|
9337
10041
|
|
|
9338
|
-
|
|
10042
|
+
// 缓存 body 引用,避免 5-16Hz Lit rerender 时重复 querySelector
|
|
10043
|
+
if (!card.__clStepsBody) {
|
|
10044
|
+
card.__clStepsBody = card.querySelector('.cl-tools-collapse-body');
|
|
10045
|
+
}
|
|
10046
|
+
var body = card.__clStepsBody;
|
|
9339
10047
|
if (!body) return;
|
|
9340
10048
|
|
|
9341
10049
|
body.classList.remove('cl-collapsed');
|
|
@@ -9390,6 +10098,11 @@ function _cl_countChunkTypes(chunks) {
|
|
|
9390
10098
|
}
|
|
9391
10099
|
|
|
9392
10100
|
function _cl_finalizeCard(card, steps) {
|
|
10101
|
+
if (card && card.classList && card.classList.contains('cl-exec-v2')) {
|
|
10102
|
+
if (typeof _clUpdateAgentStatusTextV2 === 'function') _clUpdateAgentStatusTextV2(card, 'completed');
|
|
10103
|
+
} else if (typeof _clUpdateAgentStatusText === 'function') {
|
|
10104
|
+
_clUpdateAgentStatusText(card, 'completed');
|
|
10105
|
+
}
|
|
9393
10106
|
var header = card.querySelector('.cl-tools-collapse-header-title');
|
|
9394
10107
|
if (header) {
|
|
9395
10108
|
header.textContent = '思考完成';
|
|
@@ -9400,6 +10113,20 @@ function _cl_finalizeCard(card, steps) {
|
|
|
9400
10113
|
dots[i].className = 'cl-tools-collapse-step-check';
|
|
9401
10114
|
}
|
|
9402
10115
|
|
|
10116
|
+
// 执行完成后隐藏第一个 chat-bubble(execution card),仅保留 output card
|
|
10117
|
+
// 仅 V2 启用:V1 的 output card 布局不同,不宜隐藏 execution bubble
|
|
10118
|
+
var isV2Finalize = typeof _clIsHostVersionGte === 'function' && _clIsHostVersionGte('2026.6.9');
|
|
10119
|
+
if (isV2Finalize && card && !card.__clBubbleHidden) {
|
|
10120
|
+
card.__clBubbleHidden = true;
|
|
10121
|
+
var bubble = card.closest && card.closest('.chat-bubble');
|
|
10122
|
+
if (bubble) {
|
|
10123
|
+
// 延迟隐藏,等 output card(第二个 bubble)渲染完毕
|
|
10124
|
+
setTimeout(function() {
|
|
10125
|
+
bubble.style.display = 'none';
|
|
10126
|
+
}, 500);
|
|
10127
|
+
}
|
|
10128
|
+
}
|
|
10129
|
+
|
|
9403
10130
|
// Finalize 只负责把 execution card 标记为完成态。
|
|
9404
10131
|
// 不在这里强制折叠 steps:OpenClaw 会周期性 rerender,若 finalize 每次都
|
|
9405
10132
|
// 写 cl-collapsed,会覆盖用户手动展开后的状态。
|
|
@@ -9645,7 +10372,7 @@ var _clObserverTarget = null;
|
|
|
9645
10372
|
|
|
9646
10373
|
const _clObserver = new MutationObserver(() => {
|
|
9647
10374
|
if (_clDebounceTimer) clearTimeout(_clDebounceTimer);
|
|
9648
|
-
_clDebounceTimer = setTimeout(_debouncedClScan,
|
|
10375
|
+
_clDebounceTimer = setTimeout(_debouncedClScan, 300); // Debounce to reduce DOM churn feedback loops
|
|
9649
10376
|
});
|
|
9650
10377
|
|
|
9651
10378
|
function _debouncedClScan() {
|