listpage-next 0.0.271 → 0.0.273
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/features/ChatClient/ui/Bubble/Bubble.js +1 -2
- package/dist/features/ChatClient/ui/Bubble/index.d.ts +0 -2
- package/dist/features/ChatClient/ui/Bubble/index.js +0 -2
- package/dist/features/ChatClient/ui/Markdown/base/Reasoning.d.ts +5 -0
- package/dist/features/ChatClient/ui/Markdown/base/Reasoning.js +110 -0
- package/dist/features/ChatClient/ui/Markdown/components/CodeComponent.d.ts +1 -0
- package/dist/features/ChatClient/ui/Markdown/components/CodeComponent.js +38 -0
- package/dist/features/ChatClient/ui/Markdown/components/PlaceholderComponent.d.ts +1 -0
- package/dist/features/ChatClient/ui/Markdown/components/PlaceholderComponent.js +62 -0
- package/dist/features/ChatClient/ui/Markdown/components/ThinkConponent.d.ts +2 -0
- package/dist/features/ChatClient/ui/Markdown/components/ThinkConponent.js +22 -0
- package/dist/features/ChatClient/ui/{Bubble/Markdown.d.ts → Markdown/index.d.ts} +1 -0
- package/dist/features/ChatClient/ui/{Bubble/Markdown.js → Markdown/index.js} +11 -56
- package/dist/features/ChatClient/ui/Markdown/styles/CodeComponent.styles.d.ts +11 -0
- package/dist/features/ChatClient/ui/Markdown/styles/CodeComponent.styles.js +77 -0
- package/dist/features/ChatClient/ui/TracePanel/DataTable.d.ts +7 -0
- package/dist/features/ChatClient/ui/TracePanel/DataTable.js +71 -0
- package/dist/features/ChatClient/ui/TracePanel/Popover.d.ts +6 -0
- package/dist/features/ChatClient/ui/TracePanel/Popover.js +32 -0
- package/dist/features/ChatClient/ui/TracePanel/TodoList.d.ts +13 -0
- package/dist/features/ChatClient/ui/TracePanel/TodoList.js +102 -0
- package/dist/features/ChatClient/ui/TracePanel/ToolCallList.d.ts +8 -0
- package/dist/features/ChatClient/ui/TracePanel/ToolCallList.js +153 -0
- package/dist/features/ChatClient/ui/TracePanel/TracePanel.d.ts +10 -0
- package/dist/features/ChatClient/ui/TracePanel/TracePanel.js +60 -0
- package/dist/features/ChatClient/ui/TracePanel/index.d.ts +2 -0
- package/dist/features/ChatClient/ui/TracePanel/index.js +3 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/DataTable.styles.d.ts +10 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/DataTable.styles.js +81 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/TodoList.styles.d.ts +22 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/TodoList.styles.js +164 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/ToolCallList.styles.d.ts +21 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/ToolCallList.styles.js +158 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/TraceLog.styles.d.ts +8 -0
- package/dist/features/ChatClient/ui/TracePanel/styles/TraceLog.styles.js +65 -0
- package/dist/features/ChatClient/ui/TracePanel/transform.d.ts +18 -0
- package/dist/features/ChatClient/ui/TracePanel/transform.js +46 -0
- package/dist/features/ChatClient/ui/index.d.ts +2 -0
- package/dist/features/ChatClient/ui/index.js +2 -0
- package/dist/ui.css +26 -0
- package/package.json +1 -1
|
@@ -2,8 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useRef } from "react";
|
|
3
3
|
import { useHover } from "ahooks";
|
|
4
4
|
import styled_components from "styled-components";
|
|
5
|
-
import { Markdown } from "
|
|
6
|
-
import { Reasoning } from "./Reasoning.js";
|
|
5
|
+
import { Markdown, Reasoning } from "../Markdown/index.js";
|
|
7
6
|
import { ReferenceList } from "./ReferenceList.js";
|
|
8
7
|
const Bubble = (props)=>{
|
|
9
8
|
const { className, content, reasoning_content, extra, feedback, markdownRender, reasoningMarkdownRender = markdownRender, references, suggests, role = 'user', status, placement = 'user' === role ? 'end' : 'start', showFeedback = (hovered)=>hovered } = props;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowsAltOutlined, ShrinkOutlined } from "@ant-design/icons";
|
|
3
|
+
import { memo, useEffect, useState } from "react";
|
|
4
|
+
import { styled } from "styled-components";
|
|
5
|
+
const Reasoning = /*#__PURE__*/ memo(({ thinking, children })=>{
|
|
6
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
if (!thinking) setCollapsed(true);
|
|
9
|
+
}, [
|
|
10
|
+
thinking
|
|
11
|
+
]);
|
|
12
|
+
return /*#__PURE__*/ jsxs(ReasoningContainer, {
|
|
13
|
+
style: {
|
|
14
|
+
padding: collapsed ? '6px 12px' : '0px 12px 13px 12px',
|
|
15
|
+
backgroundColor: collapsed ? void 0 : '#fff',
|
|
16
|
+
...collapsed && {
|
|
17
|
+
maxWidth: 240
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsxs(ReasoningHeader, {
|
|
22
|
+
onClick: ()=>setCollapsed(!collapsed),
|
|
23
|
+
style: {
|
|
24
|
+
padding: collapsed ? '0' : '7px 0px',
|
|
25
|
+
height: collapsed ? 42 : 56
|
|
26
|
+
},
|
|
27
|
+
children: [
|
|
28
|
+
/*#__PURE__*/ jsx(ReasoningTitle, {
|
|
29
|
+
children: thinking ? /*#__PURE__*/ jsx(ReasoningTitleAnimation, {
|
|
30
|
+
children: "深度思考中"
|
|
31
|
+
}) : '已完成思考'
|
|
32
|
+
}),
|
|
33
|
+
/*#__PURE__*/ jsx(ReasoningIcon, {
|
|
34
|
+
children: collapsed ? /*#__PURE__*/ jsx(ArrowsAltOutlined, {}) : /*#__PURE__*/ jsx(ShrinkOutlined, {})
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
}),
|
|
38
|
+
!collapsed && /*#__PURE__*/ jsx(ReasoningContent, {
|
|
39
|
+
children: children
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
const ReasoningContainer = styled.div`
|
|
45
|
+
background-color: #fff;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
border: 1px solid #ebebeb;
|
|
48
|
+
border-radius: 12px;
|
|
49
|
+
transition: height 0.3s ease-in-out;
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: #0000000a;
|
|
52
|
+
}
|
|
53
|
+
width: 100%;
|
|
54
|
+
|
|
55
|
+
& > * {
|
|
56
|
+
box-sizing: border-box;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
const ReasoningHeader = styled.div`
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: space-between;
|
|
63
|
+
`;
|
|
64
|
+
const ReasoningContent = styled.div`
|
|
65
|
+
color: #00000080 !important;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
`;
|
|
68
|
+
const ReasoningTitle = styled.div`
|
|
69
|
+
color: #000c;
|
|
70
|
+
font-size: 14px;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
`;
|
|
73
|
+
const ReasoningIcon = styled.div`
|
|
74
|
+
align-items: center;
|
|
75
|
+
border: 1px solid #00000014;
|
|
76
|
+
border-radius: 8px;
|
|
77
|
+
display: flex;
|
|
78
|
+
height: 28px;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
padding: 5px 8px;
|
|
81
|
+
width: 28px;
|
|
82
|
+
box-sizing: border-box;
|
|
83
|
+
&:hover {
|
|
84
|
+
background-color: #0000000a;
|
|
85
|
+
}
|
|
86
|
+
`;
|
|
87
|
+
const ReasoningTitleAnimation = styled.span`
|
|
88
|
+
/* 文字流光动画 */
|
|
89
|
+
@keyframes textShine {
|
|
90
|
+
to {
|
|
91
|
+
background-position: 200% center;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
background: linear-gradient(
|
|
96
|
+
90deg,
|
|
97
|
+
#3b82f6,
|
|
98
|
+
#93c5fd,
|
|
99
|
+
#3b82f6,
|
|
100
|
+
#93c5fd,
|
|
101
|
+
#3b82f6
|
|
102
|
+
);
|
|
103
|
+
background-size: 200% auto;
|
|
104
|
+
color: #000;
|
|
105
|
+
background-clip: text;
|
|
106
|
+
-webkit-background-clip: text;
|
|
107
|
+
-webkit-text-fill-color: transparent;
|
|
108
|
+
animation: textShine 3s linear infinite;
|
|
109
|
+
`;
|
|
110
|
+
export { Reasoning };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Code: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Container, ContentArea, Dot, DotsContainer, Header, Pre, SnippetLabel, SnippetLabelContainer } from "../styles/CodeComponent.styles.js";
|
|
3
|
+
const Code = (props)=>/*#__PURE__*/ jsxs(Container, {
|
|
4
|
+
children: [
|
|
5
|
+
/*#__PURE__*/ jsxs(Header, {
|
|
6
|
+
children: [
|
|
7
|
+
/*#__PURE__*/ jsxs(DotsContainer, {
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx(Dot, {
|
|
10
|
+
$bgColor: "#ff5f56",
|
|
11
|
+
$borderColor: "rgba(224, 68, 62, 0.5)"
|
|
12
|
+
}),
|
|
13
|
+
/*#__PURE__*/ jsx(Dot, {
|
|
14
|
+
$bgColor: "#ffbd2e",
|
|
15
|
+
$borderColor: "rgba(222, 161, 35, 0.5)"
|
|
16
|
+
}),
|
|
17
|
+
/*#__PURE__*/ jsx(Dot, {
|
|
18
|
+
$bgColor: "#27c93f",
|
|
19
|
+
$borderColor: "rgba(26, 171, 41, 0.5)"
|
|
20
|
+
})
|
|
21
|
+
]
|
|
22
|
+
}),
|
|
23
|
+
/*#__PURE__*/ jsx(SnippetLabelContainer, {
|
|
24
|
+
className: "snippet-label",
|
|
25
|
+
children: /*#__PURE__*/ jsx(SnippetLabel, {
|
|
26
|
+
children: "Snippet"
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
]
|
|
30
|
+
}),
|
|
31
|
+
/*#__PURE__*/ jsx(ContentArea, {
|
|
32
|
+
children: /*#__PURE__*/ jsx(Pre, {
|
|
33
|
+
children: props.children
|
|
34
|
+
})
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
});
|
|
38
|
+
export { Code };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const Placeholder: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { styled } from "styled-components";
|
|
3
|
+
const Placeholder = ()=>/*#__PURE__*/ jsx(StyledPlaceholder, {
|
|
4
|
+
"data-type": "pending"
|
|
5
|
+
});
|
|
6
|
+
const StyledPlaceholder = styled.span`
|
|
7
|
+
placeholder[type='pending'] {
|
|
8
|
+
display: inline-block;
|
|
9
|
+
vertical-align: text-bottom;
|
|
10
|
+
width: 28px;
|
|
11
|
+
height: 100%;
|
|
12
|
+
position: relative;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
placeholder[type='pending']::after {
|
|
16
|
+
content: '';
|
|
17
|
+
display: inline-block;
|
|
18
|
+
width: 8px;
|
|
19
|
+
height: 8px;
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
background: rgba(0, 0, 0, 0.6);
|
|
22
|
+
box-shadow:
|
|
23
|
+
0 0 0 0 rgba(0, 0, 0, 0.6),
|
|
24
|
+
10px 0 0 0 rgba(0, 0, 0, 0.6),
|
|
25
|
+
20px 0 0 0 rgba(0, 0, 0, 0.6);
|
|
26
|
+
transform-origin: center;
|
|
27
|
+
will-change: transform, box-shadow, background;
|
|
28
|
+
animation: dotRolling 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@keyframes dotRolling {
|
|
32
|
+
0% {
|
|
33
|
+
background: rgba(0, 0, 0, 0.85);
|
|
34
|
+
box-shadow:
|
|
35
|
+
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
36
|
+
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
37
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
38
|
+
}
|
|
39
|
+
33% {
|
|
40
|
+
background: rgba(0, 0, 0, 0.55);
|
|
41
|
+
box-shadow:
|
|
42
|
+
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
43
|
+
10px 0 0 2px rgba(0, 0, 0, 0.85),
|
|
44
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
45
|
+
}
|
|
46
|
+
66% {
|
|
47
|
+
background: rgba(0, 0, 0, 0.55);
|
|
48
|
+
box-shadow:
|
|
49
|
+
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
50
|
+
10px 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
51
|
+
20px 0 0 2px rgba(0, 0, 0, 0.85);
|
|
52
|
+
}
|
|
53
|
+
100% {
|
|
54
|
+
background: rgba(0, 0, 0, 0.85);
|
|
55
|
+
box-shadow:
|
|
56
|
+
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
57
|
+
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
58
|
+
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
`;
|
|
62
|
+
export { Placeholder };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useEffect, useState } from "react";
|
|
3
|
+
import { Reasoning } from "../base/Reasoning.js";
|
|
4
|
+
import { styled } from "styled-components";
|
|
5
|
+
const Think = /*#__PURE__*/ memo(({ streamStatus, children })=>{
|
|
6
|
+
const [loading, setLoading] = useState(true);
|
|
7
|
+
useEffect(()=>{
|
|
8
|
+
if ('done' === streamStatus) setLoading(false);
|
|
9
|
+
}, [
|
|
10
|
+
streamStatus
|
|
11
|
+
]);
|
|
12
|
+
return /*#__PURE__*/ jsx(ReasoningContainer, {
|
|
13
|
+
children: /*#__PURE__*/ jsx(Reasoning, {
|
|
14
|
+
thinking: loading,
|
|
15
|
+
children: children
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
const ReasoningContainer = styled.div`
|
|
20
|
+
margin-bottom: 8px;
|
|
21
|
+
`;
|
|
22
|
+
export { Think };
|
|
@@ -2,8 +2,18 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import styled_components from "styled-components";
|
|
3
3
|
import x_markdown from "@ant-design/x-markdown";
|
|
4
4
|
import "@ant-design/x-markdown/themes/light.css";
|
|
5
|
+
import { Placeholder } from "./components/PlaceholderComponent.js";
|
|
6
|
+
import { Think } from "./components/ThinkConponent.js";
|
|
7
|
+
import { Code } from "./components/CodeComponent.js";
|
|
8
|
+
import { Reasoning } from "./base/Reasoning.js";
|
|
5
9
|
const Markdown = ({ hasNextChunk, ...props })=>/*#__PURE__*/ jsx(MarkdownBody, {
|
|
6
10
|
...props,
|
|
11
|
+
components: {
|
|
12
|
+
placeholder: Placeholder,
|
|
13
|
+
think: Think,
|
|
14
|
+
code: Code,
|
|
15
|
+
...props.components
|
|
16
|
+
},
|
|
7
17
|
streaming: {
|
|
8
18
|
enableAnimation: true,
|
|
9
19
|
hasNextChunk,
|
|
@@ -193,60 +203,5 @@ const MarkdownBody = styled_components(x_markdown)`
|
|
|
193
203
|
margin: 16px 0;
|
|
194
204
|
background: linear-gradient(to right, #e5e7eb, #cbd5e1, #e5e7eb);
|
|
195
205
|
}
|
|
196
|
-
|
|
197
|
-
placeholder[type='pending'] {
|
|
198
|
-
display: inline-block;
|
|
199
|
-
vertical-align: text-bottom;
|
|
200
|
-
width: 28px;
|
|
201
|
-
height: 100%;
|
|
202
|
-
position: relative;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
placeholder[type='pending']::after {
|
|
206
|
-
content: '';
|
|
207
|
-
display: inline-block;
|
|
208
|
-
width: 8px;
|
|
209
|
-
height: 8px;
|
|
210
|
-
border-radius: 50%;
|
|
211
|
-
background: rgba(0, 0, 0, 0.6);
|
|
212
|
-
box-shadow:
|
|
213
|
-
0 0 0 0 rgba(0, 0, 0, 0.6),
|
|
214
|
-
10px 0 0 0 rgba(0, 0, 0, 0.6),
|
|
215
|
-
20px 0 0 0 rgba(0, 0, 0, 0.6);
|
|
216
|
-
transform-origin: center;
|
|
217
|
-
will-change: transform, box-shadow, background;
|
|
218
|
-
animation: dotRolling 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
@keyframes dotRolling {
|
|
222
|
-
0% {
|
|
223
|
-
background: rgba(0, 0, 0, 0.85);
|
|
224
|
-
box-shadow:
|
|
225
|
-
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
226
|
-
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
227
|
-
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
228
|
-
}
|
|
229
|
-
33% {
|
|
230
|
-
background: rgba(0, 0, 0, 0.55);
|
|
231
|
-
box-shadow:
|
|
232
|
-
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
233
|
-
10px 0 0 2px rgba(0, 0, 0, 0.85),
|
|
234
|
-
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
235
|
-
}
|
|
236
|
-
66% {
|
|
237
|
-
background: rgba(0, 0, 0, 0.55);
|
|
238
|
-
box-shadow:
|
|
239
|
-
0 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
240
|
-
10px 0 0 -2px rgba(0, 0, 0, 0.45),
|
|
241
|
-
20px 0 0 2px rgba(0, 0, 0, 0.85);
|
|
242
|
-
}
|
|
243
|
-
100% {
|
|
244
|
-
background: rgba(0, 0, 0, 0.85);
|
|
245
|
-
box-shadow:
|
|
246
|
-
0 0 0 0 rgba(0, 0, 0, 0.85),
|
|
247
|
-
10px 0 0 0 rgba(0, 0, 0, 0.55),
|
|
248
|
-
20px 0 0 -2px rgba(0, 0, 0, 0.45);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
206
|
`;
|
|
252
|
-
export { Markdown };
|
|
207
|
+
export { Markdown, Reasoning };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const Container: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
|
+
export declare const Header: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
3
|
+
export declare const DotsContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
4
|
+
export declare const Dot: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
5
|
+
$bgColor: string;
|
|
6
|
+
$borderColor: string;
|
|
7
|
+
}>> & string;
|
|
8
|
+
export declare const SnippetLabelContainer: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
9
|
+
export declare const SnippetLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, never>> & string;
|
|
10
|
+
export declare const ContentArea: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
11
|
+
export declare const Pre: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLPreElement>, HTMLPreElement>, never>> & string;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import styled_components from "styled-components";
|
|
2
|
+
const Container = styled_components.div`
|
|
3
|
+
margin: 16px 0;
|
|
4
|
+
border-radius: 0.75rem;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
background-color: #1e1e1e;
|
|
7
|
+
box-shadow:
|
|
8
|
+
0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
9
|
+
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
10
|
+
border: 1px solid rgba(41, 37, 36, 0.5);
|
|
11
|
+
|
|
12
|
+
&:hover .snippet-label {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}
|
|
15
|
+
`;
|
|
16
|
+
const Header = styled_components.div`
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: space-between;
|
|
20
|
+
padding: 8px 12px;
|
|
21
|
+
background-color: #252526;
|
|
22
|
+
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
23
|
+
`;
|
|
24
|
+
const DotsContainer = styled_components.div`
|
|
25
|
+
display: flex;
|
|
26
|
+
gap: 6px;
|
|
27
|
+
`;
|
|
28
|
+
const Dot = styled_components.div`
|
|
29
|
+
width: 10px;
|
|
30
|
+
height: 10px;
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
background-color: ${(props)=>props.$bgColor};
|
|
33
|
+
border: 1px solid ${(props)=>props.$borderColor};
|
|
34
|
+
box-shadow: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
|
|
35
|
+
`;
|
|
36
|
+
const SnippetLabelContainer = styled_components.div`
|
|
37
|
+
opacity: 0;
|
|
38
|
+
transition: opacity 300ms;
|
|
39
|
+
`;
|
|
40
|
+
const SnippetLabel = styled_components.span`
|
|
41
|
+
font-size: 10px;
|
|
42
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
43
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
44
|
+
color: #78716c;
|
|
45
|
+
font-weight: 700;
|
|
46
|
+
text-transform: uppercase;
|
|
47
|
+
letter-spacing: 0.1em;
|
|
48
|
+
`;
|
|
49
|
+
const ContentArea = styled_components.div`
|
|
50
|
+
padding: 16px;
|
|
51
|
+
overflow-x: auto;
|
|
52
|
+
|
|
53
|
+
&::-webkit-scrollbar {
|
|
54
|
+
height: 8px;
|
|
55
|
+
width: 8px;
|
|
56
|
+
}
|
|
57
|
+
&::-webkit-scrollbar-track {
|
|
58
|
+
background: transparent;
|
|
59
|
+
}
|
|
60
|
+
&::-webkit-scrollbar-thumb {
|
|
61
|
+
background-color: #444;
|
|
62
|
+
border-radius: 4px;
|
|
63
|
+
}
|
|
64
|
+
&::-webkit-scrollbar-thumb:hover {
|
|
65
|
+
background-color: #555;
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
const Pre = styled_components.pre`
|
|
69
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
70
|
+
'Liberation Mono', 'Courier New', monospace;
|
|
71
|
+
font-size: 0.75rem;
|
|
72
|
+
line-height: 1.625;
|
|
73
|
+
color: #d6d3d1;
|
|
74
|
+
font-weight: 500;
|
|
75
|
+
margin: 0;
|
|
76
|
+
`;
|
|
77
|
+
export { Container, ContentArea, Dot, DotsContainer, Header, Pre, SnippetLabel, SnippetLabelContainer };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { Container, ErrorContainer, Footer, NullSpan, ScrollContainer, Table, Td, Th, Thead, Tr } from "./styles/DataTable.styles.js";
|
|
4
|
+
const DataTable = ({ data, columns: controlledColumns, className = '' })=>{
|
|
5
|
+
const { list, error } = useMemo(()=>{
|
|
6
|
+
try {
|
|
7
|
+
return {
|
|
8
|
+
list: JSON.parse(data) || [],
|
|
9
|
+
error: ''
|
|
10
|
+
};
|
|
11
|
+
} catch {
|
|
12
|
+
return {
|
|
13
|
+
error: data,
|
|
14
|
+
list: []
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
}, [
|
|
18
|
+
data
|
|
19
|
+
]);
|
|
20
|
+
const columns = useMemo(()=>{
|
|
21
|
+
if (!list || 0 === list.length) return [];
|
|
22
|
+
const keys = Object.keys(list[0]);
|
|
23
|
+
if (keys.includes('__index')) return [
|
|
24
|
+
'__index',
|
|
25
|
+
...keys.filter((k)=>'__index' !== k)
|
|
26
|
+
];
|
|
27
|
+
return keys;
|
|
28
|
+
}, [
|
|
29
|
+
list
|
|
30
|
+
]);
|
|
31
|
+
if (error || !data || 0 === data.length) return /*#__PURE__*/ jsx(ErrorContainer, {
|
|
32
|
+
className: className,
|
|
33
|
+
children: error || '无数据'
|
|
34
|
+
});
|
|
35
|
+
return /*#__PURE__*/ jsxs(Container, {
|
|
36
|
+
className: className,
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ jsx(ScrollContainer, {
|
|
39
|
+
children: /*#__PURE__*/ jsxs(Table, {
|
|
40
|
+
children: [
|
|
41
|
+
/*#__PURE__*/ jsx(Thead, {
|
|
42
|
+
children: /*#__PURE__*/ jsx("tr", {
|
|
43
|
+
children: (controlledColumns || columns).map((col)=>/*#__PURE__*/ jsx(Th, {
|
|
44
|
+
children: col
|
|
45
|
+
}, col))
|
|
46
|
+
})
|
|
47
|
+
}),
|
|
48
|
+
/*#__PURE__*/ jsx("tbody", {
|
|
49
|
+
children: list.map((row, rowIndex)=>/*#__PURE__*/ jsx(Tr, {
|
|
50
|
+
children: columns.map((col)=>/*#__PURE__*/ jsx(Td, {
|
|
51
|
+
title: String(row[col]),
|
|
52
|
+
children: null === row[col] ? /*#__PURE__*/ jsx(NullSpan, {
|
|
53
|
+
children: "null"
|
|
54
|
+
}) : String(row[col])
|
|
55
|
+
}, `${rowIndex}-${col}`))
|
|
56
|
+
}, rowIndex))
|
|
57
|
+
})
|
|
58
|
+
]
|
|
59
|
+
})
|
|
60
|
+
}),
|
|
61
|
+
/*#__PURE__*/ jsxs(Footer, {
|
|
62
|
+
children: [
|
|
63
|
+
"共 ",
|
|
64
|
+
list.length,
|
|
65
|
+
" 条记录"
|
|
66
|
+
]
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
export { DataTable };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Popover } from "antd";
|
|
3
|
+
import { TracePanel } from "./TracePanel.js";
|
|
4
|
+
import { Activity } from "lucide-react";
|
|
5
|
+
const TraceTrigger = ({ tool_calls, todos })=>/*#__PURE__*/ jsx(Popover, {
|
|
6
|
+
trigger: "click",
|
|
7
|
+
color: "transparent",
|
|
8
|
+
styles: {
|
|
9
|
+
body: {
|
|
10
|
+
width: 500,
|
|
11
|
+
background: 'transparent',
|
|
12
|
+
padding: 0
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
placement: "rightTop",
|
|
16
|
+
title: /*#__PURE__*/ jsx(TracePanel, {
|
|
17
|
+
data: {
|
|
18
|
+
tool_calls,
|
|
19
|
+
todos
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
23
|
+
className: "cursor-pointer flex items-center gap-1 p-1.5 text-slate-400 hover:text-emerald-600 hover:bg-emerald-50 rounded transition-colors",
|
|
24
|
+
children: [
|
|
25
|
+
/*#__PURE__*/ jsx(Activity, {
|
|
26
|
+
size: 12
|
|
27
|
+
}),
|
|
28
|
+
"运行过程"
|
|
29
|
+
]
|
|
30
|
+
})
|
|
31
|
+
});
|
|
32
|
+
export { TraceTrigger };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface TodoItem {
|
|
2
|
+
content: string;
|
|
3
|
+
status: 'pending' | 'in_progress' | 'completed';
|
|
4
|
+
}
|
|
5
|
+
interface TodoListProps {
|
|
6
|
+
items: TodoItem[];
|
|
7
|
+
title?: string;
|
|
8
|
+
defaultCollapsed?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
simple?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const TodoList: ({ items, title, defaultCollapsed, className, simple, }: TodoListProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|