@sim-design/training 1.0.0
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/README.md +33 -0
- package/dist/ArrowLeftOutlined-CiSQq3bL.js +12 -0
- package/dist/AssessmentPlugin-Bx4VrBdV.js +607 -0
- package/dist/CaseAnalysisPlugin-CQvF9_zr.js +416 -0
- package/dist/CharacterDialoguePanel-Bvdab3qj.js +776 -0
- package/dist/CheckCircleFilled-Byo8CDfW.js +12 -0
- package/dist/CustomLayoutRenderer--rnQrqQ2.js +122524 -0
- package/dist/DecisionSelectPlugin-DtQ2KV34.js +863 -0
- package/dist/DecisionShared-Dh9oeQFT.js +65 -0
- package/dist/DialogueFormPlugin-C9ssnVMr.js +959 -0
- package/dist/DialoguePlugin-DU00QpmQ.js +416 -0
- package/dist/DocumentReviewPlugin-HNOZY1T4.js +977 -0
- package/dist/EyeOutlined-XvOAKlLs.js +12 -0
- package/dist/FormFillingPlugin-DURWsioi.js +445 -0
- package/dist/ModelEditor-BPJsPR0S.js +8264 -0
- package/dist/PluginHeader-B-GESJmT.js +87 -0
- package/dist/ProcessOperationPlugin-IijngDlX.js +88 -0
- package/dist/QAPlugin-Bh_UjK1N.js +184 -0
- package/dist/RadarChart-C5ZM0kWt.js +24963 -0
- package/dist/ReloadOutlined-Daor2m11.js +12 -0
- package/dist/SettingOutlined-CLEOgXB-.js +92 -0
- package/dist/StrategyLabPlugin-DGeZsr_7.js +14361 -0
- package/dist/ThunderboltOutlined-nH_FO_4A.js +44 -0
- package/dist/ToolOutlined-DtuNJDB2.js +28 -0
- package/dist/TrainingModelContainer-DpW-uB8O.js +11883 -0
- package/dist/UndoOutlined-ChUQYUul.js +84 -0
- package/dist/WarningFilled-1Rc4hr0C.js +12 -0
- package/dist/WarningOutlined-5g1d66hO.js +164 -0
- package/dist/adapters-D1FFZFoA.js +51 -0
- package/dist/analysisTools-CXyOvSZT.js +237 -0
- package/dist/creator.js +5 -0
- package/dist/index-CYjdXPgc.js +6568 -0
- package/dist/index-XuBVjlmu.js +44651 -0
- package/dist/index.js +11 -0
- package/dist/judgement-D_9i7x9S.js +20 -0
- package/dist/runtime.js +4 -0
- package/dist/types.js +8 -0
- package/dist/useDialogueLogic-IHELcN3X.js +368 -0
- package/dist-types/client/src/lib/adapters.d.ts +10 -0
- package/dist-types/client/src/lib/creator.d.ts +3 -0
- package/dist-types/client/src/lib/creatorIntegrationContext.d.ts +8 -0
- package/dist-types/client/src/lib/index.d.ts +5 -0
- package/dist-types/client/src/lib/public-types.d.ts +2 -0
- package/dist-types/client/src/lib/runtime.d.ts +3 -0
- package/dist-types/client/src/lib/types.d.ts +301 -0
- package/package.json +83 -0
|
@@ -0,0 +1,776 @@
|
|
|
1
|
+
import { g as tr, f as ar, j as o, h as nr, e as lr, i as dr } from "./RadarChart-C5ZM0kWt.js";
|
|
2
|
+
import cr, { useRef as W, useState as f, useEffect as A, useCallback as j } from "react";
|
|
3
|
+
import { message as pr, Button as u, Tooltip as X, Input as xr } from "antd";
|
|
4
|
+
import { a as gr } from "./TrainingModelContainer-DpW-uB8O.js";
|
|
5
|
+
import { u as M, m as b, A as yr } from "./StrategyLabPlugin-DGeZsr_7.js";
|
|
6
|
+
import { c as fr, d as q, e as ur } from "./WarningOutlined-5g1d66hO.js";
|
|
7
|
+
import { R as br } from "./UndoOutlined-ChUQYUul.js";
|
|
8
|
+
import { R as mr, a as jr } from "./ThunderboltOutlined-nH_FO_4A.js";
|
|
9
|
+
const hr = {
|
|
10
|
+
adversarial: { icon: /* @__PURE__ */ o.jsx(jr, {}), label: "对抗推演", color: "#f5222d" },
|
|
11
|
+
collaborative: { icon: /* @__PURE__ */ o.jsx(q, {}), label: "群体决策", color: "#1890ff" },
|
|
12
|
+
"stress-test": { icon: /* @__PURE__ */ o.jsx(ur, {}), label: "压力测试", color: "#faad14" }
|
|
13
|
+
}, zr = ({
|
|
14
|
+
stepId: h,
|
|
15
|
+
mode: m,
|
|
16
|
+
originalDecision: P,
|
|
17
|
+
characters: c,
|
|
18
|
+
scenario: E,
|
|
19
|
+
theme: r,
|
|
20
|
+
currentUser: J,
|
|
21
|
+
onSkip: B,
|
|
22
|
+
onRequestAdjust: Q
|
|
23
|
+
}) => {
|
|
24
|
+
var K;
|
|
25
|
+
const O = M((e) => e.saveStrategyLab), Z = W(M.getState().getStrategyLab(h)), [g, L] = f(""), [p, S] = f(""), [v, T] = f(!1), [rr, H] = f("dialogue"), [k, or] = f({}), [n, F] = f(((K = Z.current) == null ? void 0 : K.characterDialogues) || {}), N = W(null), w = W(null), I = tr("ACTOR_AGENT"), { token: C } = gr(I, J), l = hr[m], x = cr.useMemo(() => {
|
|
26
|
+
const e = [];
|
|
27
|
+
return m === "adversarial" && c.adversary ? e.push(c.adversary) : m === "collaborative" && c.stakeholders ? c.stakeholders.forEach((i) => {
|
|
28
|
+
i.character && e.push(i.character);
|
|
29
|
+
}) : m === "stress-test" && c.narrator && e.push(c.narrator), e;
|
|
30
|
+
}, [m, c]);
|
|
31
|
+
A(() => {
|
|
32
|
+
!g && x.length > 0 && L(x[0].name);
|
|
33
|
+
}, [x, g]), A(() => {
|
|
34
|
+
if (Object.keys(n).length > 0) {
|
|
35
|
+
const e = M.getState().getStrategyLab(h);
|
|
36
|
+
O(h, {
|
|
37
|
+
...e,
|
|
38
|
+
characterDialogues: n,
|
|
39
|
+
isInCharacterDialogue: !0
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, [n, h, O]), A(() => {
|
|
43
|
+
var e;
|
|
44
|
+
(e = N.current) == null || e.scrollIntoView({ behavior: "smooth" });
|
|
45
|
+
}, [n, g]);
|
|
46
|
+
const R = j(() => x.find((e) => e.name === g), [x, g]), _ = j((e, i, t) => {
|
|
47
|
+
var a;
|
|
48
|
+
return t.length === 0 ? `【角色设定】
|
|
49
|
+
你是 ${e.name},性格特征:${(a = e.personality) == null ? void 0 : a.join("、")}
|
|
50
|
+
背景故事:${e.background}
|
|
51
|
+
当前立场:${e.stance}
|
|
52
|
+
|
|
53
|
+
【场景背景】
|
|
54
|
+
${E}
|
|
55
|
+
|
|
56
|
+
【用户决策方案】
|
|
57
|
+
${P}
|
|
58
|
+
|
|
59
|
+
【你的初始态度】
|
|
60
|
+
${e.dialogue}
|
|
61
|
+
|
|
62
|
+
【任务】
|
|
63
|
+
用户现在想与你对话,试图说服你或了解你的想法。请保持角色一致性,自然回应用户的问题或观点。
|
|
64
|
+
|
|
65
|
+
【用户消息】
|
|
66
|
+
${i}` : i;
|
|
67
|
+
}, [E, P]), G = j(async () => {
|
|
68
|
+
var U;
|
|
69
|
+
if (!p.trim() || !C) return;
|
|
70
|
+
const e = R();
|
|
71
|
+
if (!e) return;
|
|
72
|
+
const i = e.name, t = n[i] || { messages: [], conversationId: null }, a = p.trim(), y = { role: "user", content: a, timestamp: Date.now() };
|
|
73
|
+
F((d) => {
|
|
74
|
+
var $;
|
|
75
|
+
return {
|
|
76
|
+
...d,
|
|
77
|
+
[i]: {
|
|
78
|
+
...d[i] || { messages: [], conversationId: null },
|
|
79
|
+
messages: [...(($ = d[i]) == null ? void 0 : $.messages) || [], y]
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
}), S(""), T(!0);
|
|
83
|
+
try {
|
|
84
|
+
const d = _(e, a, t.messages), { response: $, conversationId: ir } = await ar({
|
|
85
|
+
botId: I,
|
|
86
|
+
prompt: d,
|
|
87
|
+
token: C,
|
|
88
|
+
conversationId: t.conversationId || void 0,
|
|
89
|
+
autoSaveHistory: !0
|
|
90
|
+
});
|
|
91
|
+
F((D) => {
|
|
92
|
+
var V;
|
|
93
|
+
return {
|
|
94
|
+
...D,
|
|
95
|
+
[i]: {
|
|
96
|
+
...D[i],
|
|
97
|
+
messages: [
|
|
98
|
+
...((V = D[i]) == null ? void 0 : V.messages) || [],
|
|
99
|
+
{ role: "character", content: $, timestamp: Date.now() }
|
|
100
|
+
],
|
|
101
|
+
conversationId: ir
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
} catch (d) {
|
|
106
|
+
console.error("[CharacterDialoguePanel] 发送消息失败:", d), pr.error(d.message || "发送消息失败");
|
|
107
|
+
} finally {
|
|
108
|
+
T(!1), (U = w.current) == null || U.focus();
|
|
109
|
+
}
|
|
110
|
+
}, [p, C, R, n, _, I]), Y = j(() => {
|
|
111
|
+
const e = {};
|
|
112
|
+
for (const [i, t] of Object.entries(n)) {
|
|
113
|
+
if (!t.messages || t.messages.length < 2) continue;
|
|
114
|
+
const a = [...t.messages].reverse().find((y) => y.role === "character");
|
|
115
|
+
a && (e[i] = a.content.length > 200 ? a.content.substring(0, 200) + "..." : a.content);
|
|
116
|
+
}
|
|
117
|
+
return e;
|
|
118
|
+
}, [n]), er = j(() => {
|
|
119
|
+
const e = Y();
|
|
120
|
+
or(e), H("summary");
|
|
121
|
+
}, [Y]), sr = Object.values(n).some(
|
|
122
|
+
(e) => e.messages && e.messages.length >= 2
|
|
123
|
+
), s = R(), z = s ? n[s.name] || { messages: [] } : { messages: [] };
|
|
124
|
+
return /* @__PURE__ */ o.jsxs(
|
|
125
|
+
b.div,
|
|
126
|
+
{
|
|
127
|
+
initial: { opacity: 0 },
|
|
128
|
+
animate: { opacity: 1 },
|
|
129
|
+
exit: { opacity: 0 },
|
|
130
|
+
transition: { duration: 0.3 },
|
|
131
|
+
style: {
|
|
132
|
+
position: "fixed",
|
|
133
|
+
top: 0,
|
|
134
|
+
left: 0,
|
|
135
|
+
right: 0,
|
|
136
|
+
bottom: 0,
|
|
137
|
+
background: "rgba(8, 12, 24, 0.88)",
|
|
138
|
+
backdropFilter: "blur(24px)",
|
|
139
|
+
zIndex: 1e3,
|
|
140
|
+
display: "flex",
|
|
141
|
+
alignItems: "center",
|
|
142
|
+
justifyContent: "center"
|
|
143
|
+
},
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
146
|
+
position: "absolute",
|
|
147
|
+
top: 0,
|
|
148
|
+
left: 0,
|
|
149
|
+
right: 0,
|
|
150
|
+
bottom: 0,
|
|
151
|
+
backgroundImage: `linear-gradient(${r.colors.primary}06 1px, transparent 1px), linear-gradient(90deg, ${r.colors.primary}06 1px, transparent 1px)`,
|
|
152
|
+
backgroundSize: "40px 40px",
|
|
153
|
+
pointerEvents: "none"
|
|
154
|
+
} }),
|
|
155
|
+
/* @__PURE__ */ o.jsxs(
|
|
156
|
+
b.div,
|
|
157
|
+
{
|
|
158
|
+
initial: { y: 40, opacity: 0, scale: 0.97 },
|
|
159
|
+
animate: { y: 0, opacity: 1, scale: 1 },
|
|
160
|
+
exit: { y: 40, opacity: 0, scale: 0.97 },
|
|
161
|
+
transition: { duration: 0.4, ease: [0.25, 0.1, 0.25, 1] },
|
|
162
|
+
style: {
|
|
163
|
+
position: "relative",
|
|
164
|
+
width: "88%",
|
|
165
|
+
maxWidth: 960,
|
|
166
|
+
height: "85vh",
|
|
167
|
+
display: "flex",
|
|
168
|
+
flexDirection: "column",
|
|
169
|
+
borderRadius: 16,
|
|
170
|
+
overflow: "hidden",
|
|
171
|
+
background: `linear-gradient(170deg, ${r.colors.bgCard}f2 0%, ${r.colors.bgPrimary}f5 100%)`,
|
|
172
|
+
border: `1px solid ${r.colors.border}`,
|
|
173
|
+
boxShadow: `0 32px 64px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04), ${r.effects.glow}`
|
|
174
|
+
},
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
177
|
+
display: "flex",
|
|
178
|
+
alignItems: "center",
|
|
179
|
+
justifyContent: "space-between",
|
|
180
|
+
padding: "16px 24px",
|
|
181
|
+
borderBottom: `1px solid ${r.colors.border}`,
|
|
182
|
+
background: `linear-gradient(90deg, ${l.color}10 0%, transparent 60%)`,
|
|
183
|
+
flexShrink: 0
|
|
184
|
+
}, children: [
|
|
185
|
+
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
186
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
187
|
+
width: 36,
|
|
188
|
+
height: 36,
|
|
189
|
+
borderRadius: 10,
|
|
190
|
+
background: `${l.color}20`,
|
|
191
|
+
border: `1px solid ${l.color}40`,
|
|
192
|
+
display: "flex",
|
|
193
|
+
alignItems: "center",
|
|
194
|
+
justifyContent: "center",
|
|
195
|
+
color: l.color,
|
|
196
|
+
fontSize: 18
|
|
197
|
+
}, children: l.icon }),
|
|
198
|
+
/* @__PURE__ */ o.jsxs("div", { children: [
|
|
199
|
+
/* @__PURE__ */ o.jsx("div", { style: { fontSize: 16, fontWeight: 600, color: r.colors.textPrimary, lineHeight: 1.2 }, children: l.label }),
|
|
200
|
+
/* @__PURE__ */ o.jsx("div", { style: { fontSize: 12, color: r.colors.textMuted, marginTop: 2 }, children: "与 AI 角色互动,探索不同立场" })
|
|
201
|
+
] })
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ o.jsx(
|
|
204
|
+
u,
|
|
205
|
+
{
|
|
206
|
+
type: "text",
|
|
207
|
+
icon: /* @__PURE__ */ o.jsx(fr, {}),
|
|
208
|
+
onClick: B,
|
|
209
|
+
style: {
|
|
210
|
+
color: r.colors.textMuted,
|
|
211
|
+
fontSize: 16,
|
|
212
|
+
width: 40,
|
|
213
|
+
height: 40,
|
|
214
|
+
borderRadius: 10,
|
|
215
|
+
display: "flex",
|
|
216
|
+
alignItems: "center",
|
|
217
|
+
justifyContent: "center"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
)
|
|
221
|
+
] }),
|
|
222
|
+
x.length > 1 && /* @__PURE__ */ o.jsx("div", { style: {
|
|
223
|
+
display: "flex",
|
|
224
|
+
gap: 4,
|
|
225
|
+
padding: "10px 24px",
|
|
226
|
+
borderBottom: `1px solid ${r.colors.border}`,
|
|
227
|
+
background: `${r.colors.bgSecondary}80`,
|
|
228
|
+
overflowX: "auto",
|
|
229
|
+
flexShrink: 0
|
|
230
|
+
}, children: x.map((e) => {
|
|
231
|
+
var a, y;
|
|
232
|
+
const i = e.name === g, t = ((y = (a = n[e.name]) == null ? void 0 : a.messages) == null ? void 0 : y.length) || 0;
|
|
233
|
+
return /* @__PURE__ */ o.jsxs(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
onClick: () => L(e.name),
|
|
237
|
+
style: {
|
|
238
|
+
display: "flex",
|
|
239
|
+
alignItems: "center",
|
|
240
|
+
gap: 8,
|
|
241
|
+
padding: "8px 16px",
|
|
242
|
+
borderRadius: 8,
|
|
243
|
+
border: i ? `1px solid ${r.colors.primary}60` : "1px solid transparent",
|
|
244
|
+
background: i ? `${r.colors.primary}15` : "transparent",
|
|
245
|
+
color: i ? r.colors.primary : r.colors.textSecondary,
|
|
246
|
+
cursor: "pointer",
|
|
247
|
+
transition: "all 0.2s ease",
|
|
248
|
+
whiteSpace: "nowrap",
|
|
249
|
+
fontSize: 13,
|
|
250
|
+
fontWeight: i ? 600 : 400
|
|
251
|
+
},
|
|
252
|
+
children: [
|
|
253
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
254
|
+
width: 26,
|
|
255
|
+
height: 26,
|
|
256
|
+
borderRadius: "50%",
|
|
257
|
+
background: i ? r.colors.primary : r.colors.bgCard,
|
|
258
|
+
border: `1.5px solid ${i ? r.colors.primary : r.colors.border}`,
|
|
259
|
+
display: "flex",
|
|
260
|
+
alignItems: "center",
|
|
261
|
+
justifyContent: "center",
|
|
262
|
+
color: i ? "#fff" : r.colors.textMuted,
|
|
263
|
+
fontSize: 12,
|
|
264
|
+
fontWeight: 600
|
|
265
|
+
}, children: e.name.charAt(0) }),
|
|
266
|
+
e.name,
|
|
267
|
+
t > 0 && /* @__PURE__ */ o.jsx("span", { style: {
|
|
268
|
+
fontSize: 11,
|
|
269
|
+
padding: "1px 6px",
|
|
270
|
+
borderRadius: 10,
|
|
271
|
+
background: i ? `${r.colors.primary}25` : `${r.colors.textMuted}20`,
|
|
272
|
+
color: i ? r.colors.primary : r.colors.textMuted
|
|
273
|
+
}, children: t })
|
|
274
|
+
]
|
|
275
|
+
},
|
|
276
|
+
e.name
|
|
277
|
+
);
|
|
278
|
+
}) }),
|
|
279
|
+
s && /* @__PURE__ */ o.jsxs("div", { style: {
|
|
280
|
+
padding: "16px 24px",
|
|
281
|
+
borderBottom: `1px solid ${r.colors.border}`,
|
|
282
|
+
background: `linear-gradient(135deg, ${r.colors.bgSecondary}60 0%, transparent 100%)`,
|
|
283
|
+
flexShrink: 0
|
|
284
|
+
}, children: [
|
|
285
|
+
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 14 }, children: [
|
|
286
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
287
|
+
position: "relative",
|
|
288
|
+
width: 52,
|
|
289
|
+
height: 52,
|
|
290
|
+
borderRadius: 14,
|
|
291
|
+
background: `linear-gradient(135deg, ${r.colors.primary}30 0%, ${r.colors.primaryDark}40 100%)`,
|
|
292
|
+
border: `2px solid ${r.colors.primary}50`,
|
|
293
|
+
display: "flex",
|
|
294
|
+
alignItems: "center",
|
|
295
|
+
justifyContent: "center",
|
|
296
|
+
flexShrink: 0
|
|
297
|
+
}, children: [
|
|
298
|
+
s.avatar ? /* @__PURE__ */ o.jsx(
|
|
299
|
+
"img",
|
|
300
|
+
{
|
|
301
|
+
src: s.avatar,
|
|
302
|
+
alt: s.name,
|
|
303
|
+
style: { width: 48, height: 48, borderRadius: 12, objectFit: "cover" }
|
|
304
|
+
}
|
|
305
|
+
) : /* @__PURE__ */ o.jsx("span", { style: { fontSize: 22, fontWeight: 700, color: r.colors.primary }, children: s.name.charAt(0) }),
|
|
306
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
307
|
+
position: "absolute",
|
|
308
|
+
bottom: -2,
|
|
309
|
+
right: -2,
|
|
310
|
+
width: 14,
|
|
311
|
+
height: 14,
|
|
312
|
+
borderRadius: "50%",
|
|
313
|
+
background: "#52c41a",
|
|
314
|
+
border: `2px solid ${r.colors.bgCard}`
|
|
315
|
+
} })
|
|
316
|
+
] }),
|
|
317
|
+
/* @__PURE__ */ o.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
318
|
+
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8, marginBottom: 4 }, children: [
|
|
319
|
+
/* @__PURE__ */ o.jsx("span", { style: { fontSize: 16, fontWeight: 600, color: r.colors.textPrimary }, children: s.name }),
|
|
320
|
+
s.stance && /* @__PURE__ */ o.jsx(
|
|
321
|
+
X,
|
|
322
|
+
{
|
|
323
|
+
title: s.stance.length > 20 ? s.stance : void 0,
|
|
324
|
+
placement: "bottomLeft",
|
|
325
|
+
overlayStyle: { maxWidth: 360 },
|
|
326
|
+
children: /* @__PURE__ */ o.jsx("span", { style: {
|
|
327
|
+
fontSize: 11,
|
|
328
|
+
padding: "2px 8px",
|
|
329
|
+
borderRadius: 4,
|
|
330
|
+
background: `${l.color}15`,
|
|
331
|
+
color: l.color,
|
|
332
|
+
border: `1px solid ${l.color}30`,
|
|
333
|
+
cursor: s.stance.length > 20 ? "pointer" : "default"
|
|
334
|
+
}, children: s.stance.length > 20 ? s.stance.substring(0, 20) + "..." : s.stance })
|
|
335
|
+
}
|
|
336
|
+
)
|
|
337
|
+
] }),
|
|
338
|
+
s.personality && s.personality.length > 0 && /* @__PURE__ */ o.jsx("div", { style: { display: "flex", gap: 4, flexWrap: "wrap" }, children: s.personality.map((e, i) => /* @__PURE__ */ o.jsx("span", { style: {
|
|
339
|
+
fontSize: 11,
|
|
340
|
+
padding: "1px 8px",
|
|
341
|
+
borderRadius: 3,
|
|
342
|
+
background: `${r.colors.primary}12`,
|
|
343
|
+
color: r.colors.textSecondary,
|
|
344
|
+
border: `1px solid ${r.colors.border}`
|
|
345
|
+
}, children: e }, i)) })
|
|
346
|
+
] })
|
|
347
|
+
] }),
|
|
348
|
+
s.background && /* @__PURE__ */ o.jsx("div", { style: {
|
|
349
|
+
marginTop: 10,
|
|
350
|
+
padding: "8px 12px",
|
|
351
|
+
borderRadius: 8,
|
|
352
|
+
background: `${r.colors.bgPrimary}80`,
|
|
353
|
+
border: `1px solid ${r.colors.border}`,
|
|
354
|
+
fontSize: 12,
|
|
355
|
+
color: r.colors.textMuted,
|
|
356
|
+
lineHeight: 1.6
|
|
357
|
+
}, children: s.background })
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ o.jsxs(
|
|
360
|
+
"div",
|
|
361
|
+
{
|
|
362
|
+
style: {
|
|
363
|
+
flex: 1,
|
|
364
|
+
overflowY: "auto",
|
|
365
|
+
padding: "20px 24px",
|
|
366
|
+
display: "flex",
|
|
367
|
+
flexDirection: "column",
|
|
368
|
+
gap: 16
|
|
369
|
+
},
|
|
370
|
+
className: "dialogue-messages-scroll",
|
|
371
|
+
children: [
|
|
372
|
+
z.messages.length === 0 && s && /* @__PURE__ */ o.jsxs(
|
|
373
|
+
b.div,
|
|
374
|
+
{
|
|
375
|
+
initial: { opacity: 0, y: 16 },
|
|
376
|
+
animate: { opacity: 1, y: 0 },
|
|
377
|
+
transition: { duration: 0.5, delay: 0.2 },
|
|
378
|
+
style: { textAlign: "center", padding: "40px 20px" },
|
|
379
|
+
children: [
|
|
380
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
381
|
+
width: 72,
|
|
382
|
+
height: 72,
|
|
383
|
+
borderRadius: 20,
|
|
384
|
+
margin: "0 auto 20px",
|
|
385
|
+
background: `linear-gradient(135deg, ${r.colors.primary}25 0%, ${r.colors.primaryDark}35 100%)`,
|
|
386
|
+
border: `2px solid ${r.colors.primary}40`,
|
|
387
|
+
display: "flex",
|
|
388
|
+
alignItems: "center",
|
|
389
|
+
justifyContent: "center",
|
|
390
|
+
fontSize: 32,
|
|
391
|
+
fontWeight: 700,
|
|
392
|
+
color: r.colors.primary
|
|
393
|
+
}, children: s.name.charAt(0) }),
|
|
394
|
+
/* @__PURE__ */ o.jsxs("h3", { style: {
|
|
395
|
+
fontSize: 18,
|
|
396
|
+
fontWeight: 600,
|
|
397
|
+
color: r.colors.textPrimary,
|
|
398
|
+
margin: "0 0 8px 0"
|
|
399
|
+
}, children: [
|
|
400
|
+
"与 ",
|
|
401
|
+
s.name,
|
|
402
|
+
" 开始对话"
|
|
403
|
+
] }),
|
|
404
|
+
/* @__PURE__ */ o.jsx("p", { style: {
|
|
405
|
+
fontSize: 13,
|
|
406
|
+
color: r.colors.textMuted,
|
|
407
|
+
lineHeight: 1.6,
|
|
408
|
+
maxWidth: 360,
|
|
409
|
+
margin: "0 auto"
|
|
410
|
+
}, children: s.dialogue || "尝试向对方表达你的观点,了解不同立场的看法" }),
|
|
411
|
+
/* @__PURE__ */ o.jsx("div", { style: { display: "flex", gap: 8, justifyContent: "center", flexWrap: "wrap", marginTop: 20 }, children: [
|
|
412
|
+
"请介绍一下你的立场",
|
|
413
|
+
"你对这个方案怎么看?",
|
|
414
|
+
"你最大的顾虑是什么?"
|
|
415
|
+
].map((e, i) => /* @__PURE__ */ o.jsx(
|
|
416
|
+
"button",
|
|
417
|
+
{
|
|
418
|
+
onClick: () => {
|
|
419
|
+
var t;
|
|
420
|
+
S(e), (t = w.current) == null || t.focus();
|
|
421
|
+
},
|
|
422
|
+
style: {
|
|
423
|
+
padding: "6px 14px",
|
|
424
|
+
borderRadius: 20,
|
|
425
|
+
background: `${r.colors.primary}10`,
|
|
426
|
+
border: `1px solid ${r.colors.primary}30`,
|
|
427
|
+
color: r.colors.primary,
|
|
428
|
+
cursor: "pointer",
|
|
429
|
+
fontSize: 12,
|
|
430
|
+
transition: "all 0.2s ease"
|
|
431
|
+
},
|
|
432
|
+
children: e
|
|
433
|
+
},
|
|
434
|
+
i
|
|
435
|
+
)) })
|
|
436
|
+
]
|
|
437
|
+
}
|
|
438
|
+
),
|
|
439
|
+
/* @__PURE__ */ o.jsx(yr, { initial: !1, children: z.messages.map((e, i) => {
|
|
440
|
+
const t = e.role === "user";
|
|
441
|
+
return /* @__PURE__ */ o.jsxs(
|
|
442
|
+
b.div,
|
|
443
|
+
{
|
|
444
|
+
initial: { opacity: 0, y: 12, scale: 0.98 },
|
|
445
|
+
animate: { opacity: 1, y: 0, scale: 1 },
|
|
446
|
+
transition: { duration: 0.3, ease: "easeOut" },
|
|
447
|
+
style: {
|
|
448
|
+
display: "flex",
|
|
449
|
+
flexDirection: t ? "row-reverse" : "row",
|
|
450
|
+
alignItems: "flex-start",
|
|
451
|
+
gap: 10
|
|
452
|
+
},
|
|
453
|
+
children: [
|
|
454
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
455
|
+
width: 36,
|
|
456
|
+
height: 36,
|
|
457
|
+
borderRadius: 10,
|
|
458
|
+
flexShrink: 0,
|
|
459
|
+
background: t ? `linear-gradient(135deg, ${r.colors.primary} 0%, ${r.colors.primaryDark} 100%)` : r.colors.bgSecondary,
|
|
460
|
+
border: t ? "none" : `1px solid ${r.colors.border}`,
|
|
461
|
+
display: "flex",
|
|
462
|
+
alignItems: "center",
|
|
463
|
+
justifyContent: "center",
|
|
464
|
+
color: t ? "#fff" : r.colors.primary,
|
|
465
|
+
fontSize: t ? 14 : 15,
|
|
466
|
+
fontWeight: 600
|
|
467
|
+
}, children: t ? /* @__PURE__ */ o.jsx(nr, {}) : s == null ? void 0 : s.name.charAt(0) }),
|
|
468
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
469
|
+
maxWidth: "72%",
|
|
470
|
+
padding: "10px 16px",
|
|
471
|
+
borderRadius: t ? "14px 4px 14px 14px" : "4px 14px 14px 14px",
|
|
472
|
+
background: t ? `linear-gradient(135deg, ${r.colors.primary} 0%, ${r.colors.primaryDark} 100%)` : r.colors.bgCard,
|
|
473
|
+
color: t ? "#fff" : r.colors.textPrimary,
|
|
474
|
+
border: t ? "none" : `1px solid ${r.colors.border}`,
|
|
475
|
+
boxShadow: t ? `0 4px 12px ${r.colors.primary}30` : r.effects.shadow,
|
|
476
|
+
fontSize: 14,
|
|
477
|
+
lineHeight: 1.7,
|
|
478
|
+
whiteSpace: "pre-wrap",
|
|
479
|
+
wordBreak: "break-word"
|
|
480
|
+
}, children: e.content })
|
|
481
|
+
]
|
|
482
|
+
},
|
|
483
|
+
`${e.timestamp}-${i}`
|
|
484
|
+
);
|
|
485
|
+
}) }),
|
|
486
|
+
v && /* @__PURE__ */ o.jsxs(
|
|
487
|
+
b.div,
|
|
488
|
+
{
|
|
489
|
+
initial: { opacity: 0, y: 8 },
|
|
490
|
+
animate: { opacity: 1, y: 0 },
|
|
491
|
+
style: {
|
|
492
|
+
display: "flex",
|
|
493
|
+
alignItems: "flex-start",
|
|
494
|
+
gap: 10
|
|
495
|
+
},
|
|
496
|
+
children: [
|
|
497
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
498
|
+
width: 36,
|
|
499
|
+
height: 36,
|
|
500
|
+
borderRadius: 10,
|
|
501
|
+
flexShrink: 0,
|
|
502
|
+
background: r.colors.bgSecondary,
|
|
503
|
+
border: `1px solid ${r.colors.border}`,
|
|
504
|
+
display: "flex",
|
|
505
|
+
alignItems: "center",
|
|
506
|
+
justifyContent: "center",
|
|
507
|
+
color: r.colors.primary,
|
|
508
|
+
fontSize: 15,
|
|
509
|
+
fontWeight: 600
|
|
510
|
+
}, children: s == null ? void 0 : s.name.charAt(0) }),
|
|
511
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
512
|
+
padding: "12px 18px",
|
|
513
|
+
borderRadius: "4px 14px 14px 14px",
|
|
514
|
+
background: r.colors.bgCard,
|
|
515
|
+
border: `1px solid ${r.colors.border}`,
|
|
516
|
+
display: "flex",
|
|
517
|
+
alignItems: "center",
|
|
518
|
+
gap: 8
|
|
519
|
+
}, children: [
|
|
520
|
+
/* @__PURE__ */ o.jsx(br, { style: { color: r.colors.primary, fontSize: 14 }, spin: !0 }),
|
|
521
|
+
/* @__PURE__ */ o.jsxs("span", { style: { fontSize: 13, color: r.colors.textMuted }, children: [
|
|
522
|
+
s == null ? void 0 : s.name,
|
|
523
|
+
" 正在思考..."
|
|
524
|
+
] })
|
|
525
|
+
] })
|
|
526
|
+
]
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ o.jsx("div", { ref: N })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
534
|
+
padding: "16px 24px",
|
|
535
|
+
borderTop: `1px solid ${r.colors.border}`,
|
|
536
|
+
background: `${r.colors.bgSecondary}90`,
|
|
537
|
+
backdropFilter: "blur(12px)",
|
|
538
|
+
flexShrink: 0
|
|
539
|
+
}, children: rr === "dialogue" ? /* @__PURE__ */ o.jsxs(o.Fragment, { children: [
|
|
540
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
541
|
+
display: "flex",
|
|
542
|
+
alignItems: "flex-end",
|
|
543
|
+
gap: 10,
|
|
544
|
+
background: r.colors.bgCard,
|
|
545
|
+
border: `1px solid ${v ? r.colors.border : r.colors.primary}40`,
|
|
546
|
+
borderRadius: 14,
|
|
547
|
+
padding: "10px 14px",
|
|
548
|
+
transition: "border-color 0.2s ease"
|
|
549
|
+
}, children: [
|
|
550
|
+
/* @__PURE__ */ o.jsx(
|
|
551
|
+
xr.TextArea,
|
|
552
|
+
{
|
|
553
|
+
ref: w,
|
|
554
|
+
value: p,
|
|
555
|
+
onChange: (e) => S(e.target.value),
|
|
556
|
+
onPressEnter: (e) => {
|
|
557
|
+
e.shiftKey || (e.preventDefault(), G());
|
|
558
|
+
},
|
|
559
|
+
placeholder: s ? `向 ${s.name} 发送消息...` : "输入消息...",
|
|
560
|
+
disabled: v,
|
|
561
|
+
autoSize: { minRows: 1, maxRows: 4 },
|
|
562
|
+
style: {
|
|
563
|
+
flex: 1,
|
|
564
|
+
border: "none",
|
|
565
|
+
boxShadow: "none",
|
|
566
|
+
background: "transparent",
|
|
567
|
+
resize: "none",
|
|
568
|
+
color: r.colors.textPrimary,
|
|
569
|
+
fontSize: 14,
|
|
570
|
+
padding: "4px 0"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
),
|
|
574
|
+
/* @__PURE__ */ o.jsx(
|
|
575
|
+
u,
|
|
576
|
+
{
|
|
577
|
+
type: "primary",
|
|
578
|
+
icon: /* @__PURE__ */ o.jsx(lr, {}),
|
|
579
|
+
onClick: G,
|
|
580
|
+
loading: v,
|
|
581
|
+
disabled: !p.trim(),
|
|
582
|
+
style: {
|
|
583
|
+
borderRadius: 10,
|
|
584
|
+
height: 38,
|
|
585
|
+
width: 38,
|
|
586
|
+
minWidth: 38,
|
|
587
|
+
display: "flex",
|
|
588
|
+
alignItems: "center",
|
|
589
|
+
justifyContent: "center",
|
|
590
|
+
background: p.trim() ? `linear-gradient(135deg, ${r.colors.primary} 0%, ${r.colors.primaryDark} 100%)` : r.colors.bgSecondary,
|
|
591
|
+
border: "none",
|
|
592
|
+
boxShadow: p.trim() ? `0 2px 8px ${r.colors.primary}40` : "none",
|
|
593
|
+
transition: "all 0.2s ease"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
)
|
|
597
|
+
] }),
|
|
598
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
599
|
+
display: "flex",
|
|
600
|
+
justifyContent: "space-between",
|
|
601
|
+
alignItems: "center",
|
|
602
|
+
marginTop: 8,
|
|
603
|
+
padding: "0 4px"
|
|
604
|
+
}, children: [
|
|
605
|
+
/* @__PURE__ */ o.jsx("span", { style: { fontSize: 11, color: r.colors.textMuted }, children: "Enter 发送 / Shift+Enter 换行" }),
|
|
606
|
+
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12 }, children: [
|
|
607
|
+
/* @__PURE__ */ o.jsxs("span", { style: { fontSize: 11, color: r.colors.textMuted }, children: [
|
|
608
|
+
"已对话 ",
|
|
609
|
+
z.messages.length,
|
|
610
|
+
" 条"
|
|
611
|
+
] }),
|
|
612
|
+
sr && /* @__PURE__ */ o.jsx(
|
|
613
|
+
u,
|
|
614
|
+
{
|
|
615
|
+
type: "text",
|
|
616
|
+
size: "small",
|
|
617
|
+
icon: /* @__PURE__ */ o.jsx(dr, {}),
|
|
618
|
+
onClick: er,
|
|
619
|
+
style: {
|
|
620
|
+
fontSize: 12,
|
|
621
|
+
color: r.colors.primary,
|
|
622
|
+
borderRadius: 6,
|
|
623
|
+
border: `1px solid ${r.colors.primary}40`,
|
|
624
|
+
height: 26
|
|
625
|
+
},
|
|
626
|
+
children: "结束对话"
|
|
627
|
+
}
|
|
628
|
+
)
|
|
629
|
+
] })
|
|
630
|
+
] })
|
|
631
|
+
] }) : (
|
|
632
|
+
/* 立场总结阶段 */
|
|
633
|
+
/* @__PURE__ */ o.jsxs(
|
|
634
|
+
b.div,
|
|
635
|
+
{
|
|
636
|
+
initial: { opacity: 0, y: 10 },
|
|
637
|
+
animate: { opacity: 1, y: 0 },
|
|
638
|
+
transition: { duration: 0.3 },
|
|
639
|
+
children: [
|
|
640
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
641
|
+
fontSize: 14,
|
|
642
|
+
fontWeight: 600,
|
|
643
|
+
color: r.colors.textPrimary,
|
|
644
|
+
marginBottom: 12,
|
|
645
|
+
display: "flex",
|
|
646
|
+
alignItems: "center",
|
|
647
|
+
gap: 8
|
|
648
|
+
}, children: [
|
|
649
|
+
/* @__PURE__ */ o.jsx(q, { style: { color: r.colors.primary } }),
|
|
650
|
+
"角色立场总结"
|
|
651
|
+
] }),
|
|
652
|
+
/* @__PURE__ */ o.jsxs("div", { style: {
|
|
653
|
+
display: "flex",
|
|
654
|
+
flexDirection: "column",
|
|
655
|
+
gap: 8,
|
|
656
|
+
maxHeight: 180,
|
|
657
|
+
overflowY: "auto",
|
|
658
|
+
marginBottom: 16
|
|
659
|
+
}, children: [
|
|
660
|
+
Object.entries(k).map(([e, i]) => /* @__PURE__ */ o.jsxs("div", { style: {
|
|
661
|
+
display: "flex",
|
|
662
|
+
alignItems: "flex-start",
|
|
663
|
+
gap: 10,
|
|
664
|
+
padding: "8px 12px",
|
|
665
|
+
borderRadius: 10,
|
|
666
|
+
background: `${r.colors.bgPrimary}80`,
|
|
667
|
+
border: `1px solid ${r.colors.border}`
|
|
668
|
+
}, children: [
|
|
669
|
+
/* @__PURE__ */ o.jsx("div", { style: {
|
|
670
|
+
width: 28,
|
|
671
|
+
height: 28,
|
|
672
|
+
borderRadius: "50%",
|
|
673
|
+
flexShrink: 0,
|
|
674
|
+
background: `${r.colors.primary}20`,
|
|
675
|
+
border: `1.5px solid ${r.colors.primary}50`,
|
|
676
|
+
display: "flex",
|
|
677
|
+
alignItems: "center",
|
|
678
|
+
justifyContent: "center",
|
|
679
|
+
color: r.colors.primary,
|
|
680
|
+
fontSize: 12,
|
|
681
|
+
fontWeight: 600
|
|
682
|
+
}, children: e.charAt(0) }),
|
|
683
|
+
/* @__PURE__ */ o.jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
|
|
684
|
+
/* @__PURE__ */ o.jsx("div", { style: { fontSize: 13, fontWeight: 600, color: r.colors.textPrimary, marginBottom: 2 }, children: e }),
|
|
685
|
+
/* @__PURE__ */ o.jsx(X, { title: i, placement: "topLeft", overlayStyle: { maxWidth: 400 }, children: /* @__PURE__ */ o.jsx("div", { style: {
|
|
686
|
+
fontSize: 12,
|
|
687
|
+
color: r.colors.textSecondary,
|
|
688
|
+
lineHeight: 1.5,
|
|
689
|
+
overflow: "hidden",
|
|
690
|
+
textOverflow: "ellipsis",
|
|
691
|
+
display: "-webkit-box",
|
|
692
|
+
WebkitLineClamp: 2,
|
|
693
|
+
WebkitBoxOrient: "vertical",
|
|
694
|
+
cursor: "pointer"
|
|
695
|
+
}, children: i }) })
|
|
696
|
+
] })
|
|
697
|
+
] }, e)),
|
|
698
|
+
Object.keys(k).length === 0 && /* @__PURE__ */ o.jsx("div", { style: { fontSize: 12, color: r.colors.textMuted, textAlign: "center", padding: 12 }, children: "暂无角色立场记录" })
|
|
699
|
+
] }),
|
|
700
|
+
/* @__PURE__ */ o.jsxs("div", { style: { display: "flex", gap: 10, justifyContent: "flex-end" }, children: [
|
|
701
|
+
/* @__PURE__ */ o.jsx(
|
|
702
|
+
u,
|
|
703
|
+
{
|
|
704
|
+
ghost: !0,
|
|
705
|
+
onClick: () => {
|
|
706
|
+
H("dialogue");
|
|
707
|
+
},
|
|
708
|
+
style: {
|
|
709
|
+
borderRadius: 8,
|
|
710
|
+
borderColor: r.colors.border,
|
|
711
|
+
color: r.colors.textSecondary,
|
|
712
|
+
height: 36
|
|
713
|
+
},
|
|
714
|
+
children: "继续对话"
|
|
715
|
+
}
|
|
716
|
+
),
|
|
717
|
+
/* @__PURE__ */ o.jsx(
|
|
718
|
+
u,
|
|
719
|
+
{
|
|
720
|
+
ghost: !0,
|
|
721
|
+
onClick: B,
|
|
722
|
+
style: {
|
|
723
|
+
borderRadius: 8,
|
|
724
|
+
borderColor: r.colors.border,
|
|
725
|
+
color: r.colors.textSecondary,
|
|
726
|
+
height: 36
|
|
727
|
+
},
|
|
728
|
+
children: "返回结果"
|
|
729
|
+
}
|
|
730
|
+
),
|
|
731
|
+
/* @__PURE__ */ o.jsx(
|
|
732
|
+
u,
|
|
733
|
+
{
|
|
734
|
+
type: "primary",
|
|
735
|
+
icon: /* @__PURE__ */ o.jsx(mr, {}),
|
|
736
|
+
onClick: () => Q(k),
|
|
737
|
+
style: {
|
|
738
|
+
borderRadius: 8,
|
|
739
|
+
height: 36,
|
|
740
|
+
background: `linear-gradient(135deg, ${r.colors.primary} 0%, ${r.colors.primaryDark} 100%)`,
|
|
741
|
+
border: "none",
|
|
742
|
+
boxShadow: `0 2px 8px ${r.colors.primary}40`
|
|
743
|
+
},
|
|
744
|
+
children: "调整我的决策"
|
|
745
|
+
}
|
|
746
|
+
)
|
|
747
|
+
] })
|
|
748
|
+
]
|
|
749
|
+
}
|
|
750
|
+
)
|
|
751
|
+
) }),
|
|
752
|
+
/* @__PURE__ */ o.jsx("style", { children: `
|
|
753
|
+
.dialogue-messages-scroll::-webkit-scrollbar {
|
|
754
|
+
width: 5px;
|
|
755
|
+
}
|
|
756
|
+
.dialogue-messages-scroll::-webkit-scrollbar-track {
|
|
757
|
+
background: transparent;
|
|
758
|
+
}
|
|
759
|
+
.dialogue-messages-scroll::-webkit-scrollbar-thumb {
|
|
760
|
+
background: ${r.colors.border};
|
|
761
|
+
border-radius: 3px;
|
|
762
|
+
}
|
|
763
|
+
.dialogue-messages-scroll::-webkit-scrollbar-thumb:hover {
|
|
764
|
+
background: ${r.colors.textMuted};
|
|
765
|
+
}
|
|
766
|
+
` })
|
|
767
|
+
]
|
|
768
|
+
}
|
|
769
|
+
)
|
|
770
|
+
]
|
|
771
|
+
}
|
|
772
|
+
);
|
|
773
|
+
};
|
|
774
|
+
export {
|
|
775
|
+
zr as default
|
|
776
|
+
};
|