@ai-group/chat-sdk 2.1.13 → 2.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/index.d.ts +1 -1
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/index.js +41 -5
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/index.js.map +2 -2
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/styles.d.ts +1 -0
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/styles.js +14 -3
- package/dist/cjs/components/XAdkChatbot/components/FunctionCallRender/styles.js.map +2 -2
- package/dist/cjs/components/XAdkChatbot/index.d.ts +1 -1
- package/dist/cjs/components/XAdkChatbot/index.js +30 -13
- package/dist/cjs/components/XAdkChatbot/index.js.map +3 -3
- package/dist/cjs/components/XAdkWebProvider/XAdkWebProvider.stories.d.ts +2 -2
- package/dist/cjs/components/XAdkWebProvider/XAdkWebProvider.stories.js +26 -9
- package/dist/cjs/components/XAdkWebProvider/XAdkWebProvider.stories.js.map +2 -2
- package/dist/cjs/components/XAiThoughtChain/XAiThoughtChain.stories.d.ts +6 -0
- package/dist/cjs/components/XAiThoughtChain/XAiThoughtChain.stories.js +180 -0
- package/dist/cjs/components/XAiThoughtChain/XAiThoughtChain.stories.js.map +7 -0
- package/dist/cjs/components/XAiThoughtChain/index.d.ts +4 -0
- package/dist/cjs/components/XAiThoughtChain/index.js +155 -0
- package/dist/cjs/components/XAiThoughtChain/index.js.map +7 -0
- package/dist/cjs/components/XAiThoughtChain/styles.d.ts +60 -0
- package/dist/cjs/components/XAiThoughtChain/styles.js +195 -0
- package/dist/cjs/components/XAiThoughtChain/styles.js.map +7 -0
- package/dist/cjs/hooks/useADKChat.d.ts +2 -2
- package/dist/cjs/hooks/useADKChat.js +228 -180
- package/dist/cjs/hooks/useADKChat.js.map +2 -2
- package/dist/cjs/types/XAiThoughtChain.d.ts +25 -0
- package/dist/cjs/types/XAiThoughtChain.js +18 -0
- package/dist/cjs/types/XAiThoughtChain.js.map +7 -0
- package/dist/cjs/types/index.d.ts +9 -8
- package/dist/cjs/types/index.js +2 -0
- package/dist/cjs/types/index.js.map +2 -2
- package/dist/cjs/utils/index.d.ts +1 -0
- package/dist/cjs/utils/index.js +7 -0
- package/dist/cjs/utils/index.js.map +2 -2
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/index.d.ts +1 -1
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/index.js +17 -15
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/index.js.map +1 -1
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/styles.d.ts +1 -0
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/styles.js +7 -6
- package/dist/esm/components/XAdkChatbot/components/FunctionCallRender/styles.js.map +1 -1
- package/dist/esm/components/XAdkChatbot/index.d.ts +1 -1
- package/dist/esm/components/XAdkChatbot/index.js +20 -18
- package/dist/esm/components/XAdkChatbot/index.js.map +1 -1
- package/dist/esm/components/XAdkWebProvider/XAdkWebProvider.stories.d.ts +2 -2
- package/dist/esm/components/XAdkWebProvider/XAdkWebProvider.stories.js +45 -40
- package/dist/esm/components/XAdkWebProvider/XAdkWebProvider.stories.js.map +1 -1
- package/dist/esm/components/XAiThoughtChain/XAiThoughtChain.stories.d.ts +6 -0
- package/dist/esm/components/XAiThoughtChain/XAiThoughtChain.stories.js +159 -0
- package/dist/esm/components/XAiThoughtChain/XAiThoughtChain.stories.js.map +1 -0
- package/dist/esm/components/XAiThoughtChain/index.d.ts +4 -0
- package/dist/esm/components/XAiThoughtChain/index.js +180 -0
- package/dist/esm/components/XAiThoughtChain/index.js.map +1 -0
- package/dist/esm/components/XAiThoughtChain/styles.d.ts +60 -0
- package/dist/esm/components/XAiThoughtChain/styles.js +40 -0
- package/dist/esm/components/XAiThoughtChain/styles.js.map +1 -0
- package/dist/esm/hooks/useADKChat.d.ts +2 -2
- package/dist/esm/hooks/useADKChat.js +59 -57
- package/dist/esm/hooks/useADKChat.js.map +1 -1
- package/dist/esm/types/XAiThoughtChain.d.ts +25 -0
- package/dist/esm/types/XAiThoughtChain.js +2 -0
- package/dist/esm/types/XAiThoughtChain.js.map +1 -0
- package/dist/esm/types/index.d.ts +9 -8
- package/dist/esm/types/index.js +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +4 -0
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/umd/chat-sdk.min.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/XAiThoughtChain/XAiThoughtChain.stories.tsx
|
|
30
|
+
var XAiThoughtChain_stories_exports = {};
|
|
31
|
+
__export(XAiThoughtChain_stories_exports, {
|
|
32
|
+
default: () => XAiThoughtChain_stories_default,
|
|
33
|
+
基础用法: () => 基础用法
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(XAiThoughtChain_stories_exports);
|
|
36
|
+
var import_react = require("react");
|
|
37
|
+
var import__ = __toESM(require("."));
|
|
38
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
39
|
+
var meta = {
|
|
40
|
+
title: "AI组件/XAiThoughtChain 思维链",
|
|
41
|
+
component: import__.default,
|
|
42
|
+
parameters: {},
|
|
43
|
+
tags: ["autodocs"],
|
|
44
|
+
argTypes: {}
|
|
45
|
+
};
|
|
46
|
+
var XAiThoughtChain_stories_default = meta;
|
|
47
|
+
var BasicUsageStory = () => {
|
|
48
|
+
const [items, setItems] = (0, import_react.useState)([]);
|
|
49
|
+
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
50
|
+
const steps = [
|
|
51
|
+
{
|
|
52
|
+
type: "text",
|
|
53
|
+
key: "planning",
|
|
54
|
+
title: "任务规划",
|
|
55
|
+
content: "\n为了规划审核路线,我需要明确以下几个步骤:\n1. 确认审核的具体内容或目标(例如:OCR审核、批注生成等)。\n2. 根据审核内容,选择合适的工具(例如:`OCR审核1`、`生成批注pdf1`)。\n3. 提供必要的输入参数(例如:文件链接、日期、流水号等)。\n4. 执行工具并获取结果。\n\n由于用户未提供具体的审核内容或目标,我需要进一步澄清。\n\n"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: "text",
|
|
59
|
+
key: "reasoning",
|
|
60
|
+
title: "推理分析",
|
|
61
|
+
content: "\n用户没有提供具体的审核内容或目标,因此无法直接调用工具。我需要请求用户提供更多信息,例如:\n- 审核的文件类型(图片、PDF等)。\n- 审核的具体任务(OCR识别、批注生成等)。\n- 是否有现成的文件链接或其他输入参数。\n\n"
|
|
62
|
+
},
|
|
63
|
+
// 待执行工具
|
|
64
|
+
// {
|
|
65
|
+
// type: "tool",
|
|
66
|
+
// msg: {
|
|
67
|
+
// id: "040c3341-759f-43cb-8f51-d33f8d16063c",
|
|
68
|
+
// author: "aaa111",
|
|
69
|
+
// invocationId: "e-b8f96c1d-5432-42cf-8cff-c04745538504",
|
|
70
|
+
// eventId: "2029398995837837312",
|
|
71
|
+
// timestamp: 1772681399674,
|
|
72
|
+
// role: "bot",
|
|
73
|
+
// functionCall: {
|
|
74
|
+
// id: "adk-a30a7fb0-4413-4251-8229-b48e6f9c0b32",
|
|
75
|
+
// args: {
|
|
76
|
+
// originalFunctionCall: {
|
|
77
|
+
// id: "call_8c999d1ae7f34f98ad2666",
|
|
78
|
+
// args: {
|
|
79
|
+
// size: "1024*1024",
|
|
80
|
+
// prompt: "一只猫在草地上,卡通风格",
|
|
81
|
+
// n: 1,
|
|
82
|
+
// },
|
|
83
|
+
// name: "bailian_image_gen",
|
|
84
|
+
// },
|
|
85
|
+
// toolConfirmation: {
|
|
86
|
+
// hint: "Please approve or reject the tool call vdjxxwbgpwlfs() by responding with a FunctionResponse with an expected ToolConfirmation payload.",
|
|
87
|
+
// confirmed: false,
|
|
88
|
+
// },
|
|
89
|
+
// },
|
|
90
|
+
// name: "adk_request_confirmation",
|
|
91
|
+
// },
|
|
92
|
+
// },
|
|
93
|
+
// },
|
|
94
|
+
// 确认执行
|
|
95
|
+
{
|
|
96
|
+
type: "tool",
|
|
97
|
+
msg: {
|
|
98
|
+
id: "99f7dff6-3780-4712-829f-4670707e76cc",
|
|
99
|
+
author: "aaa111",
|
|
100
|
+
invocationId: "e-fe701a0d-9fa2-4b82-b338-751c2ab31619",
|
|
101
|
+
eventId: "2029431631083794432",
|
|
102
|
+
timestamp: 1772689180523,
|
|
103
|
+
role: "bot",
|
|
104
|
+
functionCall: {
|
|
105
|
+
id: "call_ed77f343b5614de096ce35",
|
|
106
|
+
args: {
|
|
107
|
+
size: "1024*1024",
|
|
108
|
+
prompt: "一只可爱的小猫"
|
|
109
|
+
},
|
|
110
|
+
name: "bailian_image_gen"
|
|
111
|
+
},
|
|
112
|
+
functionResponse: {
|
|
113
|
+
id: "call_ed77f343b5614de096ce35",
|
|
114
|
+
name: "bailian_image_gen",
|
|
115
|
+
response: {
|
|
116
|
+
error: "This tool call requires confirmation, please approve or reject."
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
];
|
|
122
|
+
(0, import_react.useEffect)(() => {
|
|
123
|
+
let stepIndex = 0;
|
|
124
|
+
let charIndex = 0;
|
|
125
|
+
let currentContent = "";
|
|
126
|
+
setItems([
|
|
127
|
+
{
|
|
128
|
+
...steps[0],
|
|
129
|
+
content: ""
|
|
130
|
+
}
|
|
131
|
+
]);
|
|
132
|
+
const timer = setInterval(() => {
|
|
133
|
+
const currentStep = steps[stepIndex];
|
|
134
|
+
if (!currentStep) {
|
|
135
|
+
clearInterval(timer);
|
|
136
|
+
setLoading(false);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
if (charIndex < currentStep.content.length) {
|
|
140
|
+
currentContent += currentStep.content[charIndex];
|
|
141
|
+
charIndex++;
|
|
142
|
+
setItems((prev) => {
|
|
143
|
+
const newItems = [...prev];
|
|
144
|
+
newItems[stepIndex] = {
|
|
145
|
+
...currentStep,
|
|
146
|
+
content: currentContent
|
|
147
|
+
};
|
|
148
|
+
return newItems;
|
|
149
|
+
});
|
|
150
|
+
} else {
|
|
151
|
+
stepIndex++;
|
|
152
|
+
charIndex = 0;
|
|
153
|
+
currentContent = "";
|
|
154
|
+
if (stepIndex < steps.length) {
|
|
155
|
+
setItems((prev) => [
|
|
156
|
+
...prev,
|
|
157
|
+
{
|
|
158
|
+
...steps[stepIndex],
|
|
159
|
+
content: ""
|
|
160
|
+
}
|
|
161
|
+
]);
|
|
162
|
+
} else {
|
|
163
|
+
clearInterval(timer);
|
|
164
|
+
setLoading(false);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}, 20);
|
|
168
|
+
return () => clearInterval(timer);
|
|
169
|
+
}, []);
|
|
170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { style: { width: 440, border: "1px solid #eee", padding: 20 }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import__.default, { loading, items, defaultOpen: true }) });
|
|
171
|
+
};
|
|
172
|
+
var 基础用法 = {
|
|
173
|
+
render: BasicUsageStory,
|
|
174
|
+
args: {}
|
|
175
|
+
};
|
|
176
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
177
|
+
0 && (module.exports = {
|
|
178
|
+
基础用法
|
|
179
|
+
});
|
|
180
|
+
//# sourceMappingURL=XAiThoughtChain.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/XAiThoughtChain/XAiThoughtChain.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useState, useEffect } from \"react\";\nimport type { Meta, StoryObj } from \"@storybook/react-vite\";\nimport XAiThoughtChain from \".\";\n\nconst meta: Meta<typeof XAiThoughtChain> = {\n title: \"AI组件/XAiThoughtChain 思维链\",\n component: XAiThoughtChain,\n parameters: {},\n tags: [\"autodocs\"],\n argTypes: {},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof meta>;\n\n// 基础用法\nconst BasicUsageStory = () => {\n const [items, setItems] = useState<any[]>([]);\n const [loading, setLoading] = useState(true);\n\n const steps = [\n {\n type: \"text\",\n key: \"planning\",\n title: \"任务规划\",\n content:\n \"\\n为了规划审核路线,我需要明确以下几个步骤:\\n1. 确认审核的具体内容或目标(例如:OCR审核、批注生成等)。\\n2. 根据审核内容,选择合适的工具(例如:`OCR审核1`、`生成批注pdf1`)。\\n3. 提供必要的输入参数(例如:文件链接、日期、流水号等)。\\n4. 执行工具并获取结果。\\n\\n由于用户未提供具体的审核内容或目标,我需要进一步澄清。\\n\\n\",\n },\n {\n type: \"text\",\n key: \"reasoning\",\n title: \"推理分析\",\n content:\n \"\\n用户没有提供具体的审核内容或目标,因此无法直接调用工具。我需要请求用户提供更多信息,例如:\\n- 审核的文件类型(图片、PDF等)。\\n- 审核的具体任务(OCR识别、批注生成等)。\\n- 是否有现成的文件链接或其他输入参数。\\n\\n\",\n },\n // 待执行工具\n // {\n // type: \"tool\",\n // msg: {\n // id: \"040c3341-759f-43cb-8f51-d33f8d16063c\",\n // author: \"aaa111\",\n // invocationId: \"e-b8f96c1d-5432-42cf-8cff-c04745538504\",\n // eventId: \"2029398995837837312\",\n // timestamp: 1772681399674,\n // role: \"bot\",\n // functionCall: {\n // id: \"adk-a30a7fb0-4413-4251-8229-b48e6f9c0b32\",\n // args: {\n // originalFunctionCall: {\n // id: \"call_8c999d1ae7f34f98ad2666\",\n // args: {\n // size: \"1024*1024\",\n // prompt: \"一只猫在草地上,卡通风格\",\n // n: 1,\n // },\n // name: \"bailian_image_gen\",\n // },\n // toolConfirmation: {\n // hint: \"Please approve or reject the tool call vdjxxwbgpwlfs() by responding with a FunctionResponse with an expected ToolConfirmation payload.\",\n // confirmed: false,\n // },\n // },\n // name: \"adk_request_confirmation\",\n // },\n // },\n // },\n // 确认执行\n {\n type: \"tool\",\n msg: {\n id: \"99f7dff6-3780-4712-829f-4670707e76cc\",\n author: \"aaa111\",\n invocationId: \"e-fe701a0d-9fa2-4b82-b338-751c2ab31619\",\n eventId: \"2029431631083794432\",\n timestamp: 1772689180523,\n role: \"bot\",\n functionCall: {\n id: \"call_ed77f343b5614de096ce35\",\n args: {\n size: \"1024*1024\",\n prompt: \"一只可爱的小猫\",\n },\n name: \"bailian_image_gen\",\n },\n functionResponse: {\n id: \"call_ed77f343b5614de096ce35\",\n name: \"bailian_image_gen\",\n response: {\n error:\n \"This tool call requires confirmation, please approve or reject.\",\n },\n },\n },\n },\n ];\n\n useEffect(() => {\n let stepIndex = 0;\n let charIndex = 0;\n let currentContent = \"\";\n\n // 先插入第一个空 step\n setItems([\n {\n ...steps[0],\n content: \"\",\n },\n ]);\n\n const timer = setInterval(() => {\n const currentStep = steps[stepIndex];\n\n if (!currentStep) {\n clearInterval(timer);\n setLoading(false);\n return;\n }\n\n if (charIndex < currentStep.content!.length) {\n currentContent += currentStep.content![charIndex];\n charIndex++;\n\n setItems((prev) => {\n const newItems = [...prev];\n newItems[stepIndex] = {\n ...currentStep,\n content: currentContent,\n };\n return newItems;\n });\n } else {\n // 当前 step 打完\n stepIndex++;\n charIndex = 0;\n currentContent = \"\";\n\n if (stepIndex < steps.length) {\n setItems((prev) => [\n ...prev,\n {\n ...steps[stepIndex],\n content: \"\",\n },\n ]);\n } else {\n clearInterval(timer);\n setLoading(false);\n }\n }\n }, 20); // 20ms 一个字符\n\n return () => clearInterval(timer);\n }, []);\n\n return (\n <div style={{ width: 440, border: \"1px solid #eee\", padding: 20 }}>\n <XAiThoughtChain loading={loading} items={items} defaultOpen />\n </div>\n );\n};\n\nexport const 基础用法: Story = {\n render: BasicUsageStory,\n args: {},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAoC;AAEpC,eAA4B;AA0JtB;AAxJN,IAAM,OAAqC;AAAA,EACzC,OAAO;AAAA,EACP,WAAW,SAAAA;AAAA,EACX,YAAY,CAAC;AAAA,EACb,MAAM,CAAC,UAAU;AAAA,EACjB,UAAU,CAAC;AACb;AAEA,IAAO,kCAAQ;AAIf,IAAM,kBAAkB,MAAM;AAC5B,QAAM,CAAC,OAAO,QAAQ,QAAI,uBAA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AC3C,0BAAkB,YAAY,QAAS,SAAS;AAChD;AAEA,iBAAS,CAAC,SAAS;AACjB,gBAAM,WAAW,CAAC,GAAG,IAAI;AACzB,mBAAS,SAAS,IAAI;AAAA,YACpB,GAAG;AAAA,YACH,SAAS;AAAA,UACX;AACA,iBAAO;AAAA,QACT,CAAC;AAAA,MACH,OAAO;AAEL;AACA,oBAAY;AACZ,yBAAiB;AAEjB,YAAI,YAAY,MAAM,QAAQ;AAC5B,mBAAS,CAAC,SAAS;AAAA,YACjB,GAAG;AAAA,YACH;AAAA,cACE,GAAG,MAAM,SAAS;AAAA,cAClB,SAAS;AAAA,YACX;AAAA,UACF,CAAC;AAAA,QACH,OAAO;AACL,wBAAc,KAAK;AACnB,qBAAW,KAAK;AAAA,QAClB;AAAA,MACF;AAAA,IACF,GAAG,EAAE;AAEL,WAAO,MAAM,cAAc,KAAK;AAAA,EAClC,GAAG,CAAC,CAAC;AAEL,SACE,4CAAC,SAAI,OAAO,EAAE,OAAO,KAAK,QAAQ,kBAAkB,SAAS,GAAG,GAC9D,sDAAC,SAAAA,SAAA,EAAgB,SAAkB,OAAc,aAAW,MAAC,GAC/D;AAEJ;AAEO,IAAM,OAAc;AAAA,EACzB,QAAQ;AAAA,EACR,MAAM,CAAC;AACT;",
|
|
6
|
+
"names": ["XAiThoughtChain"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/XAiThoughtChain/index.tsx
|
|
30
|
+
var XAiThoughtChain_exports = {};
|
|
31
|
+
__export(XAiThoughtChain_exports, {
|
|
32
|
+
default: () => XAiThoughtChain_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(XAiThoughtChain_exports);
|
|
35
|
+
var import_react = require("react");
|
|
36
|
+
var import_icons = require("@ant-design/icons");
|
|
37
|
+
var import_MarkdownRender = __toESM(require("../XAdkChatbot/components/MarkdownRender"));
|
|
38
|
+
var import_FunctionCallRender = __toESM(require("../XAdkChatbot/components/FunctionCallRender"));
|
|
39
|
+
var import_styles = require("./styles");
|
|
40
|
+
var import_utils = require("../../utils");
|
|
41
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
42
|
+
var TimelineItem = ({
|
|
43
|
+
icon,
|
|
44
|
+
title,
|
|
45
|
+
children,
|
|
46
|
+
collapsible = true,
|
|
47
|
+
defaultOpen = true
|
|
48
|
+
}) => {
|
|
49
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(defaultOpen);
|
|
50
|
+
const styles = (0, import_styles.useStyles)();
|
|
51
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.timelineItem, children: [
|
|
52
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.timelineLeft, children: [
|
|
53
|
+
icon,
|
|
54
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.timelineConnector })
|
|
55
|
+
] }),
|
|
56
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.timelineRight, children: [
|
|
57
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: styles.collapsibleHeader,
|
|
61
|
+
onClick: () => collapsible ? setIsOpen(!isOpen) : void 0,
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: title }),
|
|
64
|
+
collapsible && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.arrowIcon, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.DownOutlined, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.RightOutlined, {}) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.stepContent, children })
|
|
69
|
+
] })
|
|
70
|
+
] });
|
|
71
|
+
};
|
|
72
|
+
var TimelineTextItem = ({ item }) => {
|
|
73
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
74
|
+
TimelineItem,
|
|
75
|
+
{
|
|
76
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_styles.useStyles)().timelineIcon, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.PartitionOutlined, {}) }),
|
|
77
|
+
title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: (0, import_styles.useStyles)().titleText, children: item.title }),
|
|
78
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_MarkdownRender.default, { text: (0, import_utils.cleanProcessText)(item.content) })
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
};
|
|
82
|
+
var TimelineToolItem = ({ msg, collapsible, onConfirm, showFnCallDetail }) => {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
84
|
+
const styles = (0, import_styles.useStyles)();
|
|
85
|
+
const needsConfirm = msg.functionCall && !msg.functionResponse;
|
|
86
|
+
const isDone = !!msg.functionResponse;
|
|
87
|
+
const toolName = ((_b = (_a = msg.functionCall) == null ? void 0 : _a.args) == null ? void 0 : _b.componentName) || ((_c = msg.functionCall) == null ? void 0 : _c.name) || "组件执行";
|
|
88
|
+
const statusInfo = ((_e = (_d = msg.functionResponse) == null ? void 0 : _d.response) == null ? void 0 : _e.processData) || ((_g = (_f = msg.functionResponse) == null ? void 0 : _f.response) == null ? void 0 : _g.output);
|
|
89
|
+
const titleNode = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.toolTitleGroup, children: [
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.toolName, children: toolName }),
|
|
91
|
+
isDone && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.toolStatusTag, children: "执行成功" })
|
|
92
|
+
] });
|
|
93
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
94
|
+
TimelineItem,
|
|
95
|
+
{
|
|
96
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.timelineIconTool, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.ThunderboltOutlined, {}) }),
|
|
97
|
+
title: titleNode,
|
|
98
|
+
collapsible,
|
|
99
|
+
defaultOpen: needsConfirm,
|
|
100
|
+
children: [
|
|
101
|
+
statusInfo && typeof statusInfo === "string" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.statusInfo, children: statusInfo }),
|
|
102
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
103
|
+
import_FunctionCallRender.default,
|
|
104
|
+
{
|
|
105
|
+
msg,
|
|
106
|
+
showDetail: showFnCallDetail,
|
|
107
|
+
onConfirm
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
]
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
var XAiThoughtChain = ({
|
|
115
|
+
defaultOpen = false,
|
|
116
|
+
showFnCallDetail = false,
|
|
117
|
+
title = "思维链已完成",
|
|
118
|
+
items = [],
|
|
119
|
+
loading,
|
|
120
|
+
onConfirm
|
|
121
|
+
}) => {
|
|
122
|
+
const styles = (0, import_styles.useStyles)();
|
|
123
|
+
const [isOpen, setIsOpen] = (0, import_react.useState)(defaultOpen);
|
|
124
|
+
(0, import_react.useEffect)(() => {
|
|
125
|
+
if (loading)
|
|
126
|
+
Promise.resolve().then(() => setIsOpen(true));
|
|
127
|
+
}, [loading]);
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.thoughtChainBlock, children: [
|
|
129
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.thoughtHeader, onClick: () => setIsOpen(!isOpen), children: [
|
|
130
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: styles.headerLeft, children: [
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${styles.caret} ${isOpen ? "open" : ""}`, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CaretRightOutlined, {}) }),
|
|
132
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.statusIcon, children: loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.SyncOutlined, { spin: true, style: { color: "#1677ff" } }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_icons.CheckCircleFilled, { style: { color: "#52c41a" } }) }),
|
|
133
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: styles.headerTitle, children: loading ? "深度思考与执行中..." : title })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.headerRight, children: items.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: styles.stepCount, children: [
|
|
136
|
+
items.length,
|
|
137
|
+
" 个步骤"
|
|
138
|
+
] }) })
|
|
139
|
+
] }),
|
|
140
|
+
isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.thinkingBody, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: styles.timeline, children: items.map(
|
|
141
|
+
(item, i) => item.type === "text" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TimelineTextItem, { item }, item.key || i) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
142
|
+
TimelineToolItem,
|
|
143
|
+
{
|
|
144
|
+
msg: item.msg,
|
|
145
|
+
collapsible: item.collapsible,
|
|
146
|
+
showFnCallDetail,
|
|
147
|
+
onConfirm
|
|
148
|
+
},
|
|
149
|
+
`tool-${item.key || i}`
|
|
150
|
+
)
|
|
151
|
+
) }) })
|
|
152
|
+
] });
|
|
153
|
+
};
|
|
154
|
+
var XAiThoughtChain_default = XAiThoughtChain;
|
|
155
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/XAiThoughtChain/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useState, useEffect } from \"react\";\nimport {\n CheckCircleFilled,\n SyncOutlined,\n ThunderboltOutlined,\n PartitionOutlined,\n CaretRightOutlined,\n RightOutlined,\n DownOutlined,\n} from \"@ant-design/icons\";\nimport MarkdownRender from \"@/components/XAdkChatbot/components/MarkdownRender\";\nimport FunctionCallRender from \"@/components/XAdkChatbot/components/FunctionCallRender\";\nimport { useStyles } from \"./styles\";\nimport {\n XAiThoughtChainProps,\n ThoughtChainItemType,\n TimelineItemProps,\n FunctionCall,\n IMessage,\n} from \"@/types\";\nimport { cleanProcessText } from \"@/utils\";\n\nconst TimelineItem = ({\n icon,\n title,\n children,\n collapsible = true,\n defaultOpen = true,\n}: TimelineItemProps) => {\n const [isOpen, setIsOpen] = useState(defaultOpen);\n const styles = useStyles();\n\n return (\n <div className={styles.timelineItem}>\n <div className={styles.timelineLeft}>\n {icon}\n <div className={styles.timelineConnector} />\n </div>\n <div className={styles.timelineRight}>\n <div\n className={styles.collapsibleHeader}\n onClick={() => (collapsible ? setIsOpen(!isOpen) : undefined)}\n >\n <div>{title}</div>\n {collapsible && (\n <span className={styles.arrowIcon}>\n {isOpen ? <DownOutlined /> : <RightOutlined />}\n </span>\n )}\n </div>\n\n {isOpen && <div className={styles.stepContent}>{children}</div>}\n </div>\n </div>\n );\n};\n\nconst TimelineTextItem: React.FC<{\n item: ThoughtChainItemType;\n}> = ({ item }) => {\n return (\n <TimelineItem\n icon={\n <span className={useStyles().timelineIcon}>\n <PartitionOutlined />\n </span>\n }\n title={<span className={useStyles().titleText}>{item.title}</span>}\n >\n <MarkdownRender text={cleanProcessText(item.content)} />\n </TimelineItem>\n );\n};\n\nconst TimelineToolItem: React.FC<{\n msg: IMessage;\n collapsible?: boolean;\n showFnCallDetail: boolean;\n onConfirm?: (fnCall: FunctionCall, confirmed: boolean) => void;\n}> = ({ msg, collapsible, onConfirm, showFnCallDetail }) => {\n const styles = useStyles();\n const needsConfirm = msg.functionCall && !msg.functionResponse;\n const isDone = !!msg.functionResponse;\n\n const toolName =\n msg.functionCall?.args?.componentName ||\n msg.functionCall?.name ||\n \"组件执行\";\n\n const statusInfo =\n msg.functionResponse?.response?.processData ||\n msg.functionResponse?.response?.output;\n\n const titleNode = (\n <div className={styles.toolTitleGroup}>\n <span className={styles.toolName}>{toolName}</span>\n {isDone && <span className={styles.toolStatusTag}>执行成功</span>}\n </div>\n );\n\n return (\n <TimelineItem\n icon={\n <span className={styles.timelineIconTool}>\n <ThunderboltOutlined />\n </span>\n }\n title={titleNode}\n collapsible={collapsible}\n defaultOpen={needsConfirm}\n >\n {statusInfo && typeof statusInfo === \"string\" && (\n <div className={styles.statusInfo}>{statusInfo}</div>\n )}\n <FunctionCallRender\n msg={msg}\n showDetail={showFnCallDetail}\n onConfirm={onConfirm}\n />\n </TimelineItem>\n );\n};\n\nconst XAiThoughtChain: React.FC<XAiThoughtChainProps> = ({\n defaultOpen = false,\n showFnCallDetail = false,\n title = \"思维链已完成\",\n items = [],\n loading,\n onConfirm,\n}) => {\n const styles = useStyles();\n const [isOpen, setIsOpen] = useState(defaultOpen);\n useEffect(() => {\n if (loading) Promise.resolve().then(() => setIsOpen(true));\n }, [loading]);\n return (\n <div className={styles.thoughtChainBlock}>\n <div className={styles.thoughtHeader} onClick={() => setIsOpen(!isOpen)}>\n <div className={styles.headerLeft}>\n <div className={`${styles.caret} ${isOpen ? \"open\" : \"\"}`}>\n <CaretRightOutlined />\n </div>\n <div className={styles.statusIcon}>\n {loading ? (\n <SyncOutlined spin style={{ color: \"#1677ff\" }} />\n ) : (\n <CheckCircleFilled style={{ color: \"#52c41a\" }} />\n )}\n </div>\n <span className={styles.headerTitle}>\n {loading ? \"深度思考与执行中...\" : title}\n </span>\n </div>\n <div className={styles.headerRight}>\n {items.length > 0 && (\n <span className={styles.stepCount}>{items.length} 个步骤</span>\n )}\n </div>\n </div>\n {isOpen && (\n <div className={styles.thinkingBody}>\n <div className={styles.timeline}>\n {items.map((item, i) =>\n item.type === \"text\" ? (\n <TimelineTextItem key={item.key || i} item={item} />\n ) : (\n <TimelineToolItem\n key={`tool-${item.key || i}`}\n msg={item.msg!}\n collapsible={item.collapsible}\n showFnCallDetail={showFnCallDetail}\n onConfirm={onConfirm}\n />\n ),\n )}\n </div>\n </div>\n )}\n </div>\n );\n};\n\nexport default XAiThoughtChain;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2C;AAC3C,mBAQO;AACP,4BAA2B;AAC3B,gCAA+B;AAC/B,oBAA0B;AAQ1B,mBAAiC;AAc3B;AAZN,IAAM,eAAe,CAAC;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,cAAc;AAChB,MAAyB;AACvB,QAAM,CAAC,QAAQ,SAAS,QAAI,uBAAS,WAAW;AAChD,QAAM,aAAS,yBAAU;AAEzB,SACE,6CAAC,SAAI,WAAW,OAAO,cACrB;AAAA,iDAAC,SAAI,WAAW,OAAO,cACpB;AAAA;AAAA,MACD,4CAAC,SAAI,WAAW,OAAO,mBAAmB;AAAA,OAC5C;AAAA,IACA,6CAAC,SAAI,WAAW,OAAO,eACrB;AAAA;AAAA,QAAC;AAAA;AAAA,UACC,WAAW,OAAO;AAAA,UAClB,SAAS,MAAO,cAAc,UAAU,CAAC,MAAM,IAAI;AAAA,UAEnD;AAAA,wDAAC,SAAK,iBAAM;AAAA,YACX,eACC,4CAAC,UAAK,WAAW,OAAO,WACrB,mBAAS,4CAAC,6BAAa,IAAK,4CAAC,8BAAc,GAC9C;AAAA;AAAA;AAAA,MAEJ;AAAA,MAEC,UAAU,4CAAC,SAAI,WAAW,OAAO,aAAc,UAAS;AAAA,OAC3D;AAAA,KACF;AAEJ;AAEA,IAAM,mBAED,CAAC,EAAE,KAAK,MAAM;AACjB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MACE,4CAAC,UAAK,eAAW,yBAAU,EAAE,cAC3B,sDAAC,kCAAkB,GACrB;AAAA,MAEF,OAAO,4CAAC,UAAK,eAAW,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1
|
+
export declare const useStyles: () => {
|
|
2
|
+
thoughtChainBlock: string;
|
|
3
|
+
thoughtHeader: string;
|
|
4
|
+
headerLeft: string;
|
|
5
|
+
caret: string;
|
|
6
|
+
statusIcon: string;
|
|
7
|
+
headerTitle: string;
|
|
8
|
+
headerRight: string;
|
|
9
|
+
stepCount: string;
|
|
10
|
+
thinkingBody: string;
|
|
11
|
+
timeline: string;
|
|
12
|
+
timelineItem: string;
|
|
13
|
+
timelineLeft: string;
|
|
14
|
+
timelineIcon: string;
|
|
15
|
+
timelineIconTool: string;
|
|
16
|
+
timelineConnector: string;
|
|
17
|
+
timelineItemLastConnector: string;
|
|
18
|
+
timelineRight: string;
|
|
19
|
+
collapsibleHeader: string;
|
|
20
|
+
titleText: string;
|
|
21
|
+
toolTitleGroup: string;
|
|
22
|
+
toolName: string;
|
|
23
|
+
toolStatusTag: string;
|
|
24
|
+
arrowIcon: string;
|
|
25
|
+
stepContent: string;
|
|
26
|
+
statusInfo: string;
|
|
27
|
+
} & {
|
|
28
|
+
w: (width: string | number) => string;
|
|
29
|
+
h: (height: string | number) => string;
|
|
30
|
+
p: (padding: string) => string;
|
|
31
|
+
pb: (padding: string | number) => string;
|
|
32
|
+
pt: (padding: string | number) => string;
|
|
33
|
+
pl: (padding: string | number) => string;
|
|
34
|
+
pr: (padding: string | number) => string;
|
|
35
|
+
m: (margin: string) => string;
|
|
36
|
+
mb: (margin: string | number) => string;
|
|
37
|
+
mt: (margin: string | number) => string;
|
|
38
|
+
ml: (margin: string | number) => string;
|
|
39
|
+
mr: (margin: string | number) => string;
|
|
40
|
+
text: (size: string | number) => string;
|
|
41
|
+
weight: (size: number) => string;
|
|
42
|
+
textColor: (c: string) => string;
|
|
43
|
+
bg: (c: string) => string;
|
|
44
|
+
rs: (radius: string | number) => string;
|
|
45
|
+
gap: (g: string | number) => string;
|
|
46
|
+
flex: string;
|
|
47
|
+
flexCenter: string;
|
|
48
|
+
flexBetween: string;
|
|
49
|
+
flexColumn: string;
|
|
50
|
+
flex1: string;
|
|
51
|
+
cursor: (type: string) => string;
|
|
52
|
+
border: (color: string, width?: string) => string;
|
|
53
|
+
boxShadow: (shadow: string) => string;
|
|
54
|
+
transition: (property?: string, duration?: string) => string;
|
|
55
|
+
overflow: (type: string) => string;
|
|
56
|
+
position: (type: string) => string;
|
|
57
|
+
zIndex: (index: number) => string;
|
|
58
|
+
flexCenterGap2: string;
|
|
59
|
+
flexCenterGap4: string;
|
|
60
|
+
};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/XAiThoughtChain/styles.tsx
|
|
20
|
+
var styles_exports = {};
|
|
21
|
+
__export(styles_exports, {
|
|
22
|
+
useStyles: () => useStyles
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(styles_exports);
|
|
25
|
+
var import_css = require("@emotion/css");
|
|
26
|
+
var import_common = require("../../styles/common");
|
|
27
|
+
var useStyles = (0, import_common.withBasicStyles)(() => ({
|
|
28
|
+
/* --- ThoughtChain --- */
|
|
29
|
+
thoughtChainBlock: import_css.css`
|
|
30
|
+
margin-bottom: 16px;
|
|
31
|
+
background: #f9f9f9;
|
|
32
|
+
border-radius: 8px;
|
|
33
|
+
border: 1px solid #eee;
|
|
34
|
+
overflow: hidden;
|
|
35
|
+
`,
|
|
36
|
+
thoughtHeader: import_css.css`
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: space-between;
|
|
39
|
+
align-items: center;
|
|
40
|
+
padding: 10px 14px;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
user-select: none;
|
|
43
|
+
background: #f5f5f5;
|
|
44
|
+
transition: background 0.2s;
|
|
45
|
+
&:hover {
|
|
46
|
+
background: #f0f0f0;
|
|
47
|
+
border-color: #ccc;
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
headerLeft: import_css.css`
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
gap: 8px;
|
|
54
|
+
`,
|
|
55
|
+
caret: import_css.css`
|
|
56
|
+
font-size: 12px;
|
|
57
|
+
color: #999;
|
|
58
|
+
transition: transform 0.2s;
|
|
59
|
+
&.open {
|
|
60
|
+
transform: rotate(90deg);
|
|
61
|
+
}
|
|
62
|
+
`,
|
|
63
|
+
statusIcon: import_css.css`
|
|
64
|
+
font-size: 14px;
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
`,
|
|
68
|
+
headerTitle: import_css.css`
|
|
69
|
+
font-size: 13px;
|
|
70
|
+
color: #666;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
`,
|
|
73
|
+
headerRight: import_css.css``,
|
|
74
|
+
stepCount: import_css.css`
|
|
75
|
+
font-size: 12px;
|
|
76
|
+
color: #bbb;
|
|
77
|
+
background: #fff;
|
|
78
|
+
padding: 2px 6px;
|
|
79
|
+
border-radius: 4px;
|
|
80
|
+
border: 1px solid #e0e0e0;
|
|
81
|
+
`,
|
|
82
|
+
thinkingBody: import_css.css`
|
|
83
|
+
background: #fff;
|
|
84
|
+
border-top: 1px solid #eee;
|
|
85
|
+
padding: 12px 16px;
|
|
86
|
+
animation: fadeIn 0.2s ease-in-out;
|
|
87
|
+
`,
|
|
88
|
+
/* --- Timeline --- */
|
|
89
|
+
timeline: import_css.css`
|
|
90
|
+
width: 100%;
|
|
91
|
+
`,
|
|
92
|
+
timelineItem: import_css.css`
|
|
93
|
+
display: flex;
|
|
94
|
+
gap: 12px;
|
|
95
|
+
position: relative;
|
|
96
|
+
`,
|
|
97
|
+
timelineLeft: import_css.css`
|
|
98
|
+
display: flex;
|
|
99
|
+
flex-direction: column;
|
|
100
|
+
align-items: center;
|
|
101
|
+
width: 20px;
|
|
102
|
+
flex-shrink: 0;
|
|
103
|
+
`,
|
|
104
|
+
timelineIcon: import_css.css`
|
|
105
|
+
color: #8c8c8c;
|
|
106
|
+
font-size: 16px;
|
|
107
|
+
margin-top: 6px;
|
|
108
|
+
`,
|
|
109
|
+
timelineIconTool: import_css.css`
|
|
110
|
+
color: #faad14;
|
|
111
|
+
font-size: 16px;
|
|
112
|
+
margin-top: 6px;
|
|
113
|
+
`,
|
|
114
|
+
timelineConnector: import_css.css`
|
|
115
|
+
flex: 1;
|
|
116
|
+
width: 1px;
|
|
117
|
+
background-color: #e5e5e5;
|
|
118
|
+
margin: 4px 0;
|
|
119
|
+
min-height: 12px;
|
|
120
|
+
`,
|
|
121
|
+
/* Hide connector on last item */
|
|
122
|
+
timelineItemLastConnector: import_css.css`
|
|
123
|
+
display: none;
|
|
124
|
+
`,
|
|
125
|
+
timelineRight: import_css.css`
|
|
126
|
+
flex: 1;
|
|
127
|
+
padding-bottom: 16px;
|
|
128
|
+
min-width: 0;
|
|
129
|
+
`,
|
|
130
|
+
collapsibleHeader: import_css.css`
|
|
131
|
+
display: flex;
|
|
132
|
+
justify-content: space-between;
|
|
133
|
+
align-items: center;
|
|
134
|
+
padding: 5px 8px;
|
|
135
|
+
margin: 0 -8px 4px -8px;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
cursor: pointer;
|
|
138
|
+
transition: all 0.2s;
|
|
139
|
+
user-select: none;
|
|
140
|
+
|
|
141
|
+
&:hover {
|
|
142
|
+
background: #f5f5f5;
|
|
143
|
+
}
|
|
144
|
+
`,
|
|
145
|
+
titleText: import_css.css`
|
|
146
|
+
font-size: 13px;
|
|
147
|
+
font-weight: 600;
|
|
148
|
+
color: #595959;
|
|
149
|
+
`,
|
|
150
|
+
toolTitleGroup: import_css.css`
|
|
151
|
+
display: flex;
|
|
152
|
+
align-items: center;
|
|
153
|
+
gap: 8px;
|
|
154
|
+
overflow: hidden;
|
|
155
|
+
`,
|
|
156
|
+
toolName: import_css.css`
|
|
157
|
+
font-size: 13px;
|
|
158
|
+
font-weight: 600;
|
|
159
|
+
color: #333;
|
|
160
|
+
white-space: nowrap;
|
|
161
|
+
overflow: hidden;
|
|
162
|
+
text-overflow: ellipsis;
|
|
163
|
+
`,
|
|
164
|
+
toolStatusTag: import_css.css`
|
|
165
|
+
font-size: 11px;
|
|
166
|
+
color: #52c41a;
|
|
167
|
+
background: #f6ffed;
|
|
168
|
+
border: 1px solid #b7eb8f;
|
|
169
|
+
padding: 0 6px;
|
|
170
|
+
border-radius: 4px;
|
|
171
|
+
flex-shrink: 0;
|
|
172
|
+
`,
|
|
173
|
+
arrowIcon: import_css.css`
|
|
174
|
+
font-size: 10px;
|
|
175
|
+
color: #bbb;
|
|
176
|
+
margin-left: 8px;
|
|
177
|
+
`,
|
|
178
|
+
stepContent: import_css.css`
|
|
179
|
+
font-size: 13px;
|
|
180
|
+
color: #595959;
|
|
181
|
+
line-height: 1.6;
|
|
182
|
+
padding-left: 4px;
|
|
183
|
+
`,
|
|
184
|
+
statusInfo: import_css.css`
|
|
185
|
+
font-size: 12px;
|
|
186
|
+
color: #bfbfbf;
|
|
187
|
+
margin-bottom: 4px;
|
|
188
|
+
font-style: italic;
|
|
189
|
+
`
|
|
190
|
+
}));
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
useStyles
|
|
194
|
+
});
|
|
195
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/components/XAiThoughtChain/styles.tsx"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable import/prefer-default-export */\nimport { css } from \"@emotion/css\";\nimport { withBasicStyles, lightBlue, primaryBlue } from \"@/styles/common\";\n\nexport const useStyles = withBasicStyles(() => ({\n /* --- ThoughtChain --- */\n\n thoughtChainBlock: css`\n margin-bottom: 16px;\n background: #f9f9f9;\n border-radius: 8px;\n border: 1px solid #eee;\n overflow: hidden;\n `,\n\n thoughtHeader: css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 10px 14px;\n cursor: pointer;\n user-select: none;\n background: #f5f5f5;\n transition: background 0.2s;\n &:hover {\n background: #f0f0f0;\n border-color: #ccc;\n }\n `,\n\n headerLeft: css`\n display: flex;\n align-items: center;\n gap: 8px;\n `,\n\n caret: css`\n font-size: 12px;\n color: #999;\n transition: transform 0.2s;\n &.open {\n transform: rotate(90deg);\n }\n `,\n\n statusIcon: css`\n font-size: 14px;\n display: flex;\n align-items: center;\n `,\n\n headerTitle: css`\n font-size: 13px;\n color: #666;\n font-weight: 500;\n `,\n\n headerRight: css``,\n\n stepCount: css`\n font-size: 12px;\n color: #bbb;\n background: #fff;\n padding: 2px 6px;\n border-radius: 4px;\n border: 1px solid #e0e0e0;\n `,\n\n thinkingBody: css`\n background: #fff;\n border-top: 1px solid #eee;\n padding: 12px 16px;\n animation: fadeIn 0.2s ease-in-out;\n `,\n\n /* --- Timeline --- */\n\n timeline: css`\n width: 100%;\n `,\n\n timelineItem: css`\n display: flex;\n gap: 12px;\n position: relative;\n `,\n\n timelineLeft: css`\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 20px;\n flex-shrink: 0;\n `,\n\n timelineIcon: css`\n color: #8c8c8c;\n font-size: 16px;\n margin-top: 6px;\n `,\n\n timelineIconTool: css`\n color: #faad14;\n font-size: 16px;\n margin-top: 6px;\n `,\n\n timelineConnector: css`\n flex: 1;\n width: 1px;\n background-color: #e5e5e5;\n margin: 4px 0;\n min-height: 12px;\n `,\n\n /* Hide connector on last item */\n timelineItemLastConnector: css`\n display: none;\n `,\n\n timelineRight: css`\n flex: 1;\n padding-bottom: 16px;\n min-width: 0;\n `,\n\n collapsibleHeader: css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 5px 8px;\n margin: 0 -8px 4px -8px;\n border-radius: 6px;\n cursor: pointer;\n transition: all 0.2s;\n user-select: none;\n\n &:hover {\n background: #f5f5f5;\n }\n `,\n\n titleText: css`\n font-size: 13px;\n font-weight: 600;\n color: #595959;\n `,\n\n toolTitleGroup: css`\n display: flex;\n align-items: center;\n gap: 8px;\n overflow: hidden;\n `,\n\n toolName: css`\n font-size: 13px;\n font-weight: 600;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n `,\n\n toolStatusTag: css`\n font-size: 11px;\n color: #52c41a;\n background: #f6ffed;\n border: 1px solid #b7eb8f;\n padding: 0 6px;\n border-radius: 4px;\n flex-shrink: 0;\n `,\n\n arrowIcon: css`\n font-size: 10px;\n color: #bbb;\n margin-left: 8px;\n `,\n\n stepContent: css`\n font-size: 13px;\n color: #595959;\n line-height: 1.6;\n padding-left: 4px;\n `,\n\n statusInfo: css`\n font-size: 12px;\n color: #bfbfbf;\n margin-bottom: 4px;\n font-style: italic;\n `,\n}));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,iBAAoB;AACpB,oBAAwD;AAEjD,IAAM,gBAAY,+BAAgB,OAAO;AAAA;AAAA,EAG9C,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQnB,eAAe;AAAA;AAAA;AAAA;AAA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