@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,87 @@
|
|
|
1
|
+
import { j as r, d as a } from "./RadarChart-C5ZM0kWt.js";
|
|
2
|
+
import { Popover as d, Card as c } from "antd";
|
|
3
|
+
const g = ({ title: e, variant: l, theme: o, noMargin: s }) => {
|
|
4
|
+
const i = s ? 0 : 16, n = /* @__PURE__ */ r.jsx(
|
|
5
|
+
d,
|
|
6
|
+
{
|
|
7
|
+
content: /* @__PURE__ */ r.jsx("div", { style: { maxWidth: 300, fontSize: 13, lineHeight: 1.7, color: "#333", whiteSpace: "pre-wrap" }, children: e }),
|
|
8
|
+
title: "场景描述",
|
|
9
|
+
trigger: "click",
|
|
10
|
+
placement: "bottomRight",
|
|
11
|
+
children: /* @__PURE__ */ r.jsx(
|
|
12
|
+
a,
|
|
13
|
+
{
|
|
14
|
+
style: {
|
|
15
|
+
fontSize: 13,
|
|
16
|
+
color: o.primaryColor,
|
|
17
|
+
cursor: "pointer",
|
|
18
|
+
flexShrink: 0,
|
|
19
|
+
opacity: 0.75
|
|
20
|
+
},
|
|
21
|
+
onClick: (t) => t.stopPropagation()
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
return l === "minimal" ? /* @__PURE__ */ r.jsx("h3", { style: { margin: `0 0 ${i}px`, color: o.headerColor }, children: e }) : l === "banner" ? /* @__PURE__ */ r.jsxs(
|
|
27
|
+
"div",
|
|
28
|
+
{
|
|
29
|
+
style: {
|
|
30
|
+
marginBottom: i,
|
|
31
|
+
padding: "8px 16px",
|
|
32
|
+
backgroundColor: o.headerBg,
|
|
33
|
+
color: o.headerColor,
|
|
34
|
+
borderRadius: o.borderRadius,
|
|
35
|
+
display: "flex",
|
|
36
|
+
alignItems: "center",
|
|
37
|
+
gap: 8
|
|
38
|
+
},
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ r.jsx(
|
|
41
|
+
"h3",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
margin: 0,
|
|
45
|
+
color: "inherit",
|
|
46
|
+
fontSize: 14,
|
|
47
|
+
flex: 1,
|
|
48
|
+
overflow: "hidden",
|
|
49
|
+
textOverflow: "ellipsis",
|
|
50
|
+
whiteSpace: "nowrap"
|
|
51
|
+
},
|
|
52
|
+
children: e
|
|
53
|
+
}
|
|
54
|
+
),
|
|
55
|
+
n
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
) : /* @__PURE__ */ r.jsx(
|
|
59
|
+
c,
|
|
60
|
+
{
|
|
61
|
+
size: "small",
|
|
62
|
+
style: { marginBottom: i, backgroundColor: o.headerBg },
|
|
63
|
+
styles: { body: { padding: "6px 12px" } },
|
|
64
|
+
children: /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
65
|
+
/* @__PURE__ */ r.jsx(
|
|
66
|
+
"h3",
|
|
67
|
+
{
|
|
68
|
+
style: {
|
|
69
|
+
margin: 0,
|
|
70
|
+
color: o.headerColor,
|
|
71
|
+
fontSize: 14,
|
|
72
|
+
flex: 1,
|
|
73
|
+
overflow: "hidden",
|
|
74
|
+
textOverflow: "ellipsis",
|
|
75
|
+
whiteSpace: "nowrap"
|
|
76
|
+
},
|
|
77
|
+
children: e
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
n
|
|
81
|
+
] })
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
g as P
|
|
87
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { j as t } from "./RadarChart-C5ZM0kWt.js";
|
|
2
|
+
import { useState as m } from "react";
|
|
3
|
+
import { Alert as y, Card as S, Steps as i, Button as c } from "antd";
|
|
4
|
+
import { a as f } from "./judgement-D_9i7x9S.js";
|
|
5
|
+
const b = ({
|
|
6
|
+
initData: e,
|
|
7
|
+
checkRules: j,
|
|
8
|
+
onFinish: n
|
|
9
|
+
}) => {
|
|
10
|
+
const [l, d] = m(0), [s, u] = m([]), o = (e == null ? void 0 : e.systemSteps) || [], g = (r) => {
|
|
11
|
+
s.includes(r) || u([...s, r]), r < o.length - 1 && d(r + 1);
|
|
12
|
+
}, h = () => {
|
|
13
|
+
n({
|
|
14
|
+
stepId: (e == null ? void 0 : e.stepId) || "unknown",
|
|
15
|
+
operationType: "process-operation",
|
|
16
|
+
operationData: {
|
|
17
|
+
completedSteps: s,
|
|
18
|
+
totalSteps: o.length
|
|
19
|
+
},
|
|
20
|
+
operationLog: s.map((r) => ({
|
|
21
|
+
action: "step-complete",
|
|
22
|
+
step: o[r],
|
|
23
|
+
timestamp: Date.now()
|
|
24
|
+
})),
|
|
25
|
+
timestamp: Date.now(),
|
|
26
|
+
evidenceSummary: f({
|
|
27
|
+
sourceStepId: (e == null ? void 0 : e.stepId) || "unknown",
|
|
28
|
+
sourceStepName: (e == null ? void 0 : e.stepName) || "流程操作",
|
|
29
|
+
sourceType: "process-operation",
|
|
30
|
+
title: `${(e == null ? void 0 : e.stepName) || "流程操作"}摘要`,
|
|
31
|
+
summary: `已完成 ${s.length}/${o.length} 个操作步骤。`,
|
|
32
|
+
keyFacts: [
|
|
33
|
+
{ label: "完成步骤数", value: String(s.length) },
|
|
34
|
+
{ label: "总步骤数", value: String(o.length) }
|
|
35
|
+
]
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { padding: "20px" }, children: [
|
|
40
|
+
/* @__PURE__ */ t.jsx(
|
|
41
|
+
y,
|
|
42
|
+
{
|
|
43
|
+
message: "流程操作插件",
|
|
44
|
+
description: "这是一个占位符插件。实际应该模拟系统界面操作。",
|
|
45
|
+
type: "info",
|
|
46
|
+
showIcon: !0,
|
|
47
|
+
style: { marginBottom: "16px" }
|
|
48
|
+
}
|
|
49
|
+
),
|
|
50
|
+
o.length > 0 && /* @__PURE__ */ t.jsxs(S, { title: "操作步骤", size: "small", style: { marginBottom: "16px" }, children: [
|
|
51
|
+
/* @__PURE__ */ t.jsx(
|
|
52
|
+
i,
|
|
53
|
+
{
|
|
54
|
+
direction: "vertical",
|
|
55
|
+
current: l,
|
|
56
|
+
items: o.map((r, p) => ({
|
|
57
|
+
title: r,
|
|
58
|
+
description: s.includes(p) ? "已完成" : "",
|
|
59
|
+
status: s.includes(p) ? "finish" : p === l ? "process" : "wait"
|
|
60
|
+
}))
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ t.jsx("div", { style: { marginTop: "16px" }, children: l < o.length && /* @__PURE__ */ t.jsx(
|
|
64
|
+
c,
|
|
65
|
+
{
|
|
66
|
+
type: "primary",
|
|
67
|
+
onClick: () => g(l),
|
|
68
|
+
disabled: s.includes(l),
|
|
69
|
+
children: "完成当前步骤"
|
|
70
|
+
}
|
|
71
|
+
) })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ t.jsx(
|
|
74
|
+
c,
|
|
75
|
+
{
|
|
76
|
+
type: "primary",
|
|
77
|
+
size: "large",
|
|
78
|
+
onClick: h,
|
|
79
|
+
block: !0,
|
|
80
|
+
disabled: s.length < o.length,
|
|
81
|
+
children: "完成所有操作"
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
] });
|
|
85
|
+
};
|
|
86
|
+
export {
|
|
87
|
+
b as default
|
|
88
|
+
};
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { g as $, j as s, e as C } from "./RadarChart-C5ZM0kWt.js";
|
|
2
|
+
import { useState as f, useRef as q, useCallback as B } from "react";
|
|
3
|
+
import { message as y, Card as K, List as b, Tag as m, Spin as E, Space as L, Input as P, Button as v } from "antd";
|
|
4
|
+
import { a as z, M as N } from "./TrainingModelContainer-DpW-uB8O.js";
|
|
5
|
+
import { a as U, b as H } from "./WarningOutlined-5g1d66hO.js";
|
|
6
|
+
const { TextArea: M } = P, W = ({
|
|
7
|
+
initData: e,
|
|
8
|
+
checkRules: O,
|
|
9
|
+
onFinish: g
|
|
10
|
+
}) => {
|
|
11
|
+
const [c, j] = f(""), [d, u] = f([]), [p, i] = f(!1), R = $("TUTOR_AGENT"), S = (e == null ? void 0 : e.currentUser) || { userId: "student-001" }, k = (e == null ? void 0 : e.domain) || "银行", { callAI: w, ready: x } = z(R, S), a = q(!0), T = (r) => {
|
|
12
|
+
var I;
|
|
13
|
+
if (!a.current)
|
|
14
|
+
return r;
|
|
15
|
+
const l = (e == null ? void 0 : e.context) || "", o = ((I = e == null ? void 0 : e.currentStep) == null ? void 0 : I.name) || "", n = (e == null ? void 0 : e.modelName) || "", t = (e == null ? void 0 : e.businessType) || "", h = (e == null ? void 0 : e.targetPosition) || "";
|
|
16
|
+
return `
|
|
17
|
+
## 实训场景信息
|
|
18
|
+
- 模型名称:${n}
|
|
19
|
+
- 业务领域:${k}
|
|
20
|
+
- 业务类型:${t}
|
|
21
|
+
- 目标岗位:${h}
|
|
22
|
+
- 当前步骤:${o}
|
|
23
|
+
|
|
24
|
+
## 场景上下文
|
|
25
|
+
${l || "(无额外上下文)"}
|
|
26
|
+
|
|
27
|
+
## 学生的问题
|
|
28
|
+
${r}
|
|
29
|
+
`.trim();
|
|
30
|
+
}, A = B(async () => {
|
|
31
|
+
if (!c.trim()) {
|
|
32
|
+
y.warning("请输入问题");
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (!x) {
|
|
36
|
+
y.error("AI服务未就绪,请稍后再试");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const r = c.trim();
|
|
40
|
+
i(!0), j("");
|
|
41
|
+
try {
|
|
42
|
+
const l = T(r);
|
|
43
|
+
let o = "";
|
|
44
|
+
await w(l, (n, t) => {
|
|
45
|
+
t && (o = n);
|
|
46
|
+
}), a.current = !1;
|
|
47
|
+
try {
|
|
48
|
+
const n = JSON.parse(o), t = {
|
|
49
|
+
id: Date.now(),
|
|
50
|
+
question: r,
|
|
51
|
+
answer: n.answer || o,
|
|
52
|
+
timestamp: Date.now(),
|
|
53
|
+
relatedKnowledge: n.relatedKnowledge
|
|
54
|
+
};
|
|
55
|
+
u((h) => [...h, t]);
|
|
56
|
+
} catch {
|
|
57
|
+
const n = {
|
|
58
|
+
id: Date.now(),
|
|
59
|
+
question: r,
|
|
60
|
+
answer: o || "抱歉,我暂时无法回答这个问题",
|
|
61
|
+
timestamp: Date.now()
|
|
62
|
+
};
|
|
63
|
+
u((t) => [...t, n]);
|
|
64
|
+
}
|
|
65
|
+
} catch (l) {
|
|
66
|
+
console.error("获取回答失败:", l), y.error("获取回答失败,请重试");
|
|
67
|
+
const o = {
|
|
68
|
+
id: Date.now(),
|
|
69
|
+
question: r,
|
|
70
|
+
answer: "抱歉,AI服务暂时不可用,请稍后再试",
|
|
71
|
+
timestamp: Date.now()
|
|
72
|
+
};
|
|
73
|
+
u((n) => [...n, o]);
|
|
74
|
+
} finally {
|
|
75
|
+
i(!1);
|
|
76
|
+
}
|
|
77
|
+
}, [c, x, w, e]), Q = () => {
|
|
78
|
+
g == null || g({
|
|
79
|
+
stepId: (e == null ? void 0 : e.stepId) || "unknown",
|
|
80
|
+
operationType: "qa",
|
|
81
|
+
operationData: {
|
|
82
|
+
qaHistory: d,
|
|
83
|
+
totalQuestions: d.length
|
|
84
|
+
},
|
|
85
|
+
operationLog: [],
|
|
86
|
+
timestamp: Date.now()
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
return /* @__PURE__ */ s.jsxs("div", { style: { padding: "20px" }, children: [
|
|
90
|
+
(e == null ? void 0 : e.title) && /* @__PURE__ */ s.jsxs(K, { size: "small", style: { marginBottom: "16px", backgroundColor: "#f0f9ff" }, children: [
|
|
91
|
+
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
92
|
+
/* @__PURE__ */ s.jsx(U, { style: { color: "#1890ff" } }),
|
|
93
|
+
/* @__PURE__ */ s.jsx("strong", { children: e.title })
|
|
94
|
+
] }),
|
|
95
|
+
e.description && /* @__PURE__ */ s.jsx("p", { style: { margin: "8px 0 0", color: "#666" }, children: e.description })
|
|
96
|
+
] }),
|
|
97
|
+
/* @__PURE__ */ s.jsxs(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
style: {
|
|
101
|
+
border: "1px solid #d9d9d9",
|
|
102
|
+
borderRadius: "8px",
|
|
103
|
+
padding: "16px",
|
|
104
|
+
height: "400px",
|
|
105
|
+
overflowY: "auto",
|
|
106
|
+
marginBottom: "16px",
|
|
107
|
+
backgroundColor: "#fafafa"
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
d.length === 0 ? /* @__PURE__ */ s.jsxs("div", { style: { textAlign: "center", color: "#999", paddingTop: "100px" }, children: [
|
|
111
|
+
/* @__PURE__ */ s.jsx(H, { style: { fontSize: "48px", marginBottom: "16px" } }),
|
|
112
|
+
/* @__PURE__ */ s.jsx("p", { children: "暂无问答记录" }),
|
|
113
|
+
/* @__PURE__ */ s.jsx("p", { children: "请在下方输入您的问题" })
|
|
114
|
+
] }) : /* @__PURE__ */ s.jsx(
|
|
115
|
+
b,
|
|
116
|
+
{
|
|
117
|
+
dataSource: d,
|
|
118
|
+
renderItem: (r) => /* @__PURE__ */ s.jsxs(b.Item, { style: { display: "block", border: "none", padding: "8px 0" }, children: [
|
|
119
|
+
/* @__PURE__ */ s.jsxs("div", { style: { marginBottom: "8px" }, children: [
|
|
120
|
+
/* @__PURE__ */ s.jsx(m, { color: "blue", children: "问题" }),
|
|
121
|
+
/* @__PURE__ */ s.jsx("span", { children: r.question })
|
|
122
|
+
] }),
|
|
123
|
+
/* @__PURE__ */ s.jsxs("div", { style: { marginLeft: "24px" }, children: [
|
|
124
|
+
/* @__PURE__ */ s.jsx(m, { color: "green", children: "回答" }),
|
|
125
|
+
/* @__PURE__ */ s.jsx(N, { content: r.answer })
|
|
126
|
+
] }),
|
|
127
|
+
r.relatedKnowledge && r.relatedKnowledge.length > 0 && /* @__PURE__ */ s.jsxs("div", { style: { marginLeft: "24px", marginTop: "8px" }, children: [
|
|
128
|
+
/* @__PURE__ */ s.jsx(m, { children: "相关知识点" }),
|
|
129
|
+
r.relatedKnowledge.map((l, o) => /* @__PURE__ */ s.jsx(m, { color: "orange", children: l }, o))
|
|
130
|
+
] })
|
|
131
|
+
] })
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
p && /* @__PURE__ */ s.jsx("div", { style: { textAlign: "center", padding: "20px" }, children: /* @__PURE__ */ s.jsx(E, { tip: "AI 正在思考..." }) })
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
/* @__PURE__ */ s.jsxs(L.Compact, { style: { width: "100%", marginBottom: "16px" }, children: [
|
|
139
|
+
/* @__PURE__ */ s.jsx(
|
|
140
|
+
M,
|
|
141
|
+
{
|
|
142
|
+
value: c,
|
|
143
|
+
onChange: (r) => j(r.target.value),
|
|
144
|
+
onPressEnter: (r) => {
|
|
145
|
+
r.shiftKey || (r.preventDefault(), A());
|
|
146
|
+
},
|
|
147
|
+
placeholder: "请输入您的业务问题... (Shift+Enter换行,Enter发送)",
|
|
148
|
+
autoSize: { minRows: 2, maxRows: 4 },
|
|
149
|
+
style: { flex: 1 },
|
|
150
|
+
disabled: p || !x
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
/* @__PURE__ */ s.jsx(
|
|
154
|
+
v,
|
|
155
|
+
{
|
|
156
|
+
type: "primary",
|
|
157
|
+
icon: /* @__PURE__ */ s.jsx(C, {}),
|
|
158
|
+
onClick: A,
|
|
159
|
+
disabled: !c.trim() || p || !x,
|
|
160
|
+
loading: p,
|
|
161
|
+
style: { height: "auto" },
|
|
162
|
+
children: "提问"
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] }),
|
|
166
|
+
/* @__PURE__ */ s.jsx("div", { style: { textAlign: "right" }, children: /* @__PURE__ */ s.jsxs(
|
|
167
|
+
v,
|
|
168
|
+
{
|
|
169
|
+
type: "primary",
|
|
170
|
+
size: "large",
|
|
171
|
+
onClick: Q,
|
|
172
|
+
disabled: d.length === 0,
|
|
173
|
+
children: [
|
|
174
|
+
"完成答疑 (",
|
|
175
|
+
d.length,
|
|
176
|
+
" 个问题)"
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
) })
|
|
180
|
+
] });
|
|
181
|
+
};
|
|
182
|
+
export {
|
|
183
|
+
W as default
|
|
184
|
+
};
|