@wandox/sdk 0.1.34 → 0.1.35
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/{index-BXVFHGjy.js → V1Workbench-Duh15otc.js} +1418 -1739
- package/dist/V1Workbench-OnGicnM-.cjs +3 -0
- package/dist/V2Workbench-ChqSBXHY.cjs +2 -0
- package/dist/V2Workbench-Cwx-XP5u.js +2170 -0
- package/dist/{useWorkbenchSession-kwuVHEAF.js → WorkbenchRuntime-B2C8SbrZ.js} +4623 -3816
- package/dist/WorkbenchRuntime-QRXyaZ5I.cjs +7 -0
- package/dist/{arc-D0KfcB3y.js → arc-C3McnqVx.js} +1 -1
- package/dist/{arc-DtBHZfqY.cjs → arc-CfnbUnJa.cjs} +1 -1
- package/dist/{architectureDiagram-3BPJPVTR-VUz_J4KY.js → architectureDiagram-3BPJPVTR-DKV9z5FO.js} +3 -3
- package/dist/{architectureDiagram-3BPJPVTR-C2P4Wdju.cjs → architectureDiagram-3BPJPVTR-EmeNsmhR.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-DyKZmQ5w.cjs → blockDiagram-GPEHLZMM-B3PO97gR.cjs} +1 -1
- package/dist/{blockDiagram-GPEHLZMM-HQFLyzc_.js → blockDiagram-GPEHLZMM-CwMlZLrY.js} +3 -3
- package/dist/{c4Diagram-AAUBKEIU-TV86wAk4.cjs → c4Diagram-AAUBKEIU-CIJm8DIv.cjs} +1 -1
- package/dist/{c4Diagram-AAUBKEIU-DH1AHWgW.js → c4Diagram-AAUBKEIU-DDvw0p9i.js} +2 -2
- package/dist/{channel-AJpjl4EL.cjs → channel-B6D2dt-a.cjs} +1 -1
- package/dist/{channel-BlVX_pqv.js → channel-BW_f3mZ1.js} +1 -1
- package/dist/{chunk-2J33WTMH-t0efBHaF.js → chunk-2J33WTMH-B9LmfIjP.js} +1 -1
- package/dist/{chunk-2J33WTMH-B3QEVdxo.cjs → chunk-2J33WTMH-CAtXTwyr.cjs} +1 -1
- package/dist/{chunk-4BX2VUAB-B6_TK6LC.js → chunk-4BX2VUAB-C_E82st1.js} +1 -1
- package/dist/{chunk-4BX2VUAB-B3PBOdBd.cjs → chunk-4BX2VUAB-TTJvrk_8.cjs} +1 -1
- package/dist/{chunk-55IACEB6-DrbqgVSi.cjs → chunk-55IACEB6-Co8MIdgs.cjs} +1 -1
- package/dist/{chunk-55IACEB6-Dn6M7DjU.js → chunk-55IACEB6-CuKoQ8P-.js} +1 -1
- package/dist/{chunk-727SXJPM-CZZ8vzvu.js → chunk-727SXJPM-Cs8uS9SJ.js} +5 -5
- package/dist/{chunk-727SXJPM-BxPLhhtr.cjs → chunk-727SXJPM-Cup_K8Hg.cjs} +1 -1
- package/dist/{chunk-AQP2D5EJ-DEFjJjvF.cjs → chunk-AQP2D5EJ-BJ2GPeyZ.cjs} +1 -1
- package/dist/{chunk-AQP2D5EJ-B5tlMkxW.js → chunk-AQP2D5EJ-Ck3VZgwQ.js} +3 -3
- package/dist/{chunk-FMBD7UC4-gFc5W2fF.cjs → chunk-FMBD7UC4-ClCmPgT2.cjs} +1 -1
- package/dist/{chunk-FMBD7UC4-rlodMWnO.js → chunk-FMBD7UC4-_xpDdMNi.js} +1 -1
- package/dist/{chunk-ND2GUHAM-B9qs3P-w.cjs → chunk-ND2GUHAM-5_kT1SOB.cjs} +1 -1
- package/dist/{chunk-ND2GUHAM-dJ5LgRGw.js → chunk-ND2GUHAM-BahupltG.js} +1 -1
- package/dist/{chunk-QZHKN3VN-D25PBsy4.cjs → chunk-QZHKN3VN-Ca5tmmHx.cjs} +1 -1
- package/dist/{chunk-QZHKN3VN-ChUvXVo2.js → chunk-QZHKN3VN-CdL_F3Vv.js} +1 -1
- package/dist/{classDiagram-4FO5ZUOK-CPy1KaCR.js → classDiagram-4FO5ZUOK-CnMvmQcX.js} +2 -2
- package/dist/{classDiagram-4FO5ZUOK-wFEmQFl-.cjs → classDiagram-4FO5ZUOK-DZ87tNdh.cjs} +1 -1
- package/dist/{classDiagram-v2-Q7XG4LA2-CSZEPTC6.js → classDiagram-v2-Q7XG4LA2-90g5yMq9.js} +2 -2
- package/dist/{classDiagram-v2-Q7XG4LA2-wFEmQFl-.cjs → classDiagram-v2-Q7XG4LA2-DZ87tNdh.cjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-C4j5j5T6.cjs → cose-bilkent-S5V4N54A-D9USBZBY.cjs} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-uRPNkg7E.js → cose-bilkent-S5V4N54A-DOMJ8Dw0.js} +6 -6
- package/dist/{dagre-BM42HDAG-Iv0znKTe.js → dagre-BM42HDAG-BruKrkrz.js} +1 -1
- package/dist/{dagre-BM42HDAG-C--V1vcV.cjs → dagre-BM42HDAG-D9xkOYd1.cjs} +1 -1
- package/dist/{diagram-2AECGRRQ-BSOkNy0d.js → diagram-2AECGRRQ-B7fBRPEm.js} +2 -2
- package/dist/{diagram-2AECGRRQ-DgTZEGRd.cjs → diagram-2AECGRRQ-CHwHxLjN.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-D5Mkr0VI.cjs → diagram-5GNKFQAL-B3sIjwSe.cjs} +1 -1
- package/dist/{diagram-5GNKFQAL-C91PObIK.js → diagram-5GNKFQAL-C68LRU93.js} +3 -3
- package/dist/{diagram-KO2AKTUF-Bg-zssV4.cjs → diagram-KO2AKTUF-CZkt3wwK.cjs} +1 -1
- package/dist/{diagram-KO2AKTUF-CAH3eDcz.js → diagram-KO2AKTUF-Decii5jM.js} +2 -2
- package/dist/{diagram-LMA3HP47-hOSm9f_K.js → diagram-LMA3HP47-BRJpaLnd.js} +2 -2
- package/dist/{diagram-LMA3HP47-SMfJTnR5.cjs → diagram-LMA3HP47-D7hixvGx.cjs} +1 -1
- package/dist/{diagram-OG6HWLK6-B-QlPomq.js → diagram-OG6HWLK6-DwSOhl1j.js} +3 -3
- package/dist/{diagram-OG6HWLK6-DNEN_x2d.cjs → diagram-OG6HWLK6-dSSwZ9rN.cjs} +1 -1
- package/dist/{erDiagram-TEJ5UH35-CG6J3vIN.cjs → erDiagram-TEJ5UH35-CCZ0q594.cjs} +1 -1
- package/dist/{erDiagram-TEJ5UH35-CmiMTzqm.js → erDiagram-TEJ5UH35-ClUTkoiL.js} +4 -4
- package/dist/{flowDiagram-I6XJVG4X-BODLJZMQ.cjs → flowDiagram-I6XJVG4X-BN-jwNXL.cjs} +1 -1
- package/dist/{flowDiagram-I6XJVG4X-B-oB1PyG.js → flowDiagram-I6XJVG4X-CfhSJE55.js} +6 -6
- package/dist/{ganttDiagram-6RSMTGT7-kGQE-0fY.cjs → ganttDiagram-6RSMTGT7-CF1liYk-.cjs} +1 -1
- package/dist/{ganttDiagram-6RSMTGT7-4H-Azqhw.js → ganttDiagram-6RSMTGT7-Dq7VvM2M.js} +3 -3
- package/dist/{gitGraphDiagram-PVQCEYII-Dj601cg2.cjs → gitGraphDiagram-PVQCEYII-P9t07gif.cjs} +1 -1
- package/dist/{gitGraphDiagram-PVQCEYII-ZKxubOBO.js → gitGraphDiagram-PVQCEYII-odnoukk4.js} +3 -3
- package/dist/{index-D4dy8yHF.js → index-4FmQg3Zk.js} +29968 -30251
- package/dist/{index-D3SW2cEr.cjs → index-BQMJ9VDu.cjs} +1 -1
- package/dist/{index-q34Z4QAw.js → index-CFEgQrfn.js} +12 -12
- package/dist/{index-5xbDqXDX.cjs → index-CLCe0Dgz.cjs} +1 -1
- package/dist/index-CQgUKSVP.cjs +785 -0
- package/dist/{index-DkJpASom.js → index-Cq6GT084.js} +34 -34
- package/dist/{infoDiagram-5YYISTIA-mdLUb8Pf.js → infoDiagram-5YYISTIA-CzWTUV3i.js} +1 -1
- package/dist/{infoDiagram-5YYISTIA-CfJwXJqb.cjs → infoDiagram-5YYISTIA-vIftEDKa.cjs} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-CfS3BeT3.js → ishikawaDiagram-YF4QCWOH-5oQSrlLN.js} +1 -1
- package/dist/{ishikawaDiagram-YF4QCWOH-BSPYHzHI.cjs → ishikawaDiagram-YF4QCWOH-DoFATknv.cjs} +1 -1
- package/dist/{journeyDiagram-JHISSGLW-DUwZdGOg.js → journeyDiagram-JHISSGLW-BHsXT1p8.js} +4 -4
- package/dist/{journeyDiagram-JHISSGLW-nnM-h5QJ.cjs → journeyDiagram-JHISSGLW-DUspfQIx.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-Dt1TxPqZ.cjs → kanban-definition-UN3LZRKU-BqKlDwWt.cjs} +1 -1
- package/dist/{kanban-definition-UN3LZRKU-BtP29Iaf.js → kanban-definition-UN3LZRKU-CbizhZ4A.js} +2 -2
- package/dist/{linear-Bj7ETfty.cjs → linear-BeJA81Is.cjs} +1 -1
- package/dist/{linear-DZDNy162.js → linear-O3WIbS9A.js} +1 -1
- package/dist/{mermaid.core-Cc1KxlCM.js → mermaid.core-C-YWP2jz.js} +35 -35
- package/dist/{mermaid.core-BTaTUIUu.cjs → mermaid.core-EIMF3BAo.cjs} +3 -3
- package/dist/{mindmap-definition-RKZ34NQL-Cf0zrR9M.cjs → mindmap-definition-RKZ34NQL-DcaDYCfJ.cjs} +1 -1
- package/dist/{mindmap-definition-RKZ34NQL-DZH26qfU.js → mindmap-definition-RKZ34NQL-yQ9g46ph.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-Ddif1ew2.js → pieDiagram-4H26LBE5-BPAmrvlh.js} +3 -3
- package/dist/{pieDiagram-4H26LBE5-DRAafsrW.cjs → pieDiagram-4H26LBE5-DDbOWta5.cjs} +1 -1
- package/dist/{quadrantDiagram-W4KKPZXB-BbkfZqRA.cjs → quadrantDiagram-W4KKPZXB-7EOeN28t.cjs} +1 -1
- package/dist/{quadrantDiagram-W4KKPZXB-Cug5Y7_G.js → quadrantDiagram-W4KKPZXB-CBFKlxRx.js} +2 -2
- package/dist/{requirementDiagram-4Y6WPE33-CWZD0-rx.cjs → requirementDiagram-4Y6WPE33-BAkakkMp.cjs} +1 -1
- package/dist/{requirementDiagram-4Y6WPE33-DwnBT67e.js → requirementDiagram-4Y6WPE33-BZk_3wFB.js} +3 -3
- package/dist/{sankeyDiagram-5OEKKPKP-BFE8-91E.js → sankeyDiagram-5OEKKPKP-CrbL-5cr.js} +1 -1
- package/dist/{sankeyDiagram-5OEKKPKP-I3_O-pWr.cjs → sankeyDiagram-5OEKKPKP-DYEggaLM.cjs} +1 -1
- package/dist/{sequenceDiagram-3UESZ5HK-ChL5sWeE.js → sequenceDiagram-3UESZ5HK-B2Yk8NuE.js} +3 -3
- package/dist/{sequenceDiagram-3UESZ5HK-CfoKZAsg.cjs → sequenceDiagram-3UESZ5HK-cky8-ajI.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-DUnFbttq.cjs → stateDiagram-AJRCARHV-4peSgT8x.cjs} +1 -1
- package/dist/{stateDiagram-AJRCARHV-DuflU8kG.js → stateDiagram-AJRCARHV-DKppy5jM.js} +2 -2
- package/dist/{stateDiagram-v2-BHNVJYJU-Cf7QVlcI.cjs → stateDiagram-v2-BHNVJYJU-CefiWaGq.cjs} +1 -1
- package/dist/{stateDiagram-v2-BHNVJYJU-DjhPlTO0.js → stateDiagram-v2-BHNVJYJU-DsQP1CsR.js} +2 -2
- package/dist/{timeline-definition-PNZ67QCA-DZfQpSWh.cjs → timeline-definition-PNZ67QCA-CFJYzYQn.cjs} +1 -1
- package/dist/{timeline-definition-PNZ67QCA-Iy3R3U3O.js → timeline-definition-PNZ67QCA-snDcaYSq.js} +2 -2
- package/dist/types.d.ts +7 -7
- package/dist/{vennDiagram-CIIHVFJN-DcNPQahe.js → vennDiagram-CIIHVFJN-BniEMR4w.js} +1 -1
- package/dist/{vennDiagram-CIIHVFJN-DxHgY0Ea.cjs → vennDiagram-CIIHVFJN-RPKP_Mb2.cjs} +1 -1
- package/dist/wandox.cjs +1 -1
- package/dist/wandox.css +1 -1
- package/dist/wandox.js +1 -1
- package/dist/wandox.umd.js +653 -653
- package/dist/{wardleyDiagram-YWT4CUSO-b2m-CjkO.js → wardleyDiagram-YWT4CUSO-DvDYViI5.js} +2 -2
- package/dist/{wardleyDiagram-YWT4CUSO-Dy3rxs_V.cjs → wardleyDiagram-YWT4CUSO-msArC69-.cjs} +1 -1
- package/dist/{xychartDiagram-2RQKCTM6-TK9Lfh_u.cjs → xychartDiagram-2RQKCTM6-B4nZMXk5.cjs} +1 -1
- package/dist/{xychartDiagram-2RQKCTM6-CQEovrBb.js → xychartDiagram-2RQKCTM6-CEcIgPon.js} +2 -2
- package/package.json +1 -1
- package/dist/index-BPJc-VZw.cjs +0 -785
- package/dist/index-BUHRhy1Y.cjs +0 -3
- package/dist/index-B_nZ3LrV.js +0 -2379
- package/dist/index-DwVmVXmF.cjs +0 -2
- package/dist/useWorkbenchSession-CuBY6GKC.cjs +0 -7
package/dist/index-B_nZ3LrV.js
DELETED
|
@@ -1,2379 +0,0 @@
|
|
|
1
|
-
import { ds as a, af as Rs, eb as ia, R as da, cs as ua, Q as As, aI as ma, S as Es, c0 as ha, d0 as e, bK as Is, aZ as xa, a_ as $s, ai as ss, a$ as Be, dZ as Ps, K as bs, aa as pa, P as _a, d9 as He, dF as X, J as Ge, c_ as fa, cO as ba, dN as ya, cd as ga, cH as wa, cG as ja, as as ka, ap as va, o as Na, m as Ca, v as Sa, b0 as Ms, b1 as Ra, bB as Ts, b2 as We, n as Aa, ar as Ea, cI as Ia, a9 as $a, cJ as Pa, aE as ys, b3 as Ma, aY as Ta, b4 as gs, b5 as Fa, b6 as La, b7 as Da, b8 as qa, ej as Oa } from "./index-D4dy8yHF.js";
|
|
2
|
-
import { h as za, A as Va, R as Ye, g as Re, i as Qe, u as Ua, f as Ze, b as Fs, c as ws, d as Ka, e as Ba, a as Ha, S as Ga } from "./useWorkbenchSession-kwuVHEAF.js";
|
|
3
|
-
import { D as Wa } from "./index-DkJpASom.js";
|
|
4
|
-
var Ya = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M320 224h-66v-56c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v56h-66c-4.4 0-8 3.6-8 8v560c0 4.4 3.6 8 8 8h66v56c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-56h66c4.4 0 8-3.6 8-8V232c0-4.4-3.6-8-8-8zm-60 508h-80V292h80v440zm644-436h-66v-96c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v96h-66c-4.4 0-8 3.6-8 8v416c0 4.4 3.6 8 8 8h66v96c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8v-96h66c4.4 0 8-3.6 8-8V304c0-4.4-3.6-8-8-8zm-60 364h-80V364h80v296zM612 404h-66V232c0-4.4-3.6-8-8-8h-52c-4.4 0-8 3.6-8 8v172h-66c-4.4 0-8 3.6-8 8v200c0 4.4 3.6 8 8 8h66v172c0 4.4 3.6 8 8 8h52c4.4 0 8-3.6 8-8V620h66c4.4 0 8-3.6 8-8V412c0-4.4-3.6-8-8-8zm-60 145a3 3 0 01-3 3h-74a3 3 0 01-3-3v-74a3 3 0 013-3h74a3 3 0 013 3v74z" } }] }, name: "sliders", theme: "outlined" };
|
|
5
|
-
function Je() {
|
|
6
|
-
return Je = Object.assign ? Object.assign.bind() : function(n) {
|
|
7
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
8
|
-
var l = arguments[t];
|
|
9
|
-
for (var r in l)
|
|
10
|
-
Object.prototype.hasOwnProperty.call(l, r) && (n[r] = l[r]);
|
|
11
|
-
}
|
|
12
|
-
return n;
|
|
13
|
-
}, Je.apply(this, arguments);
|
|
14
|
-
}
|
|
15
|
-
const Qa = (n, t) => /* @__PURE__ */ a.createElement(Rs, Je({}, n, {
|
|
16
|
-
ref: t,
|
|
17
|
-
icon: Ya
|
|
18
|
-
})), Ls = /* @__PURE__ */ a.forwardRef(Qa);
|
|
19
|
-
var Za = { icon: { tag: "svg", attrs: { viewBox: "64 64 896 896", focusable: "false" }, children: [{ tag: "path", attrs: { d: "M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z" } }] }, name: "unordered-list", theme: "outlined" };
|
|
20
|
-
function Xe() {
|
|
21
|
-
return Xe = Object.assign ? Object.assign.bind() : function(n) {
|
|
22
|
-
for (var t = 1; t < arguments.length; t++) {
|
|
23
|
-
var l = arguments[t];
|
|
24
|
-
for (var r in l)
|
|
25
|
-
Object.prototype.hasOwnProperty.call(l, r) && (n[r] = l[r]);
|
|
26
|
-
}
|
|
27
|
-
return n;
|
|
28
|
-
}, Xe.apply(this, arguments);
|
|
29
|
-
}
|
|
30
|
-
const Ja = (n, t) => /* @__PURE__ */ a.createElement(Rs, Xe({}, n, {
|
|
31
|
-
ref: t,
|
|
32
|
-
icon: Za
|
|
33
|
-
})), Xa = /* @__PURE__ */ a.forwardRef(Ja), en = 99;
|
|
34
|
-
function sn(n) {
|
|
35
|
-
return {
|
|
36
|
-
id: n.agent_id || n.agent_code || "",
|
|
37
|
-
agentId: n.agent_id,
|
|
38
|
-
agentCode: n.agent_code,
|
|
39
|
-
name: n.name || "未命名智能体",
|
|
40
|
-
description: n.description || "",
|
|
41
|
-
icon: ua(n.icon),
|
|
42
|
-
current: n.is_main === !0
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
function Ue(n) {
|
|
46
|
-
const t = sn(n);
|
|
47
|
-
return {
|
|
48
|
-
id: t.id,
|
|
49
|
-
agentId: t.agentId,
|
|
50
|
-
agentCode: t.agentCode,
|
|
51
|
-
name: t.name,
|
|
52
|
-
desc: t.description,
|
|
53
|
-
icon: t.icon,
|
|
54
|
-
current: t.current
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
function js(n) {
|
|
58
|
-
return {
|
|
59
|
-
...n,
|
|
60
|
-
name: n.name || "未命名智能体"
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function ks(n) {
|
|
64
|
-
const t = [];
|
|
65
|
-
for (const l of n) {
|
|
66
|
-
Array.isArray(l.questions) && t.push(...l.questions);
|
|
67
|
-
const r = l.children;
|
|
68
|
-
for (const d of r || [])
|
|
69
|
-
Array.isArray(d.questions) && t.push(...d.questions);
|
|
70
|
-
}
|
|
71
|
-
return t;
|
|
72
|
-
}
|
|
73
|
-
function es(n, t) {
|
|
74
|
-
return t ? n.id === t || n.agentId === t || n.agentCode === t : !1;
|
|
75
|
-
}
|
|
76
|
-
function an({
|
|
77
|
-
presetAgents: n
|
|
78
|
-
} = {}) {
|
|
79
|
-
const { setAllQuestions: t } = ia(), [l, r] = a.useState(
|
|
80
|
-
() => n && n.length > 0 ? n.filter((w) => !w.hidden).map(Ue) : []
|
|
81
|
-
), [d, b] = a.useState(
|
|
82
|
-
() => n && n.length > 0 ? n.filter((w) => !w.hidden) : []
|
|
83
|
-
), [_, h] = a.useState(0), [y, v] = a.useState(0), [P, f] = a.useState(!0), [M, g] = a.useState(null), C = a.useCallback(async () => {
|
|
84
|
-
var w;
|
|
85
|
-
f(!0), g(null);
|
|
86
|
-
try {
|
|
87
|
-
if (n && n.length > 0) {
|
|
88
|
-
const N = n.filter(
|
|
89
|
-
(K) => !K.hidden
|
|
90
|
-
);
|
|
91
|
-
r(N.map(Ue));
|
|
92
|
-
const T = N.map(js);
|
|
93
|
-
b(T), t(ks(T)), h(N.length), v(N.length);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const m = await da({
|
|
97
|
-
page: 1,
|
|
98
|
-
page_size: en
|
|
99
|
-
}), u = m.data || [], S = u.filter((N) => !N.hidden);
|
|
100
|
-
!S.some((N) => N.is_main) && S.length > 0 && (S[0] = { ...S[0], is_main: !0 }), r(S.map(Ue));
|
|
101
|
-
const Z = S.map(js);
|
|
102
|
-
b(Z), t(ks(Z)), h(
|
|
103
|
-
typeof ((w = m.meta) == null ? void 0 : w.total) == "number" ? m.meta.total : S.length
|
|
104
|
-
), v(u.length);
|
|
105
|
-
} catch {
|
|
106
|
-
g("智能体列表加载失败"), r([]), b([]), t([]), h(0), v(0);
|
|
107
|
-
} finally {
|
|
108
|
-
f(!1);
|
|
109
|
-
}
|
|
110
|
-
}, [n, t]);
|
|
111
|
-
return a.useEffect(() => {
|
|
112
|
-
C();
|
|
113
|
-
}, [C]), {
|
|
114
|
-
agents: l,
|
|
115
|
-
sourceAgents: d,
|
|
116
|
-
total: _,
|
|
117
|
-
hasMore: y < _,
|
|
118
|
-
loading: P,
|
|
119
|
-
error: M,
|
|
120
|
-
reload: C
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function nn(n) {
|
|
124
|
-
const t = n || {};
|
|
125
|
-
return {
|
|
126
|
-
playbooks: ha(t),
|
|
127
|
-
playbookGroups: Array.isArray(t.playbook_groups) ? t.playbook_groups : [],
|
|
128
|
-
childAgents: Array.isArray(t.children) ? t.children : []
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
function tn(n) {
|
|
132
|
-
return Array.isArray(n) ? n.reduce((t, l) => {
|
|
133
|
-
const r = typeof (l == null ? void 0 : l.name) == "string" ? l.name.trim() : "";
|
|
134
|
-
return r && t.push({ ...l, name: r }), t;
|
|
135
|
-
}, []) : [];
|
|
136
|
-
}
|
|
137
|
-
function on(n) {
|
|
138
|
-
var _, h, y, v, P;
|
|
139
|
-
const t = n, l = (t == null ? void 0 : t.roles) ?? ((_ = t == null ? void 0 : t.data) == null ? void 0 : _.roles) ?? [];
|
|
140
|
-
if (!Array.isArray(l))
|
|
141
|
-
return { categories: [], scenes: [], totalCount: 0 };
|
|
142
|
-
const r = [], d = [];
|
|
143
|
-
let b = 0;
|
|
144
|
-
for (const f of l) {
|
|
145
|
-
const M = f.name || f.role_code || "";
|
|
146
|
-
for (const g of f.goals || []) {
|
|
147
|
-
const C = g.items || [], w = String(g.id);
|
|
148
|
-
C.length > 0 && r.push({
|
|
149
|
-
key: w,
|
|
150
|
-
name: g.name || "未命名分类",
|
|
151
|
-
count: C.length
|
|
152
|
-
});
|
|
153
|
-
for (const m of C) {
|
|
154
|
-
const u = m.playbook_id || ((h = m.playbook) == null ? void 0 : h.playbook_id);
|
|
155
|
-
u && d.push({
|
|
156
|
-
key: `${w}-${u}`,
|
|
157
|
-
title: m.title || m.name || ((y = m.playbook) == null ? void 0 : y.name) || "未命名剧本",
|
|
158
|
-
description: m.subtitle || m.description || ((v = m.playbook) == null ? void 0 : v.description) || "",
|
|
159
|
-
sourceLabel: M,
|
|
160
|
-
tags: tn(m.tags),
|
|
161
|
-
playbookId: u,
|
|
162
|
-
inputFields: m.input_fields || ((P = m.playbook) == null ? void 0 : P.input_fields) || [],
|
|
163
|
-
categoryKey: w
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
b += C.length;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
return { categories: r, scenes: d, totalCount: b };
|
|
170
|
-
}
|
|
171
|
-
const cn = "默认场景";
|
|
172
|
-
function Ds(n) {
|
|
173
|
-
return n.category_name || n.category || n.type || cn;
|
|
174
|
-
}
|
|
175
|
-
function ln(n) {
|
|
176
|
-
const t = /* @__PURE__ */ new Map();
|
|
177
|
-
for (const l of n) {
|
|
178
|
-
const r = Ds(l);
|
|
179
|
-
t.set(r, (t.get(r) ?? 0) + 1);
|
|
180
|
-
}
|
|
181
|
-
return Array.from(t, ([l, r]) => ({ key: l, name: l, count: r }));
|
|
182
|
-
}
|
|
183
|
-
function rn(n) {
|
|
184
|
-
return n.map((t) => {
|
|
185
|
-
const l = Ds(t);
|
|
186
|
-
return {
|
|
187
|
-
key: `default:${t.playbook_id}`,
|
|
188
|
-
title: t.name || "未命名场景",
|
|
189
|
-
description: t.description || "",
|
|
190
|
-
sourceLabel: l,
|
|
191
|
-
tags: [],
|
|
192
|
-
playbookId: t.playbook_id,
|
|
193
|
-
inputFields: t.input_fields || [],
|
|
194
|
-
categoryKey: l
|
|
195
|
-
};
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
function qs(n) {
|
|
199
|
-
return n;
|
|
200
|
-
}
|
|
201
|
-
function Os(n) {
|
|
202
|
-
return {
|
|
203
|
-
key: n.key,
|
|
204
|
-
title: n.title,
|
|
205
|
-
desc: n.description,
|
|
206
|
-
reason: n.sourceLabel,
|
|
207
|
-
tags: n.tags,
|
|
208
|
-
playbook_id: n.playbookId,
|
|
209
|
-
input_fields: n.inputFields,
|
|
210
|
-
categoryKey: n.categoryKey
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
function dn(n) {
|
|
214
|
-
return ln(n).map(qs);
|
|
215
|
-
}
|
|
216
|
-
function un(n) {
|
|
217
|
-
return rn(n).map(Os);
|
|
218
|
-
}
|
|
219
|
-
function mn(n) {
|
|
220
|
-
if (Array.isArray(n)) return n;
|
|
221
|
-
const t = n;
|
|
222
|
-
return Array.isArray(t == null ? void 0 : t.user_playbooks) ? t.user_playbooks : [];
|
|
223
|
-
}
|
|
224
|
-
function hn(n) {
|
|
225
|
-
const [t, l] = a.useState([]), [r, d] = a.useState([]), [b, _] = a.useState([]), [h, y] = a.useState([]), [v, P] = a.useState(!1), [f, M] = a.useState([]), [g, C] = a.useState([]), [w, m] = a.useState(0), [u, S] = a.useState(!1), [Z, N] = a.useState(null), [T, K] = a.useState(
|
|
226
|
-
null
|
|
227
|
-
), [se, z] = a.useState(null), F = a.useRef(0), D = a.useRef(0), ne = a.useCallback(async () => {
|
|
228
|
-
const k = ++F.current;
|
|
229
|
-
if (!n) {
|
|
230
|
-
l([]), d([]), _([]), y([]), M([]), C([]), m(0), S(!1), D.current += 1;
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
S(!0), N(null), K(null), z(null), y([]), D.current += 1;
|
|
234
|
-
const J = [
|
|
235
|
-
(async () => {
|
|
236
|
-
try {
|
|
237
|
-
const { data: q } = await As({
|
|
238
|
-
agent_id: n
|
|
239
|
-
});
|
|
240
|
-
if (k !== F.current) return;
|
|
241
|
-
const I = nn(q);
|
|
242
|
-
l(I.playbooks), d(I.playbookGroups), _(I.childAgents);
|
|
243
|
-
} catch {
|
|
244
|
-
if (k !== F.current) return;
|
|
245
|
-
N("剧本加载失败"), l([]), d([]), _([]);
|
|
246
|
-
}
|
|
247
|
-
})(),
|
|
248
|
-
(async () => {
|
|
249
|
-
try {
|
|
250
|
-
const q = await ma({
|
|
251
|
-
agent_id: n,
|
|
252
|
-
role_id: null
|
|
253
|
-
});
|
|
254
|
-
if (k !== F.current) return;
|
|
255
|
-
const I = on(q);
|
|
256
|
-
M(I.categories), C(I.scenes), m(I.totalCount);
|
|
257
|
-
} catch {
|
|
258
|
-
if (k !== F.current) return;
|
|
259
|
-
z("使用地图加载失败"), M([]), C([]), m(0);
|
|
260
|
-
}
|
|
261
|
-
})()
|
|
262
|
-
];
|
|
263
|
-
await Promise.allSettled(J), k === F.current && S(!1);
|
|
264
|
-
}, [n]), V = a.useCallback(async () => {
|
|
265
|
-
const k = ++D.current;
|
|
266
|
-
if (!n) {
|
|
267
|
-
y([]);
|
|
268
|
-
return;
|
|
269
|
-
}
|
|
270
|
-
P(!0), K(null);
|
|
271
|
-
try {
|
|
272
|
-
const { data: J } = await Es({
|
|
273
|
-
agent_id: n
|
|
274
|
-
});
|
|
275
|
-
if (k !== D.current) return;
|
|
276
|
-
y(mn(J));
|
|
277
|
-
} catch {
|
|
278
|
-
if (k !== D.current) return;
|
|
279
|
-
K("我的场景加载失败"), y([]);
|
|
280
|
-
} finally {
|
|
281
|
-
k === D.current && P(!1);
|
|
282
|
-
}
|
|
283
|
-
}, [n]);
|
|
284
|
-
a.useEffect(() => (ne(), () => {
|
|
285
|
-
F.current += 1;
|
|
286
|
-
}), [ne]);
|
|
287
|
-
const ee = a.useMemo(
|
|
288
|
-
() => f.map(qs),
|
|
289
|
-
[f]
|
|
290
|
-
), de = a.useMemo(() => g.map(Os), [g]);
|
|
291
|
-
return {
|
|
292
|
-
playbooks: t,
|
|
293
|
-
playbookGroups: r,
|
|
294
|
-
childAgents: b,
|
|
295
|
-
userPlaybooks: h,
|
|
296
|
-
userPlaybooksLoading: v,
|
|
297
|
-
loadUserPlaybooks: V,
|
|
298
|
-
sceneCategories: f,
|
|
299
|
-
scenes: g,
|
|
300
|
-
sceneTotalCount: w,
|
|
301
|
-
loading: u,
|
|
302
|
-
detailError: Z,
|
|
303
|
-
userPlaybooksError: T,
|
|
304
|
-
sceneMapError: se,
|
|
305
|
-
reload: ne,
|
|
306
|
-
// Console 迁移期兼容字段。
|
|
307
|
-
useMapCategories: ee,
|
|
308
|
-
useMapCards: de,
|
|
309
|
-
useMapTotalCount: w,
|
|
310
|
-
useMapError: se
|
|
311
|
-
};
|
|
312
|
-
}
|
|
313
|
-
function xn({
|
|
314
|
-
presetAgents: n,
|
|
315
|
-
initialAgentId: t
|
|
316
|
-
} = {}) {
|
|
317
|
-
const l = an({ presetAgents: n }), [r, d] = a.useState(t || ""), b = a.useRef(null);
|
|
318
|
-
a.useEffect(() => {
|
|
319
|
-
if (l.agents.length !== 0) {
|
|
320
|
-
if (t && b.current !== t) {
|
|
321
|
-
b.current = t;
|
|
322
|
-
const M = l.agents.find(
|
|
323
|
-
(g) => es(g, t)
|
|
324
|
-
) || l.agents.find((g) => g.current) || l.agents[0];
|
|
325
|
-
r !== M.id && d(M.id);
|
|
326
|
-
return;
|
|
327
|
-
}
|
|
328
|
-
if (!l.agents.some((f) => f.id === r)) {
|
|
329
|
-
const f = l.agents.find((M) => M.current) || l.agents[0];
|
|
330
|
-
d(f.id);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
}, [l.agents, t, r]);
|
|
334
|
-
const _ = a.useCallback((f) => {
|
|
335
|
-
d(f);
|
|
336
|
-
}, []), h = _, y = a.useMemo(
|
|
337
|
-
() => l.agents.find((f) => f.id === r),
|
|
338
|
-
[l.agents, r]
|
|
339
|
-
), v = a.useMemo(
|
|
340
|
-
() => l.sourceAgents.find(
|
|
341
|
-
(f) => f.agent_id === r || f.agent_code === r
|
|
342
|
-
),
|
|
343
|
-
[l.sourceAgents, r]
|
|
344
|
-
), P = hn(r);
|
|
345
|
-
return {
|
|
346
|
-
...l,
|
|
347
|
-
agentLoading: l.loading,
|
|
348
|
-
...P,
|
|
349
|
-
sceneLoading: P.loading,
|
|
350
|
-
selectedAgentId: r,
|
|
351
|
-
selectedAgent: y,
|
|
352
|
-
sourceAgents: l.sourceAgents,
|
|
353
|
-
sourceSelectedAgent: v,
|
|
354
|
-
activeAgent: r,
|
|
355
|
-
setActiveAgent: h,
|
|
356
|
-
selectAgent: _
|
|
357
|
-
};
|
|
358
|
-
}
|
|
359
|
-
const pn = (n) => {
|
|
360
|
-
const { onError: t } = n;
|
|
361
|
-
t == null || t(new Error("该场景暂不支持文件上传"));
|
|
362
|
-
};
|
|
363
|
-
function as({
|
|
364
|
-
field: n,
|
|
365
|
-
value: t,
|
|
366
|
-
uploading: l,
|
|
367
|
-
fileNameMap: r,
|
|
368
|
-
getOptionState: d,
|
|
369
|
-
onChange: b,
|
|
370
|
-
onUpload: _
|
|
371
|
-
}) {
|
|
372
|
-
const h = za(n.type), y = _ ?? ((v, P) => pn);
|
|
373
|
-
return /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-field", children: [
|
|
374
|
-
/* @__PURE__ */ e.jsxs("label", { htmlFor: `wc-param-${n.name}`, children: [
|
|
375
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__label-text", children: n.label || n.name }),
|
|
376
|
-
n.description || n.hint ? /* @__PURE__ */ e.jsx(Is, { title: n.description || n.hint, children: /* @__PURE__ */ e.jsx(
|
|
377
|
-
xa,
|
|
378
|
-
{
|
|
379
|
-
"aria-label": `${n.label || n.name}说明`
|
|
380
|
-
}
|
|
381
|
-
) }) : null,
|
|
382
|
-
n.required && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__required", children: "必填" }),
|
|
383
|
-
h && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-field__required", children: "多值" })
|
|
384
|
-
] }),
|
|
385
|
-
/* @__PURE__ */ e.jsx(
|
|
386
|
-
Va,
|
|
387
|
-
{
|
|
388
|
-
field: n,
|
|
389
|
-
value: t,
|
|
390
|
-
uploading: l,
|
|
391
|
-
fileNameMap: r,
|
|
392
|
-
getOptionState: d,
|
|
393
|
-
onChange: b,
|
|
394
|
-
onUpload: y,
|
|
395
|
-
onDownloadTemplate: (v) => window.open(v.path, "_blank", "noopener,noreferrer")
|
|
396
|
-
}
|
|
397
|
-
)
|
|
398
|
-
] });
|
|
399
|
-
}
|
|
400
|
-
const Ke = "__all__", vs = "__my__", Ns = "__library_all__", _n = "__library__:", fn = [
|
|
401
|
-
{ key: "map", label: "使用地图" },
|
|
402
|
-
{ key: "my", label: "我的场景" },
|
|
403
|
-
{ key: "all", label: "全部场景" }
|
|
404
|
-
];
|
|
405
|
-
function bn(n) {
|
|
406
|
-
return n === "map" ? "搜索当前地图下的场景" : n === "my" ? "搜索我的场景" : "搜索全部场景";
|
|
407
|
-
}
|
|
408
|
-
function yn({
|
|
409
|
-
open: n,
|
|
410
|
-
source: t,
|
|
411
|
-
categories: l,
|
|
412
|
-
categoryKey: r,
|
|
413
|
-
search: d,
|
|
414
|
-
cards: b,
|
|
415
|
-
selectedScene: _,
|
|
416
|
-
fields: h,
|
|
417
|
-
values: y,
|
|
418
|
-
executing: v,
|
|
419
|
-
onClose: P,
|
|
420
|
-
onSourceChange: f,
|
|
421
|
-
onCategoryChange: M,
|
|
422
|
-
onSearchChange: g,
|
|
423
|
-
onSelectScene: C,
|
|
424
|
-
onValueChange: w,
|
|
425
|
-
onStart: m
|
|
426
|
-
}) {
|
|
427
|
-
return /* @__PURE__ */ e.jsx(
|
|
428
|
-
Wa,
|
|
429
|
-
{
|
|
430
|
-
open: n,
|
|
431
|
-
onClose: P,
|
|
432
|
-
placement: "bottom",
|
|
433
|
-
height: "min(82vh, 780px)",
|
|
434
|
-
destroyOnClose: !1,
|
|
435
|
-
styles: {
|
|
436
|
-
body: { padding: 0, background: "var(--wc-bg)" },
|
|
437
|
-
header: { display: "none" }
|
|
438
|
-
},
|
|
439
|
-
getContainer: !1,
|
|
440
|
-
title: null,
|
|
441
|
-
closeIcon: null,
|
|
442
|
-
push: !1,
|
|
443
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__drawer", children: [
|
|
444
|
-
/* @__PURE__ */ e.jsxs("header", { className: "wandox-console-chat__drawer-top", children: [
|
|
445
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-title", children: /* @__PURE__ */ e.jsx(
|
|
446
|
-
"nav",
|
|
447
|
-
{
|
|
448
|
-
className: "wandox-console-chat__drawer-tabs",
|
|
449
|
-
"aria-label": "场景来源",
|
|
450
|
-
children: fn.map((u) => /* @__PURE__ */ e.jsx(
|
|
451
|
-
"button",
|
|
452
|
-
{
|
|
453
|
-
type: "button",
|
|
454
|
-
className: t === u.key ? "is-active" : "",
|
|
455
|
-
onClick: () => f(u.key),
|
|
456
|
-
children: u.label
|
|
457
|
-
},
|
|
458
|
-
u.key
|
|
459
|
-
))
|
|
460
|
-
}
|
|
461
|
-
) }),
|
|
462
|
-
/* @__PURE__ */ e.jsx(
|
|
463
|
-
"button",
|
|
464
|
-
{
|
|
465
|
-
type: "button",
|
|
466
|
-
className: "wandox-console-chat__drawer-close",
|
|
467
|
-
onClick: P,
|
|
468
|
-
"aria-label": "关闭",
|
|
469
|
-
children: /* @__PURE__ */ e.jsx($s, {})
|
|
470
|
-
}
|
|
471
|
-
)
|
|
472
|
-
] }),
|
|
473
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__drawer-middle", children: [
|
|
474
|
-
t !== "my" && /* @__PURE__ */ e.jsxs("aside", { className: "wandox-console-chat__drawer-cats", children: [
|
|
475
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-catslabel", children: "场景分类" }),
|
|
476
|
-
l.map((u) => {
|
|
477
|
-
const S = u.key === r;
|
|
478
|
-
return /* @__PURE__ */ e.jsxs(
|
|
479
|
-
"button",
|
|
480
|
-
{
|
|
481
|
-
type: "button",
|
|
482
|
-
className: `wandox-console-chat__drawer-cat${S ? " wandox-console-chat__drawer-cat--active" : ""}`,
|
|
483
|
-
onClick: () => M(u.key),
|
|
484
|
-
children: [
|
|
485
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__drawer-cat-name", children: u.name }),
|
|
486
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__drawer-cat-count", children: u.count })
|
|
487
|
-
]
|
|
488
|
-
},
|
|
489
|
-
u.key
|
|
490
|
-
);
|
|
491
|
-
})
|
|
492
|
-
] }),
|
|
493
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__drawer-body", children: [
|
|
494
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-toolbar", children: /* @__PURE__ */ e.jsx(
|
|
495
|
-
ss,
|
|
496
|
-
{
|
|
497
|
-
allowClear: !0,
|
|
498
|
-
prefix: /* @__PURE__ */ e.jsx(Be, {}),
|
|
499
|
-
placeholder: bn(t),
|
|
500
|
-
value: d,
|
|
501
|
-
onChange: (u) => g(u.target.value)
|
|
502
|
-
}
|
|
503
|
-
) }),
|
|
504
|
-
b.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-empty", children: d ? "没有匹配的场景" : "暂无可用场景" }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes", children: b.map((u) => {
|
|
505
|
-
const S = (_ == null ? void 0 : _.playbook_id) === u.playbook_id;
|
|
506
|
-
return /* @__PURE__ */ e.jsx(
|
|
507
|
-
"button",
|
|
508
|
-
{
|
|
509
|
-
type: "button",
|
|
510
|
-
className: `wandox-console-scene${S ? " wandox-console-scene--selected" : ""}`,
|
|
511
|
-
onClick: () => C(u),
|
|
512
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__body", children: [
|
|
513
|
-
/* @__PURE__ */ e.jsx("strong", { children: u.title }),
|
|
514
|
-
u.desc && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-scene__desc", children: u.desc })
|
|
515
|
-
] })
|
|
516
|
-
},
|
|
517
|
-
u.key
|
|
518
|
-
);
|
|
519
|
-
}) })
|
|
520
|
-
] })
|
|
521
|
-
] }),
|
|
522
|
-
/* @__PURE__ */ e.jsxs("footer", { className: "wandox-console-chat__drawer-foot", children: [
|
|
523
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__drawer-foot-summary", children: [
|
|
524
|
-
_ ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
525
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__drawer-foot-head", children: "已选择" }),
|
|
526
|
-
/* @__PURE__ */ e.jsx("strong", { className: "wandox-console-chat__drawer-foot-title", children: _.title }),
|
|
527
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__drawer-foot-hint", children: "· 已继承当前上下文" })
|
|
528
|
-
] }) : /* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__drawer-foot-placeholder", children: '选择一张场景卡片,填写参数后点击"开始执行"' }),
|
|
529
|
-
/* @__PURE__ */ e.jsxs(
|
|
530
|
-
"button",
|
|
531
|
-
{
|
|
532
|
-
type: "button",
|
|
533
|
-
className: "wandox-console-chat__drawer-foot-start",
|
|
534
|
-
disabled: !_ || v,
|
|
535
|
-
onClick: m,
|
|
536
|
-
children: [
|
|
537
|
-
"开始执行",
|
|
538
|
-
/* @__PURE__ */ e.jsx(Ye, {})
|
|
539
|
-
]
|
|
540
|
-
}
|
|
541
|
-
)
|
|
542
|
-
] }),
|
|
543
|
-
_ && h.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-foot-params", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__drawer-foot-paramsgrid", children: Re(h, y).map((u) => /* @__PURE__ */ e.jsx(
|
|
544
|
-
as,
|
|
545
|
-
{
|
|
546
|
-
field: u,
|
|
547
|
-
value: y[u.name],
|
|
548
|
-
uploading: !1,
|
|
549
|
-
fileNameMap: {},
|
|
550
|
-
getOptionState: () => ({
|
|
551
|
-
options: [],
|
|
552
|
-
loading: !1,
|
|
553
|
-
waitingForDependencies: !1
|
|
554
|
-
}),
|
|
555
|
-
onChange: w
|
|
556
|
-
},
|
|
557
|
-
u.name
|
|
558
|
-
)) }) })
|
|
559
|
-
] })
|
|
560
|
-
] })
|
|
561
|
-
}
|
|
562
|
-
);
|
|
563
|
-
}
|
|
564
|
-
function gn(n) {
|
|
565
|
-
if (Array.isArray(n)) return n;
|
|
566
|
-
const t = n;
|
|
567
|
-
return Array.isArray(t == null ? void 0 : t.user_playbooks) ? t.user_playbooks : [];
|
|
568
|
-
}
|
|
569
|
-
function wn({
|
|
570
|
-
agentId: n,
|
|
571
|
-
agentName: t,
|
|
572
|
-
playbookId: l,
|
|
573
|
-
playbookParams: r,
|
|
574
|
-
initialMessage: d,
|
|
575
|
-
initialAttachments: b,
|
|
576
|
-
useMapCards: _ = [],
|
|
577
|
-
useMapCategories: h = [],
|
|
578
|
-
playbooks: y = [],
|
|
579
|
-
userPlaybooks: v = [],
|
|
580
|
-
agents: P = [],
|
|
581
|
-
onChangeAgent: f,
|
|
582
|
-
onBack: M,
|
|
583
|
-
onSelectScene: g,
|
|
584
|
-
onReady: C
|
|
585
|
-
}) {
|
|
586
|
-
const w = localStorage.getItem("sso_token") || "", m = localStorage.getItem("sso_domain") || "maiduo", u = localStorage.getItem("sso_company") || "", S = a.useRef(null), Z = a.useRef(!1), [N, T] = a.useState(!1), [K, se] = a.useState(""), [z, F] = a.useState("map"), [D, ne] = a.useState(Ke), [V, ee] = a.useState(null), de = a.useRef(null);
|
|
587
|
-
a.useEffect(() => {
|
|
588
|
-
if (!V || N) return;
|
|
589
|
-
const s = setTimeout(() => {
|
|
590
|
-
var o;
|
|
591
|
-
(o = de.current) == null || o.focus();
|
|
592
|
-
}, 120);
|
|
593
|
-
return () => clearTimeout(s);
|
|
594
|
-
}, [V, N]);
|
|
595
|
-
const [k, J] = a.useState([]), [q, I] = a.useState({}), ye = Ps(
|
|
596
|
-
k,
|
|
597
|
-
q,
|
|
598
|
-
I
|
|
599
|
-
), H = a.useMemo(
|
|
600
|
-
() => Re(k, q).filter(
|
|
601
|
-
(s) => s.required && Qe(q[s.name])
|
|
602
|
-
),
|
|
603
|
-
[k, q]
|
|
604
|
-
), [te, re] = a.useState("chat"), [he, ge] = a.useState([]), [G, ce] = a.useState(null), [R, fe] = a.useState("results"), [ve, Ne] = a.useState(!1), [p, W] = a.useState([]);
|
|
605
|
-
a.useEffect(() => {
|
|
606
|
-
C == null || C({
|
|
607
|
-
showInspectionResults: (s) => {
|
|
608
|
-
re("robot"), fe("results"), ce(s || null);
|
|
609
|
-
}
|
|
610
|
-
});
|
|
611
|
-
}, [C]);
|
|
612
|
-
const [ie, Le] = a.useState([]), [we, ue] = a.useState(!1), [oe, c] = a.useState(void 0), [O, U] = a.useState([]), [$, Y] = a.useState(
|
|
613
|
-
"map"
|
|
614
|
-
), [je, me] = a.useState(void 0), Q = a.useRef(0), B = a.useRef(0), [xe, Ae] = a.useState(
|
|
615
|
-
bs
|
|
616
|
-
), [le, Ee] = a.useState({}), [Ie, ns] = a.useState(
|
|
617
|
-
() => /* @__PURE__ */ new Set()
|
|
618
|
-
), De = a.useCallback(
|
|
619
|
-
(s, o, i) => ({
|
|
620
|
-
key: `${o}-${s.playbook_id}`,
|
|
621
|
-
title: s.name || "未命名场景",
|
|
622
|
-
desc: s.description || "",
|
|
623
|
-
reason: i,
|
|
624
|
-
tags: [],
|
|
625
|
-
playbook_id: s.playbook_id,
|
|
626
|
-
input_fields: s.input_fields || [],
|
|
627
|
-
categoryKey: o
|
|
628
|
-
}),
|
|
629
|
-
[]
|
|
630
|
-
), Ce = a.useMemo(() => {
|
|
631
|
-
const s = v.map(
|
|
632
|
-
(x) => De(x, vs, "我的场景")
|
|
633
|
-
), o = /* @__PURE__ */ new Map();
|
|
634
|
-
for (const x of y) {
|
|
635
|
-
const L = x.category_name || x.category || x.type || "默认场景", E = `${_n}${L}`, _e = o.get(E) || [];
|
|
636
|
-
_e.push(De(x, E, L)), o.set(E, _e);
|
|
637
|
-
}
|
|
638
|
-
const i = Array.from(o.values()).flat(), j = [
|
|
639
|
-
{
|
|
640
|
-
key: Ns,
|
|
641
|
-
name: "全部",
|
|
642
|
-
count: i.length,
|
|
643
|
-
cards: i
|
|
644
|
-
},
|
|
645
|
-
...Array.from(o, ([x, L]) => {
|
|
646
|
-
var E;
|
|
647
|
-
return {
|
|
648
|
-
key: x,
|
|
649
|
-
name: ((E = L[0]) == null ? void 0 : E.reason) || "默认场景",
|
|
650
|
-
count: L.length,
|
|
651
|
-
cards: L
|
|
652
|
-
};
|
|
653
|
-
})
|
|
654
|
-
], A = [
|
|
655
|
-
{
|
|
656
|
-
key: Ke,
|
|
657
|
-
name: t || "全部场景",
|
|
658
|
-
count: _.length,
|
|
659
|
-
cards: _
|
|
660
|
-
},
|
|
661
|
-
...h.map((x) => ({
|
|
662
|
-
key: x.key,
|
|
663
|
-
name: x.name,
|
|
664
|
-
count: x.count,
|
|
665
|
-
cards: _.filter((L) => L.categoryKey === x.key)
|
|
666
|
-
}))
|
|
667
|
-
];
|
|
668
|
-
return { allCategories: j, mapCategories: A, myCards: s };
|
|
669
|
-
}, [
|
|
670
|
-
t,
|
|
671
|
-
y,
|
|
672
|
-
De,
|
|
673
|
-
_,
|
|
674
|
-
h,
|
|
675
|
-
v
|
|
676
|
-
]), qe = a.useMemo(() => z === "all" ? Ce.allCategories : z === "map" ? Ce.mapCategories : [], [Ce, z]), $e = a.useMemo(
|
|
677
|
-
() => _.map(
|
|
678
|
-
(s) => ({
|
|
679
|
-
category: null,
|
|
680
|
-
category_name: s.reason,
|
|
681
|
-
description: s.desc,
|
|
682
|
-
domain: "",
|
|
683
|
-
id: 0,
|
|
684
|
-
name: s.title,
|
|
685
|
-
playbook_id: s.playbook_id,
|
|
686
|
-
scope: "usemap",
|
|
687
|
-
status: "available",
|
|
688
|
-
sub_category: null,
|
|
689
|
-
tags: s.tags.map((o) => o.name),
|
|
690
|
-
input_fields: s.input_fields,
|
|
691
|
-
type: "",
|
|
692
|
-
version: ""
|
|
693
|
-
})
|
|
694
|
-
),
|
|
695
|
-
[_]
|
|
696
|
-
), zs = a.useMemo(() => {
|
|
697
|
-
const s = /* @__PURE__ */ new Map();
|
|
698
|
-
for (const o of [
|
|
699
|
-
...y,
|
|
700
|
-
...v,
|
|
701
|
-
...$e
|
|
702
|
-
])
|
|
703
|
-
o.playbook_id && s.set(o.playbook_id, o);
|
|
704
|
-
return Array.from(s.values());
|
|
705
|
-
}, [y, v, $e]), Vs = a.useMemo(() => {
|
|
706
|
-
const s = /* @__PURE__ */ new Map();
|
|
707
|
-
for (const o of y) {
|
|
708
|
-
const i = o.category_name || o.category || o.type || "默认场景", j = s.get(i) || [];
|
|
709
|
-
j.push(o), s.set(i, j);
|
|
710
|
-
}
|
|
711
|
-
return [
|
|
712
|
-
{ key: "__my__", label: "我的场景", playbooks: [] },
|
|
713
|
-
...Array.from(s, ([o, i]) => ({
|
|
714
|
-
key: `all:${o}`,
|
|
715
|
-
label: o,
|
|
716
|
-
playbooks: i
|
|
717
|
-
}))
|
|
718
|
-
];
|
|
719
|
-
}, [y]), Us = a.useMemo(() => {
|
|
720
|
-
const s = new Map(
|
|
721
|
-
$e.map((o) => [
|
|
722
|
-
o.playbook_id,
|
|
723
|
-
o
|
|
724
|
-
])
|
|
725
|
-
);
|
|
726
|
-
return h.map((o) => ({
|
|
727
|
-
key: `map:${o.key}`,
|
|
728
|
-
label: o.name,
|
|
729
|
-
playbooks: _.filter((i) => i.categoryKey === o.key).map((i) => s.get(i.playbook_id)).filter((i) => !!i)
|
|
730
|
-
}));
|
|
731
|
-
}, [_, h, $e]), Ks = $ === "map" ? Us : Vs, Bs = a.useMemo(() => {
|
|
732
|
-
var i;
|
|
733
|
-
const s = K.trim().toLowerCase(), o = z === "my" ? Ce.myCards : ((i = qe.find((j) => j.key === D)) == null ? void 0 : i.cards) || [];
|
|
734
|
-
return s ? o.filter(
|
|
735
|
-
(j) => j.title.toLowerCase().includes(s) || j.desc.toLowerCase().includes(s)
|
|
736
|
-
) : o;
|
|
737
|
-
}, [
|
|
738
|
-
qe,
|
|
739
|
-
D,
|
|
740
|
-
Ce.myCards,
|
|
741
|
-
z,
|
|
742
|
-
K
|
|
743
|
-
]), Hs = a.useCallback((s) => {
|
|
744
|
-
const o = Array.isArray(s) ? s : [];
|
|
745
|
-
Le(o), ue(o.length > 0);
|
|
746
|
-
}, []), ke = a.useMemo(
|
|
747
|
-
() => P.find((s) => s.id === n),
|
|
748
|
-
[P, n]
|
|
749
|
-
), { messageData: Gs, executing: ae, stopping: Ws, actions: Ys } = Ua({
|
|
750
|
-
activeAgent: n,
|
|
751
|
-
ssoToken: w,
|
|
752
|
-
ssoDomain: m,
|
|
753
|
-
ssoCompany: u,
|
|
754
|
-
onRecommendationsUpdate: Hs
|
|
755
|
-
}), {
|
|
756
|
-
sendMessage: Pe,
|
|
757
|
-
executePlaybook: ts,
|
|
758
|
-
respondToProposal: os,
|
|
759
|
-
stopCurrent: Qs,
|
|
760
|
-
retrigger: cs
|
|
761
|
-
} = Ys, {
|
|
762
|
-
messages: pe,
|
|
763
|
-
messagesTotal: ls,
|
|
764
|
-
loading: rs,
|
|
765
|
-
loadMessages: is,
|
|
766
|
-
loadMoreMessages: ds
|
|
767
|
-
} = Gs, Me = a.useMemo(() => {
|
|
768
|
-
for (let s = pe.length - 1; s >= 0; s--)
|
|
769
|
-
if (pe[s].role === "assistant") return pe[s].id;
|
|
770
|
-
}, [pe]), Te = a.useCallback(async () => {
|
|
771
|
-
if (!n || !w) {
|
|
772
|
-
U([]);
|
|
773
|
-
return;
|
|
774
|
-
}
|
|
775
|
-
try {
|
|
776
|
-
const s = await pa({
|
|
777
|
-
agent_id: n,
|
|
778
|
-
limit: 8
|
|
779
|
-
});
|
|
780
|
-
U(Array.isArray(s.data) ? s.data : []);
|
|
781
|
-
} catch {
|
|
782
|
-
}
|
|
783
|
-
}, [n, w]);
|
|
784
|
-
a.useEffect(() => {
|
|
785
|
-
Te();
|
|
786
|
-
}, [Te]);
|
|
787
|
-
const be = a.useCallback(
|
|
788
|
-
async (s) => {
|
|
789
|
-
await ts(s), Te();
|
|
790
|
-
},
|
|
791
|
-
[ts, Te]
|
|
792
|
-
);
|
|
793
|
-
a.useEffect(() => {
|
|
794
|
-
Z.current || (Z.current = !0, (async () => {
|
|
795
|
-
if (await is(), l) {
|
|
796
|
-
const s = (d == null ? void 0 : d.trim()) || "执行剧本";
|
|
797
|
-
be({
|
|
798
|
-
message: s,
|
|
799
|
-
playbook_id: l,
|
|
800
|
-
playbook_params: r || {}
|
|
801
|
-
});
|
|
802
|
-
} else d != null && d.trim() && Pe(d.trim(), void 0, b);
|
|
803
|
-
})());
|
|
804
|
-
}, [
|
|
805
|
-
l,
|
|
806
|
-
d,
|
|
807
|
-
b,
|
|
808
|
-
r,
|
|
809
|
-
be,
|
|
810
|
-
is,
|
|
811
|
-
Pe
|
|
812
|
-
]), a.useEffect(() => {
|
|
813
|
-
if (!n) return;
|
|
814
|
-
let s = !1;
|
|
815
|
-
return (async () => {
|
|
816
|
-
try {
|
|
817
|
-
const { data: o } = await As({ agent_id: n });
|
|
818
|
-
if (s) return;
|
|
819
|
-
const i = (o == null ? void 0 : o.children) || [];
|
|
820
|
-
ge(i), ce(null);
|
|
821
|
-
} catch {
|
|
822
|
-
ge([]);
|
|
823
|
-
}
|
|
824
|
-
})(), () => {
|
|
825
|
-
s = !0;
|
|
826
|
-
};
|
|
827
|
-
}, [n]), a.useEffect(() => {
|
|
828
|
-
Me && Me !== oe && c(Me);
|
|
829
|
-
}, [Me, oe]), a.useEffect(() => {
|
|
830
|
-
if (te !== "robot" || R !== "history" || !G) {
|
|
831
|
-
W([]);
|
|
832
|
-
return;
|
|
833
|
-
}
|
|
834
|
-
const s = he.find((i) => i.name === G);
|
|
835
|
-
if (!s) return;
|
|
836
|
-
let o = !1;
|
|
837
|
-
return Ne(!0), (async () => {
|
|
838
|
-
try {
|
|
839
|
-
const i = await _a({
|
|
840
|
-
agent_id: s.agent_id,
|
|
841
|
-
limit: 50
|
|
842
|
-
});
|
|
843
|
-
if (o) return;
|
|
844
|
-
const A = (Array.isArray(i == null ? void 0 : i.data) ? i.data : []).map(
|
|
845
|
-
(x, L) => ({
|
|
846
|
-
id: x.id || x.execute_id || `record_${L}`,
|
|
847
|
-
action_name: x.action_name || x.display_name || "未知动作",
|
|
848
|
-
status: x.status || "pending",
|
|
849
|
-
created_at: x.created_at || "",
|
|
850
|
-
completed_at: x.completed_at,
|
|
851
|
-
output_data: x.output_data,
|
|
852
|
-
error: x.error
|
|
853
|
-
})
|
|
854
|
-
);
|
|
855
|
-
W(A);
|
|
856
|
-
} catch {
|
|
857
|
-
W([]);
|
|
858
|
-
} finally {
|
|
859
|
-
o || Ne(!1);
|
|
860
|
-
}
|
|
861
|
-
})(), () => {
|
|
862
|
-
o = !0;
|
|
863
|
-
};
|
|
864
|
-
}, [te, R, G, he]);
|
|
865
|
-
const Zs = a.useCallback(
|
|
866
|
-
(s, o, i) => {
|
|
867
|
-
ue(!1), Pe(s, void 0, i);
|
|
868
|
-
},
|
|
869
|
-
[Pe]
|
|
870
|
-
), Js = a.useCallback((s) => {
|
|
871
|
-
F(s), ne(
|
|
872
|
-
s === "all" ? Ns : s === "map" ? Ke : vs
|
|
873
|
-
), se(""), ee(null), J([]), I({});
|
|
874
|
-
}, []), Xs = a.useCallback(() => {
|
|
875
|
-
T(!1), ee(null), J([]), I({});
|
|
876
|
-
}, []), ea = a.useCallback((s) => {
|
|
877
|
-
ee(s);
|
|
878
|
-
const o = He(s.input_fields || []);
|
|
879
|
-
J(o), I(Ze(o));
|
|
880
|
-
}, []), Oe = a.useCallback((s) => {
|
|
881
|
-
ee({
|
|
882
|
-
key: s.playbook_id,
|
|
883
|
-
playbook_id: s.playbook_id,
|
|
884
|
-
title: s.name,
|
|
885
|
-
desc: s.description ?? "",
|
|
886
|
-
reason: "",
|
|
887
|
-
tags: [],
|
|
888
|
-
categoryKey: "",
|
|
889
|
-
input_fields: s.input_fields || []
|
|
890
|
-
});
|
|
891
|
-
const o = He(s.input_fields || []);
|
|
892
|
-
J(o), I(Ze(o));
|
|
893
|
-
}, []), ze = a.useCallback(
|
|
894
|
-
async (s) => {
|
|
895
|
-
if (!ae) {
|
|
896
|
-
if (ue(!1), s.input_fields && s.input_fields.length > 0) {
|
|
897
|
-
Oe(s);
|
|
898
|
-
return;
|
|
899
|
-
}
|
|
900
|
-
try {
|
|
901
|
-
await be({
|
|
902
|
-
message: s.name,
|
|
903
|
-
playbook_id: s.playbook_id
|
|
904
|
-
});
|
|
905
|
-
} catch (o) {
|
|
906
|
-
const i = o instanceof Error ? o.message : "执行失败";
|
|
907
|
-
X.error(i);
|
|
908
|
-
}
|
|
909
|
-
}
|
|
910
|
-
},
|
|
911
|
-
[ae, be, Oe]
|
|
912
|
-
), us = a.useCallback(async () => {
|
|
913
|
-
if (!V || ae) return;
|
|
914
|
-
const o = Re(k, q).filter(
|
|
915
|
-
(A) => A.required && Qe(q[A.name])
|
|
916
|
-
);
|
|
917
|
-
if (o.length > 0) {
|
|
918
|
-
X.warning(`请先填写 ${o.length} 项必填参数`);
|
|
919
|
-
return;
|
|
920
|
-
}
|
|
921
|
-
T(!1), ue(!1);
|
|
922
|
-
const i = V, j = q;
|
|
923
|
-
ee(null), J([]), I({});
|
|
924
|
-
try {
|
|
925
|
-
const A = i.title || (d == null ? void 0 : d.trim()) || "执行剧本";
|
|
926
|
-
await be({
|
|
927
|
-
message: A,
|
|
928
|
-
playbook_id: i.playbook_id,
|
|
929
|
-
playbook_params: j
|
|
930
|
-
}), g == null || g(i);
|
|
931
|
-
} catch (A) {
|
|
932
|
-
const x = A instanceof Error ? A.message : "执行失败";
|
|
933
|
-
X.error(x);
|
|
934
|
-
}
|
|
935
|
-
}, [
|
|
936
|
-
V,
|
|
937
|
-
k,
|
|
938
|
-
q,
|
|
939
|
-
ae,
|
|
940
|
-
be,
|
|
941
|
-
d,
|
|
942
|
-
g
|
|
943
|
-
]), sa = a.useCallback((s) => {
|
|
944
|
-
B.current += 1, me({
|
|
945
|
-
requestId: ++Q.current,
|
|
946
|
-
playbooks: s
|
|
947
|
-
});
|
|
948
|
-
}, []), aa = a.useCallback(() => {
|
|
949
|
-
const s = ++B.current;
|
|
950
|
-
me({
|
|
951
|
-
requestId: ++Q.current,
|
|
952
|
-
playbooks: [],
|
|
953
|
-
loading: !0
|
|
954
|
-
}), (async () => {
|
|
955
|
-
await new Promise((o) => {
|
|
956
|
-
window.requestAnimationFrame(() => o());
|
|
957
|
-
});
|
|
958
|
-
try {
|
|
959
|
-
const { data: o } = await Es({
|
|
960
|
-
agent_id: n
|
|
961
|
-
});
|
|
962
|
-
if (s !== B.current) return;
|
|
963
|
-
me({
|
|
964
|
-
requestId: ++Q.current,
|
|
965
|
-
playbooks: gn(o)
|
|
966
|
-
});
|
|
967
|
-
} catch {
|
|
968
|
-
if (s !== B.current) return;
|
|
969
|
-
X.error("我的场景加载失败"), me({
|
|
970
|
-
requestId: ++Q.current,
|
|
971
|
-
playbooks: []
|
|
972
|
-
});
|
|
973
|
-
}
|
|
974
|
-
})();
|
|
975
|
-
}, [n]), na = a.useCallback((s) => {
|
|
976
|
-
me(
|
|
977
|
-
(o) => (o == null ? void 0 : o.requestId) === s ? void 0 : o
|
|
978
|
-
);
|
|
979
|
-
}, []), ta = /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__scene-quick", children: [
|
|
980
|
-
/* @__PURE__ */ e.jsx(
|
|
981
|
-
Ge,
|
|
982
|
-
{
|
|
983
|
-
menu: {
|
|
984
|
-
selectedKeys: [$],
|
|
985
|
-
items: [
|
|
986
|
-
{ key: "all", label: "全部场景" },
|
|
987
|
-
{ key: "map", label: "使用地图" }
|
|
988
|
-
],
|
|
989
|
-
onClick: ({ key: s }) => {
|
|
990
|
-
B.current += 1, Y(s);
|
|
991
|
-
}
|
|
992
|
-
},
|
|
993
|
-
trigger: ["click"],
|
|
994
|
-
placement: "topLeft",
|
|
995
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
996
|
-
"button",
|
|
997
|
-
{
|
|
998
|
-
type: "button",
|
|
999
|
-
className: "wandox-console-chat__scene-source",
|
|
1000
|
-
disabled: ae,
|
|
1001
|
-
children: [
|
|
1002
|
-
/* @__PURE__ */ e.jsx("span", { children: $ === "map" ? "使用地图" : "全部场景" }),
|
|
1003
|
-
/* @__PURE__ */ e.jsx(
|
|
1004
|
-
"svg",
|
|
1005
|
-
{
|
|
1006
|
-
className: "wandox-console-chat__scene-source-arrow",
|
|
1007
|
-
width: "12",
|
|
1008
|
-
height: "12",
|
|
1009
|
-
viewBox: "0 0 24 24",
|
|
1010
|
-
fill: "currentColor",
|
|
1011
|
-
"aria-hidden": "true",
|
|
1012
|
-
focusable: "false",
|
|
1013
|
-
children: /* @__PURE__ */ e.jsx("path", { d: "M8.413 0.963a2 2 0 0 1 2.738.712l4.872 8.301a4 4 0 0 1 0 4.049l-4.872 8.3a2 2 0 1 1-3.45-2.025L12.574 12 7.701 3.7A2 2 0 0 1 8.413.963Z" })
|
|
1014
|
-
}
|
|
1015
|
-
)
|
|
1016
|
-
]
|
|
1017
|
-
}
|
|
1018
|
-
)
|
|
1019
|
-
}
|
|
1020
|
-
),
|
|
1021
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__scene-separator", "aria-hidden": !0, children: "|" }),
|
|
1022
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__scene-categories", children: Ks.map((s) => /* @__PURE__ */ e.jsx(
|
|
1023
|
-
"button",
|
|
1024
|
-
{
|
|
1025
|
-
type: "button",
|
|
1026
|
-
className: "wandox-console-chat__choose-scene",
|
|
1027
|
-
disabled: ae,
|
|
1028
|
-
onClick: () => s.key === "__my__" ? aa() : sa(s.playbooks),
|
|
1029
|
-
children: s.label
|
|
1030
|
-
},
|
|
1031
|
-
s.key
|
|
1032
|
-
)) })
|
|
1033
|
-
] }), ms = a.useCallback(async (s) => {
|
|
1034
|
-
var x;
|
|
1035
|
-
const o = (x = s.meta_content) != null && x.playbook_id ? "数据报表" : "对话内容", i = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
1036
|
-
if (fa(s)) {
|
|
1037
|
-
const L = ba(s);
|
|
1038
|
-
if (!L) {
|
|
1039
|
-
X.warning("没有可导出的表格数据");
|
|
1040
|
-
return;
|
|
1041
|
-
}
|
|
1042
|
-
const E = L.fields.map((Ve) => Ve.label).join(","), _e = L.rows.map(
|
|
1043
|
-
(Ve) => L.fields.map((ra) => ya(Ve[ra.name])).join(",")
|
|
1044
|
-
), la = `\uFEFF${[E, ..._e].join(`
|
|
1045
|
-
`)}`;
|
|
1046
|
-
ga(
|
|
1047
|
-
new Blob([la], { type: "text/csv;charset=utf-8;" }),
|
|
1048
|
-
`${o}_${i}.csv`
|
|
1049
|
-
);
|
|
1050
|
-
return;
|
|
1051
|
-
}
|
|
1052
|
-
const j = document.querySelector(
|
|
1053
|
-
`[data-message-id="${s.message_id || s.id}"] .wandox-message-content`
|
|
1054
|
-
);
|
|
1055
|
-
if (!j) {
|
|
1056
|
-
X.warning("无法定位消息内容");
|
|
1057
|
-
return;
|
|
1058
|
-
}
|
|
1059
|
-
const A = window.open("", "_blank");
|
|
1060
|
-
if (!A) {
|
|
1061
|
-
X.warning("请允许弹出窗口");
|
|
1062
|
-
return;
|
|
1063
|
-
}
|
|
1064
|
-
A.document.write(
|
|
1065
|
-
`<!DOCTYPE html><html><head><meta charset="utf-8"><title>${o}_${i}</title><style>body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;padding:20px;color:#333}table{border-collapse:collapse;width:100%}th,td{border:1px solid #d9d9d9;padding:6px 8px;font-size:13px;text-align:left}th{background:#fafafa}img{max-width:100%}pre{white-space:pre-wrap;word-break:break-all;font-size:12px;background:#f5f5f5;padding:12px;border-radius:4px}button,.ant-btn,.ant-tooltip-open{display:none!important}</style></head><body>${j.innerHTML}</body></html>`
|
|
1066
|
-
), A.document.close(), A.onload = () => {
|
|
1067
|
-
A.print(), A.close();
|
|
1068
|
-
};
|
|
1069
|
-
}, []), hs = a.useCallback(
|
|
1070
|
-
(s) => {
|
|
1071
|
-
var A, x, L;
|
|
1072
|
-
const o = pe.find(
|
|
1073
|
-
(E) => E.message_id === s || E.id === s
|
|
1074
|
-
), i = wa(o);
|
|
1075
|
-
if (!i) {
|
|
1076
|
-
X.warning("缺少剧本 ID,无法配置定时触发");
|
|
1077
|
-
return;
|
|
1078
|
-
}
|
|
1079
|
-
const j = ((x = (A = o == null ? void 0 : o.actions) == null ? void 0 : A.find((E) => E.playbook_id === i)) == null ? void 0 : x.display_name) || ((L = o == null ? void 0 : o.meta_content) == null ? void 0 : L.playbook_name) || i;
|
|
1080
|
-
Ae({
|
|
1081
|
-
visible: !0,
|
|
1082
|
-
messageId: s,
|
|
1083
|
-
agentId: n,
|
|
1084
|
-
playbookId: i,
|
|
1085
|
-
playbookName: j
|
|
1086
|
-
});
|
|
1087
|
-
},
|
|
1088
|
-
[n, pe]
|
|
1089
|
-
), oa = a.useCallback(() => {
|
|
1090
|
-
Ae(bs);
|
|
1091
|
-
}, []), Fe = a.useCallback(
|
|
1092
|
-
(s) => {
|
|
1093
|
-
const o = s.message_id;
|
|
1094
|
-
return o && Object.prototype.hasOwnProperty.call(le, o) ? le[o] : ja(s);
|
|
1095
|
-
},
|
|
1096
|
-
[le]
|
|
1097
|
-
), xs = a.useCallback(
|
|
1098
|
-
async (s, o, i) => {
|
|
1099
|
-
var L;
|
|
1100
|
-
const j = s.message_id;
|
|
1101
|
-
if (!j || Ie.has(j)) return !1;
|
|
1102
|
-
const A = Fe(s), x = Ia(
|
|
1103
|
-
A,
|
|
1104
|
-
o
|
|
1105
|
-
);
|
|
1106
|
-
Ee((E) => ({
|
|
1107
|
-
...E,
|
|
1108
|
-
[j]: x
|
|
1109
|
-
})), ns((E) => new Set(E).add(j));
|
|
1110
|
-
try {
|
|
1111
|
-
const E = await ka(
|
|
1112
|
-
{ domain: m },
|
|
1113
|
-
{
|
|
1114
|
-
message_id: j,
|
|
1115
|
-
rating: x,
|
|
1116
|
-
tags: (L = i == null ? void 0 : i.tags) != null && L.length ? i.tags : void 0,
|
|
1117
|
-
text: (i == null ? void 0 : i.text) || void 0
|
|
1118
|
-
}
|
|
1119
|
-
);
|
|
1120
|
-
if ((E == null ? void 0 : E.success) === !1)
|
|
1121
|
-
throw new Error(E.message || "反馈提交失败");
|
|
1122
|
-
return !0;
|
|
1123
|
-
} catch (E) {
|
|
1124
|
-
return Ee((_e) => ({
|
|
1125
|
-
..._e,
|
|
1126
|
-
[j]: A
|
|
1127
|
-
})), X.error(
|
|
1128
|
-
E instanceof Error ? E.message : "反馈提交失败,请稍后重试"
|
|
1129
|
-
), !1;
|
|
1130
|
-
} finally {
|
|
1131
|
-
ns((E) => {
|
|
1132
|
-
const _e = new Set(E);
|
|
1133
|
-
return _e.delete(j), _e;
|
|
1134
|
-
});
|
|
1135
|
-
}
|
|
1136
|
-
},
|
|
1137
|
-
[Ie, Fe, m]
|
|
1138
|
-
), ps = a.useCallback(
|
|
1139
|
-
async (s) => {
|
|
1140
|
-
ue(!1);
|
|
1141
|
-
try {
|
|
1142
|
-
await cs(s);
|
|
1143
|
-
} catch (o) {
|
|
1144
|
-
const i = o instanceof Error ? o.message : "重新生成失败";
|
|
1145
|
-
X.error(i);
|
|
1146
|
-
}
|
|
1147
|
-
},
|
|
1148
|
-
[cs]
|
|
1149
|
-
), _s = a.useCallback(() => {
|
|
1150
|
-
ue((s) => !s);
|
|
1151
|
-
}, []), fs = a.useCallback(
|
|
1152
|
-
(s, o) => {
|
|
1153
|
-
if (s.role !== "assistant" || s.execution_status === "executing") return null;
|
|
1154
|
-
const j = o && s.id === oe && ie.length > 0, A = we ? "隐藏推荐" : j ? `显示推荐(${ie.length})` : "推荐";
|
|
1155
|
-
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1156
|
-
/* @__PURE__ */ e.jsx(
|
|
1157
|
-
va,
|
|
1158
|
-
{
|
|
1159
|
-
msg: s,
|
|
1160
|
-
domain: m,
|
|
1161
|
-
onExportMessage: ms,
|
|
1162
|
-
exportIcon: "copy",
|
|
1163
|
-
showSolidify: !1,
|
|
1164
|
-
onOpenScheduleDialog: hs,
|
|
1165
|
-
onRetrigger: ps,
|
|
1166
|
-
feedbackRating: Fe(s),
|
|
1167
|
-
feedbackPending: !!s.message_id && Ie.has(s.message_id),
|
|
1168
|
-
onFeedback: xs,
|
|
1169
|
-
extraActions: j ? /* @__PURE__ */ e.jsx(Is, { title: A, children: /* @__PURE__ */ e.jsxs(
|
|
1170
|
-
"button",
|
|
1171
|
-
{
|
|
1172
|
-
type: "button",
|
|
1173
|
-
className: `wandox-console-chat__toolbar-toggle${we ? " is-active" : ""}`,
|
|
1174
|
-
"aria-label": A,
|
|
1175
|
-
"aria-expanded": we,
|
|
1176
|
-
onClick: _s,
|
|
1177
|
-
children: [
|
|
1178
|
-
/* @__PURE__ */ e.jsx(Xa, {}),
|
|
1179
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__toolbar-toggle-count", children: ie.length })
|
|
1180
|
-
]
|
|
1181
|
-
}
|
|
1182
|
-
) }) : null
|
|
1183
|
-
}
|
|
1184
|
-
),
|
|
1185
|
-
j && we && /* @__PURE__ */ e.jsx(
|
|
1186
|
-
"ul",
|
|
1187
|
-
{
|
|
1188
|
-
className: "wandox-console-chat__recommendations",
|
|
1189
|
-
"aria-label": "推荐剧本",
|
|
1190
|
-
children: ie.map((x, L) => /* @__PURE__ */ e.jsx(
|
|
1191
|
-
"li",
|
|
1192
|
-
{
|
|
1193
|
-
className: "wandox-console-chat__recommendations-item",
|
|
1194
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1195
|
-
"button",
|
|
1196
|
-
{
|
|
1197
|
-
type: "button",
|
|
1198
|
-
className: "wandox-console-chat__recommendations-pill",
|
|
1199
|
-
disabled: ae,
|
|
1200
|
-
onClick: () => {
|
|
1201
|
-
ze(x);
|
|
1202
|
-
},
|
|
1203
|
-
title: x.description || x.name,
|
|
1204
|
-
children: [
|
|
1205
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__recommendations-pill-label", children: x.name }),
|
|
1206
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__recommendations-pill-arrow", children: /* @__PURE__ */ e.jsx(Ye, {}) })
|
|
1207
|
-
]
|
|
1208
|
-
}
|
|
1209
|
-
)
|
|
1210
|
-
},
|
|
1211
|
-
`${x.playbook_id || x.name}-${L}`
|
|
1212
|
-
))
|
|
1213
|
-
}
|
|
1214
|
-
)
|
|
1215
|
-
] });
|
|
1216
|
-
},
|
|
1217
|
-
[
|
|
1218
|
-
ae,
|
|
1219
|
-
Ie,
|
|
1220
|
-
Fe,
|
|
1221
|
-
ze,
|
|
1222
|
-
ms,
|
|
1223
|
-
xs,
|
|
1224
|
-
hs,
|
|
1225
|
-
ps,
|
|
1226
|
-
ie,
|
|
1227
|
-
oe,
|
|
1228
|
-
we,
|
|
1229
|
-
m,
|
|
1230
|
-
_s
|
|
1231
|
-
]
|
|
1232
|
-
), ca = a.useMemo(
|
|
1233
|
-
() => /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__body", children: [
|
|
1234
|
-
/* @__PURE__ */ e.jsx(
|
|
1235
|
-
Na,
|
|
1236
|
-
{
|
|
1237
|
-
messages: pe,
|
|
1238
|
-
executing: ae,
|
|
1239
|
-
ssoToken: w,
|
|
1240
|
-
ssoDomain: m,
|
|
1241
|
-
ssoCompany: u,
|
|
1242
|
-
onExecutePlaybook: be,
|
|
1243
|
-
onRespondToProposal: os,
|
|
1244
|
-
containerRef: S,
|
|
1245
|
-
messagesTotal: ls,
|
|
1246
|
-
loadMoreMessages: ds,
|
|
1247
|
-
loading: rs,
|
|
1248
|
-
initialLoadingContent: /* @__PURE__ */ e.jsx(Ca, {}),
|
|
1249
|
-
conversationKey: n,
|
|
1250
|
-
messageToolbar: fs
|
|
1251
|
-
}
|
|
1252
|
-
),
|
|
1253
|
-
/* @__PURE__ */ e.jsx(
|
|
1254
|
-
Sa,
|
|
1255
|
-
{
|
|
1256
|
-
messages: pe,
|
|
1257
|
-
scrollContainerRef: S,
|
|
1258
|
-
mode: "deepseek"
|
|
1259
|
-
}
|
|
1260
|
-
)
|
|
1261
|
-
] }),
|
|
1262
|
-
[
|
|
1263
|
-
n,
|
|
1264
|
-
be,
|
|
1265
|
-
ae,
|
|
1266
|
-
ds,
|
|
1267
|
-
pe,
|
|
1268
|
-
rs,
|
|
1269
|
-
ls,
|
|
1270
|
-
fs,
|
|
1271
|
-
os,
|
|
1272
|
-
u,
|
|
1273
|
-
m,
|
|
1274
|
-
w
|
|
1275
|
-
]
|
|
1276
|
-
);
|
|
1277
|
-
return (
|
|
1278
|
-
// wandox-root:Assistant 组件的 CSS 变量(--wandox-*)作用域
|
|
1279
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-root wandox-console-chat", children: [
|
|
1280
|
-
/* @__PURE__ */ e.jsxs("header", { className: "wandox-console-chat__top", children: [
|
|
1281
|
-
/* @__PURE__ */ e.jsxs(
|
|
1282
|
-
"button",
|
|
1283
|
-
{
|
|
1284
|
-
type: "button",
|
|
1285
|
-
className: "wandox-console-chat__back",
|
|
1286
|
-
onClick: M,
|
|
1287
|
-
children: [
|
|
1288
|
-
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
1289
|
-
/* @__PURE__ */ e.jsx("span", { children: "返回" })
|
|
1290
|
-
]
|
|
1291
|
-
}
|
|
1292
|
-
),
|
|
1293
|
-
/* @__PURE__ */ e.jsx(
|
|
1294
|
-
Ge,
|
|
1295
|
-
{
|
|
1296
|
-
menu: {
|
|
1297
|
-
items: P.map((s) => ({
|
|
1298
|
-
key: s.id,
|
|
1299
|
-
disabled: s.id === n,
|
|
1300
|
-
label: /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-agent-menu-item", children: [
|
|
1301
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__icon", children: s.icon }),
|
|
1302
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__name", children: s.name }),
|
|
1303
|
-
s.id === n && /* @__PURE__ */ e.jsx(Ra, { className: "wandox-console-agent-menu-item__check" })
|
|
1304
|
-
] })
|
|
1305
|
-
})),
|
|
1306
|
-
onClick: ({ key: s }) => f == null ? void 0 : f(s)
|
|
1307
|
-
},
|
|
1308
|
-
trigger: ["click"],
|
|
1309
|
-
placement: "bottomLeft",
|
|
1310
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1311
|
-
"button",
|
|
1312
|
-
{
|
|
1313
|
-
type: "button",
|
|
1314
|
-
className: "wandox-console-chat__title",
|
|
1315
|
-
"aria-label": "切换智能体",
|
|
1316
|
-
title: "切换智能体",
|
|
1317
|
-
children: [
|
|
1318
|
-
(ke == null ? void 0 : ke.icon) && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__title-icon", children: ke.icon }),
|
|
1319
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__title-name", children: t || (ke == null ? void 0 : ke.name) || "智能体" }),
|
|
1320
|
-
/* @__PURE__ */ e.jsx(Ms, { className: "wandox-console-chat__title-arrow" })
|
|
1321
|
-
]
|
|
1322
|
-
}
|
|
1323
|
-
)
|
|
1324
|
-
}
|
|
1325
|
-
)
|
|
1326
|
-
] }),
|
|
1327
|
-
/* @__PURE__ */ e.jsxs("nav", { className: "wandox-console-chat__topbar", children: [
|
|
1328
|
-
/* @__PURE__ */ e.jsx(
|
|
1329
|
-
"button",
|
|
1330
|
-
{
|
|
1331
|
-
type: "button",
|
|
1332
|
-
className: `wandox-console-chat__topbar-tab ${te === "chat" ? "active" : ""}`,
|
|
1333
|
-
onClick: () => re("chat"),
|
|
1334
|
-
children: "智能体会话"
|
|
1335
|
-
}
|
|
1336
|
-
),
|
|
1337
|
-
/* @__PURE__ */ e.jsx(
|
|
1338
|
-
"button",
|
|
1339
|
-
{
|
|
1340
|
-
type: "button",
|
|
1341
|
-
className: `wandox-console-chat__topbar-tab ${te === "robot" ? "active" : ""}`,
|
|
1342
|
-
onClick: () => {
|
|
1343
|
-
re("robot"), ce(null);
|
|
1344
|
-
},
|
|
1345
|
-
children: /* @__PURE__ */ e.jsx("span", { children: "巡检机器人" })
|
|
1346
|
-
}
|
|
1347
|
-
)
|
|
1348
|
-
] }),
|
|
1349
|
-
te === "chat" ? ca : /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot", children: [
|
|
1350
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-chips", children: he.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty", children: "该智能体暂无巡检机器人" }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1351
|
-
he.length > 0 && /* @__PURE__ */ e.jsx(
|
|
1352
|
-
"button",
|
|
1353
|
-
{
|
|
1354
|
-
type: "button",
|
|
1355
|
-
className: `wandox-console-chat__robot-chip ${G === null ? "active" : ""}`,
|
|
1356
|
-
onClick: () => ce(null),
|
|
1357
|
-
children: "全部"
|
|
1358
|
-
}
|
|
1359
|
-
),
|
|
1360
|
-
he.map((s) => /* @__PURE__ */ e.jsx(
|
|
1361
|
-
"button",
|
|
1362
|
-
{
|
|
1363
|
-
type: "button",
|
|
1364
|
-
className: `wandox-console-chat__robot-chip ${G === s.name ? "active" : ""}`,
|
|
1365
|
-
onClick: () => ce(s.name),
|
|
1366
|
-
children: s.name
|
|
1367
|
-
},
|
|
1368
|
-
s.agent_id
|
|
1369
|
-
))
|
|
1370
|
-
] }) }),
|
|
1371
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-tabs", children: [
|
|
1372
|
-
/* @__PURE__ */ e.jsx(
|
|
1373
|
-
"button",
|
|
1374
|
-
{
|
|
1375
|
-
type: "button",
|
|
1376
|
-
className: `wandox-console-chat__robot-tab ${R === "results" ? "active" : ""}`,
|
|
1377
|
-
onClick: () => fe("results"),
|
|
1378
|
-
children: "巡检结果"
|
|
1379
|
-
}
|
|
1380
|
-
),
|
|
1381
|
-
/* @__PURE__ */ e.jsxs(
|
|
1382
|
-
"button",
|
|
1383
|
-
{
|
|
1384
|
-
type: "button",
|
|
1385
|
-
className: `wandox-console-chat__robot-tab ${R === "history" ? "active" : ""}`,
|
|
1386
|
-
onClick: () => fe("history"),
|
|
1387
|
-
children: [
|
|
1388
|
-
"执行记录",
|
|
1389
|
-
R === "history" && G && p.length > 0 && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-tab-badge", children: p.length })
|
|
1390
|
-
]
|
|
1391
|
-
}
|
|
1392
|
-
)
|
|
1393
|
-
] }),
|
|
1394
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-content", children: R === "results" ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-empty", children: [
|
|
1395
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(ws, {}) }),
|
|
1396
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: G ? `${G} 暂无巡检结果` : "请选择一个机器人查看巡检结果" }),
|
|
1397
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-desc", children: "巡检结果会在机器人执行后展示在这里" })
|
|
1398
|
-
] }) : G ? ve ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-loading", children: [
|
|
1399
|
-
/* @__PURE__ */ e.jsx(Ts, { size: "small" }),
|
|
1400
|
-
/* @__PURE__ */ e.jsx("span", { children: "加载中..." })
|
|
1401
|
-
] }) : p.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: "暂无执行记录" }) }) : /* @__PURE__ */ e.jsx("ul", { className: "wandox-console-chat__robot-history", children: p.map((s) => /* @__PURE__ */ e.jsxs(
|
|
1402
|
-
"li",
|
|
1403
|
-
{
|
|
1404
|
-
className: `wandox-console-chat__robot-history-item wandox-console-chat__robot-history-item--${s.status}`,
|
|
1405
|
-
children: [
|
|
1406
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-history-info", children: [
|
|
1407
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-history-name", children: s.action_name }),
|
|
1408
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-chat__robot-history-time", children: s.created_at ? new Date(s.created_at).toLocaleString(
|
|
1409
|
-
"zh-CN",
|
|
1410
|
-
{
|
|
1411
|
-
month: "2-digit",
|
|
1412
|
-
day: "2-digit",
|
|
1413
|
-
hour: "2-digit",
|
|
1414
|
-
minute: "2-digit"
|
|
1415
|
-
}
|
|
1416
|
-
) : "" })
|
|
1417
|
-
] }),
|
|
1418
|
-
/* @__PURE__ */ e.jsx(
|
|
1419
|
-
"span",
|
|
1420
|
-
{
|
|
1421
|
-
className: `wandox-console-chat__robot-history-status wandox-console-chat__robot-history-status--${s.status}`,
|
|
1422
|
-
children: {
|
|
1423
|
-
pending: "等待中",
|
|
1424
|
-
running: "执行中",
|
|
1425
|
-
success: "成功",
|
|
1426
|
-
failed: "失败"
|
|
1427
|
-
}[s.status] || s.status
|
|
1428
|
-
}
|
|
1429
|
-
)
|
|
1430
|
-
]
|
|
1431
|
-
},
|
|
1432
|
-
s.id
|
|
1433
|
-
)) }) : /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat__robot-empty", children: [
|
|
1434
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-icon", children: /* @__PURE__ */ e.jsx(ws, {}) }),
|
|
1435
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-title", children: "请先选择机器人" }),
|
|
1436
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__robot-empty-desc", children: "在上方选择机器人以查看其执行记录" })
|
|
1437
|
-
] }) })
|
|
1438
|
-
] }),
|
|
1439
|
-
te === "chat" && O.length > 0 && !(V && !N) && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__recent", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__recent-bar", children: O.map((s, o) => /* @__PURE__ */ e.jsx(
|
|
1440
|
-
"button",
|
|
1441
|
-
{
|
|
1442
|
-
type: "button",
|
|
1443
|
-
className: "wandox-console-chat__recent-chip",
|
|
1444
|
-
disabled: ae,
|
|
1445
|
-
title: s.description || s.name,
|
|
1446
|
-
onClick: () => {
|
|
1447
|
-
ze(s);
|
|
1448
|
-
},
|
|
1449
|
-
children: s.name
|
|
1450
|
-
},
|
|
1451
|
-
`${s.playbook_id || s.name}-${o}`
|
|
1452
|
-
)) }) }),
|
|
1453
|
-
te === "chat" && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-chat__input", children: V && !N ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-input-playbook wandox-console-prompt", children: [
|
|
1454
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__head", children: [
|
|
1455
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scenechoice", children: [
|
|
1456
|
-
/* @__PURE__ */ e.jsx("span", { children: "已选择剧本" }),
|
|
1457
|
-
/* @__PURE__ */ e.jsx("strong", { children: V.title })
|
|
1458
|
-
] }),
|
|
1459
|
-
/* @__PURE__ */ e.jsx(
|
|
1460
|
-
"button",
|
|
1461
|
-
{
|
|
1462
|
-
type: "button",
|
|
1463
|
-
className: "wandox-console-changescene",
|
|
1464
|
-
onClick: () => {
|
|
1465
|
-
ee(null), J([]), I({});
|
|
1466
|
-
},
|
|
1467
|
-
children: "重新选择"
|
|
1468
|
-
}
|
|
1469
|
-
)
|
|
1470
|
-
] }),
|
|
1471
|
-
/* @__PURE__ */ e.jsx(
|
|
1472
|
-
"div",
|
|
1473
|
-
{
|
|
1474
|
-
ref: de,
|
|
1475
|
-
tabIndex: -1,
|
|
1476
|
-
className: "wandox-console-taskarea wandox-console-taskarea--static",
|
|
1477
|
-
children: V.desc || V.title
|
|
1478
|
-
}
|
|
1479
|
-
),
|
|
1480
|
-
k.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea", children: [
|
|
1481
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramhead", children: [
|
|
1482
|
-
/* @__PURE__ */ e.jsx(Ls, {}),
|
|
1483
|
-
/* @__PURE__ */ e.jsx("strong", { children: "确认分析范围" }),
|
|
1484
|
-
/* @__PURE__ */ e.jsxs("span", { className: "wandox-console-paramhead__status", children: [
|
|
1485
|
-
/* @__PURE__ */ e.jsx(We, {}),
|
|
1486
|
-
" ",
|
|
1487
|
-
H.length > 0 ? `待填 ${H.length} 项必填参数` : "参数已就绪"
|
|
1488
|
-
] })
|
|
1489
|
-
] }),
|
|
1490
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children: Re(
|
|
1491
|
-
k,
|
|
1492
|
-
q
|
|
1493
|
-
).map((s) => /* @__PURE__ */ e.jsx(
|
|
1494
|
-
as,
|
|
1495
|
-
{
|
|
1496
|
-
field: s,
|
|
1497
|
-
value: q[s.name],
|
|
1498
|
-
uploading: !1,
|
|
1499
|
-
fileNameMap: {},
|
|
1500
|
-
getOptionState: ye.getFieldState,
|
|
1501
|
-
onChange: (o, i) => I((j) => ({
|
|
1502
|
-
...j,
|
|
1503
|
-
[o]: i
|
|
1504
|
-
}))
|
|
1505
|
-
},
|
|
1506
|
-
s.name
|
|
1507
|
-
)) })
|
|
1508
|
-
] }),
|
|
1509
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__foot", children: [
|
|
1510
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-input-playbook__tip", children: "· 已继承当前上下文" }),
|
|
1511
|
-
/* @__PURE__ */ e.jsxs(
|
|
1512
|
-
"button",
|
|
1513
|
-
{
|
|
1514
|
-
type: "button",
|
|
1515
|
-
className: "wandox-console-start",
|
|
1516
|
-
disabled: !V || ae || H.length > 0,
|
|
1517
|
-
onClick: us,
|
|
1518
|
-
children: [
|
|
1519
|
-
"开始执行",
|
|
1520
|
-
/* @__PURE__ */ e.jsx(Ye, {})
|
|
1521
|
-
]
|
|
1522
|
-
}
|
|
1523
|
-
)
|
|
1524
|
-
] })
|
|
1525
|
-
] }) : /* @__PURE__ */ e.jsx(
|
|
1526
|
-
Aa,
|
|
1527
|
-
{
|
|
1528
|
-
onSend: Zs,
|
|
1529
|
-
executing: ae,
|
|
1530
|
-
stopping: Ws,
|
|
1531
|
-
onStop: Qs,
|
|
1532
|
-
placeholder: "今天帮你做些什么? / 快速调用场景",
|
|
1533
|
-
ssoToken: w,
|
|
1534
|
-
ssoDomain: m,
|
|
1535
|
-
ssoCompany: u,
|
|
1536
|
-
leadingActions: ta,
|
|
1537
|
-
uploadButtonAsLeading: !0,
|
|
1538
|
-
uploadButtonLabel: "添加文件",
|
|
1539
|
-
mentionTriggerChar: "/",
|
|
1540
|
-
mentionListRequest: je,
|
|
1541
|
-
onMentionListRequestHandled: na,
|
|
1542
|
-
autoFocusInput: !V,
|
|
1543
|
-
playbooks: zs,
|
|
1544
|
-
onRequestPlaybookParams: Oe
|
|
1545
|
-
}
|
|
1546
|
-
) }),
|
|
1547
|
-
/* @__PURE__ */ e.jsx(
|
|
1548
|
-
yn,
|
|
1549
|
-
{
|
|
1550
|
-
open: N,
|
|
1551
|
-
source: z,
|
|
1552
|
-
categories: qe,
|
|
1553
|
-
categoryKey: D,
|
|
1554
|
-
search: K,
|
|
1555
|
-
cards: Bs,
|
|
1556
|
-
selectedScene: V,
|
|
1557
|
-
fields: k,
|
|
1558
|
-
values: q,
|
|
1559
|
-
executing: ae,
|
|
1560
|
-
onClose: Xs,
|
|
1561
|
-
onSourceChange: Js,
|
|
1562
|
-
onCategoryChange: ne,
|
|
1563
|
-
onSearchChange: se,
|
|
1564
|
-
onSelectScene: ea,
|
|
1565
|
-
onValueChange: (s, o) => I((i) => ({
|
|
1566
|
-
...i,
|
|
1567
|
-
[s]: o
|
|
1568
|
-
})),
|
|
1569
|
-
onStart: us
|
|
1570
|
-
}
|
|
1571
|
-
),
|
|
1572
|
-
/* @__PURE__ */ e.jsx(
|
|
1573
|
-
Ea,
|
|
1574
|
-
{
|
|
1575
|
-
open: xe.visible,
|
|
1576
|
-
agentId: xe.agentId,
|
|
1577
|
-
playbookId: xe.playbookId,
|
|
1578
|
-
playbookName: xe.playbookName,
|
|
1579
|
-
onClose: oa
|
|
1580
|
-
}
|
|
1581
|
-
)
|
|
1582
|
-
] })
|
|
1583
|
-
);
|
|
1584
|
-
}
|
|
1585
|
-
const { TextArea: jn } = ss;
|
|
1586
|
-
function kn({
|
|
1587
|
-
useMapCards: n,
|
|
1588
|
-
useMapCategories: t,
|
|
1589
|
-
playbooks: l = [],
|
|
1590
|
-
selectedCategoryKey: r,
|
|
1591
|
-
onCategorySelect: d,
|
|
1592
|
-
loading: b,
|
|
1593
|
-
useMapError: _,
|
|
1594
|
-
onRetry: h,
|
|
1595
|
-
onStartAnalysis: y,
|
|
1596
|
-
agents: v,
|
|
1597
|
-
selectedAgentId: P,
|
|
1598
|
-
onAgentSelect: f,
|
|
1599
|
-
onOpenAgentChat: M
|
|
1600
|
-
}) {
|
|
1601
|
-
const [g, C] = a.useState(""), [w, m] = a.useState(""), u = a.useRef(null), [S, Z] = a.useState([]), [N, T] = a.useState(!1), [K, se] = a.useState(""), z = a.useRef(0), [F, D] = a.useState({}), [ne, V] = a.useState({}), [ee, de] = a.useState({}), [k, J] = a.useState([]), [q, I] = a.useState(!1), ye = a.useRef(null), H = a.useMemo(
|
|
1602
|
-
() => n.length > 0 ? n : un(l),
|
|
1603
|
-
[n, l]
|
|
1604
|
-
), te = a.useMemo(() => r ? H.filter((c) => c.categoryKey === r) : H, [H, r]), re = a.useMemo(() => {
|
|
1605
|
-
const c = w.trim().toLowerCase();
|
|
1606
|
-
return c ? te.filter(
|
|
1607
|
-
(O) => O.title.toLowerCase().includes(c) || O.desc.toLowerCase().includes(c)
|
|
1608
|
-
) : te;
|
|
1609
|
-
}, [te, w]), he = a.useMemo(() => re.slice(0, 6), [re]), ge = b || _ && H.length === 0 || re.length > 0, [G, ce] = a.useState("");
|
|
1610
|
-
a.useEffect(() => {
|
|
1611
|
-
z.current += 1, ce(""), C(""), Z([]), D({}), T(!1), se("");
|
|
1612
|
-
}, [r]), a.useEffect(() => {
|
|
1613
|
-
G && !H.some((c) => c.playbook_id === G) && (z.current += 1, ce(""), C(""), Z([]), D({}), T(!1), se(""));
|
|
1614
|
-
}, [G, H]);
|
|
1615
|
-
const R = a.useMemo(
|
|
1616
|
-
() => H.find((c) => c.playbook_id === G) ?? null,
|
|
1617
|
-
[H, G]
|
|
1618
|
-
);
|
|
1619
|
-
a.useEffect(() => {
|
|
1620
|
-
if (b || R) return;
|
|
1621
|
-
const c = window.setTimeout(() => {
|
|
1622
|
-
var U, $;
|
|
1623
|
-
const O = ($ = (U = u.current) == null ? void 0 : U.resizableTextArea) == null ? void 0 : $.textArea;
|
|
1624
|
-
O == null || O.focus();
|
|
1625
|
-
}, 0);
|
|
1626
|
-
return () => window.clearTimeout(c);
|
|
1627
|
-
}, [b, R]);
|
|
1628
|
-
const fe = a.useCallback(async (c) => {
|
|
1629
|
-
const O = String(c.playbook_id || "").trim();
|
|
1630
|
-
if (!O) {
|
|
1631
|
-
X.error("剧本缺少 playbook_id");
|
|
1632
|
-
return;
|
|
1633
|
-
}
|
|
1634
|
-
const U = ++z.current;
|
|
1635
|
-
ce(O), Z([]), D({}), V({}), de({}), T(!0), se("");
|
|
1636
|
-
try {
|
|
1637
|
-
const { data: $ } = await $a({
|
|
1638
|
-
playbook_id: O
|
|
1639
|
-
});
|
|
1640
|
-
if (U !== z.current) return;
|
|
1641
|
-
if (!$ || typeof $ != "object" || Array.isArray($))
|
|
1642
|
-
throw new Error("剧本详情为空");
|
|
1643
|
-
const Y = He(
|
|
1644
|
-
Pa($)
|
|
1645
|
-
);
|
|
1646
|
-
Z(Y), D(Ze(Y));
|
|
1647
|
-
} catch ($) {
|
|
1648
|
-
if (U !== z.current) return;
|
|
1649
|
-
const Y = $ instanceof Error ? $.message : "剧本参数加载失败";
|
|
1650
|
-
se(Y), X.error("剧本参数加载失败,请稍后重试");
|
|
1651
|
-
} finally {
|
|
1652
|
-
U === z.current && T(!1);
|
|
1653
|
-
}
|
|
1654
|
-
}, []), ve = () => {
|
|
1655
|
-
z.current += 1, ce(""), C(""), Z([]), D({}), T(!1), se("");
|
|
1656
|
-
}, Ne = Ps(S, F, D), p = a.useMemo(
|
|
1657
|
-
() => Re(S, F),
|
|
1658
|
-
[S, F]
|
|
1659
|
-
), W = a.useCallback((c, O) => {
|
|
1660
|
-
D((U) => ({ ...U, [c]: O }));
|
|
1661
|
-
}, []), ie = a.useCallback(
|
|
1662
|
-
(c, O) => async ({ file: U, onSuccess: $, onError: Y }) => {
|
|
1663
|
-
var je, me;
|
|
1664
|
-
V((Q) => ({ ...Q, [c]: !0 }));
|
|
1665
|
-
try {
|
|
1666
|
-
const Q = U, B = await ys(Q), xe = (je = B == null ? void 0 : B.data) == null ? void 0 : je.url, Ae = ((me = B == null ? void 0 : B.data) == null ? void 0 : me.name) || Q.name;
|
|
1667
|
-
if (!xe) throw new Error("上传结果缺少文件地址");
|
|
1668
|
-
de((le) => ({ ...le, [xe]: Ae })), D((le) => {
|
|
1669
|
-
if (O <= 1) return { ...le, [c]: xe };
|
|
1670
|
-
const Ee = Array.isArray(le[c]) ? le[c] : le[c] ? [le[c]] : [];
|
|
1671
|
-
return { ...le, [c]: [...Ee, xe] };
|
|
1672
|
-
}), $ == null || $(B), X.success("上传成功");
|
|
1673
|
-
} catch (Q) {
|
|
1674
|
-
const B = Q instanceof Error ? Q : new Error("上传失败");
|
|
1675
|
-
Y == null || Y(B), X.error(B.message);
|
|
1676
|
-
} finally {
|
|
1677
|
-
V((Q) => ({ ...Q, [c]: !1 }));
|
|
1678
|
-
}
|
|
1679
|
-
},
|
|
1680
|
-
[]
|
|
1681
|
-
), Le = a.useCallback(
|
|
1682
|
-
async (c) => {
|
|
1683
|
-
const O = Array.from(c.target.files ?? []);
|
|
1684
|
-
if (c.target.value = "", O.length !== 0) {
|
|
1685
|
-
I(!0);
|
|
1686
|
-
try {
|
|
1687
|
-
const U = await Promise.all(
|
|
1688
|
-
O.map(async ($) => {
|
|
1689
|
-
var Q, B;
|
|
1690
|
-
const Y = await ys($), je = (Q = Y == null ? void 0 : Y.data) == null ? void 0 : Q.url, me = ((B = Y == null ? void 0 : Y.data) == null ? void 0 : B.name) || $.name;
|
|
1691
|
-
if (!je) throw new Error("上传结果缺少文件地址");
|
|
1692
|
-
return {
|
|
1693
|
-
type: $.type.startsWith("image/") ? "image" : "file",
|
|
1694
|
-
url: je,
|
|
1695
|
-
name: me,
|
|
1696
|
-
mime_type: $.type
|
|
1697
|
-
};
|
|
1698
|
-
})
|
|
1699
|
-
);
|
|
1700
|
-
J(($) => [...$, ...U]), X.success(`已添加 ${U.length} 个附件`);
|
|
1701
|
-
} catch (U) {
|
|
1702
|
-
X.error(U instanceof Error ? U.message : "上传失败");
|
|
1703
|
-
} finally {
|
|
1704
|
-
I(!1);
|
|
1705
|
-
}
|
|
1706
|
-
}
|
|
1707
|
-
},
|
|
1708
|
-
[]
|
|
1709
|
-
), we = a.useCallback((c) => {
|
|
1710
|
-
J((O) => O.filter((U) => U.url !== c));
|
|
1711
|
-
}, []), ue = a.useMemo(
|
|
1712
|
-
() => p.filter(
|
|
1713
|
-
(c) => c.required && Qe(F[c.name])
|
|
1714
|
-
),
|
|
1715
|
-
[p, F]
|
|
1716
|
-
), oe = a.useMemo(
|
|
1717
|
-
() => v.find((c) => c.id === P) ?? v.find((c) => c.current) ?? v[0],
|
|
1718
|
-
[v, P]
|
|
1719
|
-
);
|
|
1720
|
-
return /* @__PURE__ */ e.jsx("div", { className: "wandox-console-view", children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-homecenter", children: [
|
|
1721
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-homecenter-hero", children: [
|
|
1722
|
-
oe && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header", children: [
|
|
1723
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header__agent", children: [
|
|
1724
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__avatar", children: oe.icon }),
|
|
1725
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-home-header__identity", children: [
|
|
1726
|
-
/* @__PURE__ */ e.jsx(
|
|
1727
|
-
Ge,
|
|
1728
|
-
{
|
|
1729
|
-
menu: {
|
|
1730
|
-
items: v.map((c) => ({
|
|
1731
|
-
key: c.id,
|
|
1732
|
-
disabled: c.id === oe.id,
|
|
1733
|
-
label: /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-agent-menu-item", children: [
|
|
1734
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__icon", children: c.icon }),
|
|
1735
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-agent-menu-item__name", children: c.name }),
|
|
1736
|
-
c.id === oe.id && /* @__PURE__ */ e.jsx(We, { className: "wandox-console-agent-menu-item__check" })
|
|
1737
|
-
] })
|
|
1738
|
-
})),
|
|
1739
|
-
onClick: ({ key: c }) => f == null ? void 0 : f(c)
|
|
1740
|
-
},
|
|
1741
|
-
trigger: ["click"],
|
|
1742
|
-
placement: "bottomLeft",
|
|
1743
|
-
children: /* @__PURE__ */ e.jsxs(
|
|
1744
|
-
"button",
|
|
1745
|
-
{
|
|
1746
|
-
type: "button",
|
|
1747
|
-
className: "wandox-console-home-header__selector",
|
|
1748
|
-
"aria-label": "切换智能体",
|
|
1749
|
-
children: [
|
|
1750
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-home-header__name", children: oe.name }),
|
|
1751
|
-
/* @__PURE__ */ e.jsx(Ms, { className: "wandox-console-home-header__arrow" })
|
|
1752
|
-
]
|
|
1753
|
-
}
|
|
1754
|
-
)
|
|
1755
|
-
}
|
|
1756
|
-
),
|
|
1757
|
-
oe.desc && /* @__PURE__ */ e.jsx(
|
|
1758
|
-
"p",
|
|
1759
|
-
{
|
|
1760
|
-
className: "wandox-console-home-header__description",
|
|
1761
|
-
title: oe.desc,
|
|
1762
|
-
children: oe.desc
|
|
1763
|
-
}
|
|
1764
|
-
)
|
|
1765
|
-
] })
|
|
1766
|
-
] }),
|
|
1767
|
-
/* @__PURE__ */ e.jsxs(
|
|
1768
|
-
"button",
|
|
1769
|
-
{
|
|
1770
|
-
type: "button",
|
|
1771
|
-
className: "wandox-console-home-header__history",
|
|
1772
|
-
onClick: () => M == null ? void 0 : M(),
|
|
1773
|
-
children: [
|
|
1774
|
-
/* @__PURE__ */ e.jsx("span", { children: "会话记录" }),
|
|
1775
|
-
/* @__PURE__ */ e.jsx(Ma, { className: "wandox-console-home-header__history-arrow" })
|
|
1776
|
-
]
|
|
1777
|
-
}
|
|
1778
|
-
)
|
|
1779
|
-
] }),
|
|
1780
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt", children: [
|
|
1781
|
-
R && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__head", children: [
|
|
1782
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scenechoice", children: [
|
|
1783
|
-
/* @__PURE__ */ e.jsx("span", { children: "已选择剧本" }),
|
|
1784
|
-
/* @__PURE__ */ e.jsx("strong", { children: R.title })
|
|
1785
|
-
] }),
|
|
1786
|
-
/* @__PURE__ */ e.jsx(
|
|
1787
|
-
"button",
|
|
1788
|
-
{
|
|
1789
|
-
type: "button",
|
|
1790
|
-
className: "wandox-console-changescene",
|
|
1791
|
-
onClick: ve,
|
|
1792
|
-
children: "自由提问"
|
|
1793
|
-
}
|
|
1794
|
-
)
|
|
1795
|
-
] }),
|
|
1796
|
-
R ? /* @__PURE__ */ e.jsx("div", { className: "wandox-console-taskarea wandox-console-taskarea--static", children: R.desc || R.title }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-taskarea", children: /* @__PURE__ */ e.jsx(
|
|
1797
|
-
jn,
|
|
1798
|
-
{
|
|
1799
|
-
ref: u,
|
|
1800
|
-
value: g,
|
|
1801
|
-
onChange: (c) => C(c.target.value),
|
|
1802
|
-
autoSize: { minRows: 2 },
|
|
1803
|
-
variant: "borderless",
|
|
1804
|
-
placeholder: "直接描述你的问题,或选择一个场景开始"
|
|
1805
|
-
}
|
|
1806
|
-
) }),
|
|
1807
|
-
R && N && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea wandox-console-paramarea--state", children: [
|
|
1808
|
-
/* @__PURE__ */ e.jsx(Ta, {}),
|
|
1809
|
-
/* @__PURE__ */ e.jsx("span", { children: "正在读取剧本参数..." })
|
|
1810
|
-
] }),
|
|
1811
|
-
R && !N && K && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea wandox-console-paramarea--state", children: [
|
|
1812
|
-
/* @__PURE__ */ e.jsx("span", { children: "剧本参数加载失败" }),
|
|
1813
|
-
/* @__PURE__ */ e.jsxs(
|
|
1814
|
-
"button",
|
|
1815
|
-
{
|
|
1816
|
-
type: "button",
|
|
1817
|
-
className: "wandox-console-paramarea__retry",
|
|
1818
|
-
onClick: () => void fe(R),
|
|
1819
|
-
children: [
|
|
1820
|
-
/* @__PURE__ */ e.jsx(gs, {}),
|
|
1821
|
-
"重试"
|
|
1822
|
-
]
|
|
1823
|
-
}
|
|
1824
|
-
)
|
|
1825
|
-
] }),
|
|
1826
|
-
R && !N && !K && p.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramarea", children: [
|
|
1827
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-paramhead", children: [
|
|
1828
|
-
/* @__PURE__ */ e.jsx(Ls, {}),
|
|
1829
|
-
/* @__PURE__ */ e.jsx("strong", { children: "确认分析范围" }),
|
|
1830
|
-
/* @__PURE__ */ e.jsxs("span", { className: "wandox-console-paramhead__status", children: [
|
|
1831
|
-
/* @__PURE__ */ e.jsx(We, {}),
|
|
1832
|
-
" ",
|
|
1833
|
-
ue.length > 0 ? `待填 ${ue.length} 项必填参数` : "参数已就绪"
|
|
1834
|
-
] })
|
|
1835
|
-
] }),
|
|
1836
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-params", children: p.map((c) => /* @__PURE__ */ e.jsx(
|
|
1837
|
-
as,
|
|
1838
|
-
{
|
|
1839
|
-
field: c,
|
|
1840
|
-
value: F[c.name],
|
|
1841
|
-
uploading: !!ne[c.name],
|
|
1842
|
-
fileNameMap: ee,
|
|
1843
|
-
getOptionState: Ne.getFieldState,
|
|
1844
|
-
onChange: W,
|
|
1845
|
-
onUpload: ie
|
|
1846
|
-
},
|
|
1847
|
-
c.name
|
|
1848
|
-
)) })
|
|
1849
|
-
] }),
|
|
1850
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-prompt__foot", children: [
|
|
1851
|
-
/* @__PURE__ */ e.jsx(
|
|
1852
|
-
"button",
|
|
1853
|
-
{
|
|
1854
|
-
type: "button",
|
|
1855
|
-
className: "wandox-console-attach",
|
|
1856
|
-
onClick: () => {
|
|
1857
|
-
var c;
|
|
1858
|
-
return (c = ye.current) == null ? void 0 : c.click();
|
|
1859
|
-
},
|
|
1860
|
-
disabled: q,
|
|
1861
|
-
title: q ? "上传中…" : "附件",
|
|
1862
|
-
children: /* @__PURE__ */ e.jsx(Fa, {})
|
|
1863
|
-
}
|
|
1864
|
-
),
|
|
1865
|
-
/* @__PURE__ */ e.jsx(
|
|
1866
|
-
"input",
|
|
1867
|
-
{
|
|
1868
|
-
ref: ye,
|
|
1869
|
-
type: "file",
|
|
1870
|
-
multiple: !0,
|
|
1871
|
-
accept: "image/*,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip",
|
|
1872
|
-
hidden: !0,
|
|
1873
|
-
onChange: Le
|
|
1874
|
-
}
|
|
1875
|
-
),
|
|
1876
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-prompt__foot-right", children: /* @__PURE__ */ e.jsx(
|
|
1877
|
-
"button",
|
|
1878
|
-
{
|
|
1879
|
-
type: "button",
|
|
1880
|
-
className: "wandox-console-prompt__send",
|
|
1881
|
-
disabled: !R && !g.trim() || N || !!K || ue.length > 0,
|
|
1882
|
-
onClick: () => {
|
|
1883
|
-
y == null || y({
|
|
1884
|
-
playbookId: R == null ? void 0 : R.playbook_id,
|
|
1885
|
-
playbookParams: R ? F : {},
|
|
1886
|
-
message: R ? R.title : g.trim(),
|
|
1887
|
-
attachments: k
|
|
1888
|
-
});
|
|
1889
|
-
},
|
|
1890
|
-
"aria-label": "发送",
|
|
1891
|
-
children: /* @__PURE__ */ e.jsx(La, {})
|
|
1892
|
-
}
|
|
1893
|
-
) })
|
|
1894
|
-
] })
|
|
1895
|
-
] }),
|
|
1896
|
-
k.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "wandox-console-attachments", children: k.map((c) => /* @__PURE__ */ e.jsxs("span", { className: "wandox-console-attach-item", children: [
|
|
1897
|
-
c.type === "image" ? /* @__PURE__ */ e.jsx(
|
|
1898
|
-
"img",
|
|
1899
|
-
{
|
|
1900
|
-
src: c.url,
|
|
1901
|
-
alt: c.name,
|
|
1902
|
-
className: "wandox-console-attach-item__thumb"
|
|
1903
|
-
}
|
|
1904
|
-
) : /* @__PURE__ */ e.jsx(Da, { className: "wandox-console-attach-item__icon" }),
|
|
1905
|
-
/* @__PURE__ */ e.jsx(
|
|
1906
|
-
"span",
|
|
1907
|
-
{
|
|
1908
|
-
className: "wandox-console-attach-item__name",
|
|
1909
|
-
title: c.name,
|
|
1910
|
-
children: c.name
|
|
1911
|
-
}
|
|
1912
|
-
),
|
|
1913
|
-
/* @__PURE__ */ e.jsx(
|
|
1914
|
-
"button",
|
|
1915
|
-
{
|
|
1916
|
-
type: "button",
|
|
1917
|
-
className: "wandox-console-attach-item__remove",
|
|
1918
|
-
"aria-label": "移除附件",
|
|
1919
|
-
onClick: () => we(c.url),
|
|
1920
|
-
children: /* @__PURE__ */ e.jsx($s, {})
|
|
1921
|
-
}
|
|
1922
|
-
)
|
|
1923
|
-
] }, c.url)) }),
|
|
1924
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scenehead", children: [
|
|
1925
|
-
/* @__PURE__ */ e.jsx(
|
|
1926
|
-
"div",
|
|
1927
|
-
{
|
|
1928
|
-
className: "wandox-console-chips",
|
|
1929
|
-
role: "tablist",
|
|
1930
|
-
"aria-label": "场景分类",
|
|
1931
|
-
children: t.slice(0, 5).map((c) => /* @__PURE__ */ e.jsx(
|
|
1932
|
-
"button",
|
|
1933
|
-
{
|
|
1934
|
-
type: "button",
|
|
1935
|
-
role: "tab",
|
|
1936
|
-
"aria-selected": r === c.key,
|
|
1937
|
-
className: `wandox-console-chip${r === c.key ? " wandox-console-chip--active" : ""}`,
|
|
1938
|
-
onClick: () => d == null ? void 0 : d(c.key),
|
|
1939
|
-
children: /* @__PURE__ */ e.jsx("span", { children: c.name })
|
|
1940
|
-
},
|
|
1941
|
-
c.key
|
|
1942
|
-
))
|
|
1943
|
-
}
|
|
1944
|
-
),
|
|
1945
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenesearch", children: /* @__PURE__ */ e.jsx(
|
|
1946
|
-
ss,
|
|
1947
|
-
{
|
|
1948
|
-
allowClear: !0,
|
|
1949
|
-
prefix: /* @__PURE__ */ e.jsx(Be, {}),
|
|
1950
|
-
placeholder: "搜索当前地图下的场景",
|
|
1951
|
-
value: w,
|
|
1952
|
-
onChange: (c) => m(c.target.value)
|
|
1953
|
-
}
|
|
1954
|
-
) })
|
|
1955
|
-
] })
|
|
1956
|
-
] }),
|
|
1957
|
-
ge && /* @__PURE__ */ e.jsxs(
|
|
1958
|
-
"section",
|
|
1959
|
-
{
|
|
1960
|
-
className: "wandox-console-scene-section",
|
|
1961
|
-
"aria-label": "个性化场景",
|
|
1962
|
-
children: [
|
|
1963
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-scene-section__header", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx("h2", { children: "为你推荐" }) }) }),
|
|
1964
|
-
b ? /* @__PURE__ */ e.jsxs(
|
|
1965
|
-
"div",
|
|
1966
|
-
{
|
|
1967
|
-
className: "wandox-console-agents__loading",
|
|
1968
|
-
style: { justifyContent: "center", padding: "40px 0" },
|
|
1969
|
-
children: [
|
|
1970
|
-
/* @__PURE__ */ e.jsx(Ts, { size: "small" }),
|
|
1971
|
-
/* @__PURE__ */ e.jsx("span", { children: "正在加载剧本..." })
|
|
1972
|
-
]
|
|
1973
|
-
}
|
|
1974
|
-
) : _ && H.length === 0 ? /* @__PURE__ */ e.jsxs(
|
|
1975
|
-
"div",
|
|
1976
|
-
{
|
|
1977
|
-
className: "wandox-console-agents__error",
|
|
1978
|
-
style: { alignItems: "center", padding: "32px 0" },
|
|
1979
|
-
children: [
|
|
1980
|
-
/* @__PURE__ */ e.jsx("span", { children: _ }),
|
|
1981
|
-
/* @__PURE__ */ e.jsxs("button", { type: "button", onClick: h, children: [
|
|
1982
|
-
/* @__PURE__ */ e.jsx(gs, {}),
|
|
1983
|
-
"重试"
|
|
1984
|
-
] })
|
|
1985
|
-
]
|
|
1986
|
-
}
|
|
1987
|
-
) : re.length === 0 ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene-section__empty", children: [
|
|
1988
|
-
/* @__PURE__ */ e.jsx(Be, {}),
|
|
1989
|
-
/* @__PURE__ */ e.jsx("span", { children: w ? "没有匹配的场景" : "当前分类暂无场景" })
|
|
1990
|
-
] }) : /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes-wrap", children: /* @__PURE__ */ e.jsx("div", { className: "wandox-console-scenes", children: he.map((c) => /* @__PURE__ */ e.jsx(
|
|
1991
|
-
"button",
|
|
1992
|
-
{
|
|
1993
|
-
type: "button",
|
|
1994
|
-
className: `wandox-console-scene${G === c.playbook_id ? " wandox-console-scene--selected" : ""}`,
|
|
1995
|
-
onClick: () => fe(c),
|
|
1996
|
-
children: /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-scene__body", children: [
|
|
1997
|
-
/* @__PURE__ */ e.jsx("strong", { children: c.title }),
|
|
1998
|
-
c.desc && /* @__PURE__ */ e.jsx("span", { className: "wandox-console-scene__desc", children: c.desc })
|
|
1999
|
-
] })
|
|
2000
|
-
},
|
|
2001
|
-
c.key
|
|
2002
|
-
)) }) })
|
|
2003
|
-
]
|
|
2004
|
-
}
|
|
2005
|
-
)
|
|
2006
|
-
] }) });
|
|
2007
|
-
}
|
|
2008
|
-
const vn = [
|
|
2009
|
-
{
|
|
2010
|
-
id: "conversation",
|
|
2011
|
-
title: "智能体",
|
|
2012
|
-
desc: "与智能体自由对话或选择场景执行任务",
|
|
2013
|
-
icon: /* @__PURE__ */ e.jsx(Ba, {}),
|
|
2014
|
-
accent: "#4f46e5"
|
|
2015
|
-
},
|
|
2016
|
-
{
|
|
2017
|
-
id: "automation",
|
|
2018
|
-
title: "自动化",
|
|
2019
|
-
desc: "管理与执行自动化流程、定时任务与驾驶舱",
|
|
2020
|
-
icon: /* @__PURE__ */ e.jsx(qa, {}),
|
|
2021
|
-
accent: "#4f46e5"
|
|
2022
|
-
}
|
|
2023
|
-
], Se = {
|
|
2024
|
-
id: "notification",
|
|
2025
|
-
title: "通知配置",
|
|
2026
|
-
icon: /* @__PURE__ */ e.jsx(Ka, {}),
|
|
2027
|
-
accent: "#e0730c"
|
|
2028
|
-
};
|
|
2029
|
-
function Nn({
|
|
2030
|
-
features: n,
|
|
2031
|
-
onOpenFeature: t,
|
|
2032
|
-
activeId: l
|
|
2033
|
-
}) {
|
|
2034
|
-
return /* @__PURE__ */ e.jsxs("header", { className: "wandox-console-topnav", "aria-label": "控制台顶部导航", children: [
|
|
2035
|
-
/* @__PURE__ */ e.jsx("nav", { className: "wandox-console-topnav__pill", "aria-label": "工作台", children: n.map((r) => {
|
|
2036
|
-
const d = l === r.id;
|
|
2037
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2038
|
-
"button",
|
|
2039
|
-
{
|
|
2040
|
-
type: "button",
|
|
2041
|
-
className: `wandox-console-topnav__pill-btn${d ? " wandox-console-topnav__pill-btn--active" : ""}`,
|
|
2042
|
-
title: r.title,
|
|
2043
|
-
"aria-label": r.title,
|
|
2044
|
-
"aria-current": d ? "page" : void 0,
|
|
2045
|
-
onClick: () => t(r.id),
|
|
2046
|
-
children: [
|
|
2047
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-icon", children: r.icon }),
|
|
2048
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__pill-text", children: r.title })
|
|
2049
|
-
]
|
|
2050
|
-
},
|
|
2051
|
-
r.id
|
|
2052
|
-
);
|
|
2053
|
-
}) }),
|
|
2054
|
-
/* @__PURE__ */ e.jsx(
|
|
2055
|
-
"button",
|
|
2056
|
-
{
|
|
2057
|
-
type: "button",
|
|
2058
|
-
className: "wandox-console-topnav__notify",
|
|
2059
|
-
style: {
|
|
2060
|
-
"--notify-accent": Se.accent
|
|
2061
|
-
},
|
|
2062
|
-
title: Se.title,
|
|
2063
|
-
"aria-label": Se.title,
|
|
2064
|
-
onClick: () => t(Se.id),
|
|
2065
|
-
children: /* @__PURE__ */ e.jsx("span", { className: "wandox-console-topnav__notify-icon", children: Se.icon })
|
|
2066
|
-
}
|
|
2067
|
-
)
|
|
2068
|
-
] });
|
|
2069
|
-
}
|
|
2070
|
-
function Cn({
|
|
2071
|
-
className: n = "",
|
|
2072
|
-
state: t = "idle"
|
|
2073
|
-
}) {
|
|
2074
|
-
return /* @__PURE__ */ e.jsx(
|
|
2075
|
-
"img",
|
|
2076
|
-
{
|
|
2077
|
-
className: `wandox-console-companion${n ? ` ${n}` : ""}`,
|
|
2078
|
-
"data-state": t,
|
|
2079
|
-
src: Oa,
|
|
2080
|
-
alt: "",
|
|
2081
|
-
"aria-hidden": "true"
|
|
2082
|
-
}
|
|
2083
|
-
);
|
|
2084
|
-
}
|
|
2085
|
-
function Cs({ fading: n }) {
|
|
2086
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2087
|
-
"div",
|
|
2088
|
-
{
|
|
2089
|
-
className: `wandox-console-init${n ? " wandox-console-init--fading" : ""}`,
|
|
2090
|
-
"aria-hidden": !0,
|
|
2091
|
-
children: [
|
|
2092
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__halo wandox-console-init__halo--a" }),
|
|
2093
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__halo wandox-console-init__halo--b" }),
|
|
2094
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-init__inner", children: [
|
|
2095
|
-
/* @__PURE__ */ e.jsx(
|
|
2096
|
-
Cn,
|
|
2097
|
-
{
|
|
2098
|
-
className: "wandox-console-init__companion",
|
|
2099
|
-
state: "thinking"
|
|
2100
|
-
}
|
|
2101
|
-
),
|
|
2102
|
-
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2103
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__title", children: "正在准备你的控制台" }),
|
|
2104
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__subtitle", children: "正在加载智能体与剧本数据…" })
|
|
2105
|
-
] }),
|
|
2106
|
-
/* @__PURE__ */ e.jsxs("div", { className: "wandox-console-init__dots", "aria-hidden": !0, children: [
|
|
2107
|
-
/* @__PURE__ */ e.jsx("span", {}),
|
|
2108
|
-
/* @__PURE__ */ e.jsx("span", {}),
|
|
2109
|
-
/* @__PURE__ */ e.jsx("span", {}),
|
|
2110
|
-
/* @__PURE__ */ e.jsx("span", {}),
|
|
2111
|
-
/* @__PURE__ */ e.jsx("span", {})
|
|
2112
|
-
] })
|
|
2113
|
-
] }),
|
|
2114
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-init__footnote", children: "由 Wandox AI 提供动力" })
|
|
2115
|
-
]
|
|
2116
|
-
}
|
|
2117
|
-
);
|
|
2118
|
-
}
|
|
2119
|
-
function Ss({
|
|
2120
|
-
title: n,
|
|
2121
|
-
onBack: t,
|
|
2122
|
-
hideHeader: l = !1,
|
|
2123
|
-
className: r,
|
|
2124
|
-
children: d
|
|
2125
|
-
}) {
|
|
2126
|
-
return /* @__PURE__ */ e.jsxs(
|
|
2127
|
-
"div",
|
|
2128
|
-
{
|
|
2129
|
-
className: `wandox-console-featureview${r ? ` ${r}` : ""}`,
|
|
2130
|
-
children: [
|
|
2131
|
-
!l && /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-featureview__bar", children: [
|
|
2132
|
-
/* @__PURE__ */ e.jsxs(
|
|
2133
|
-
"button",
|
|
2134
|
-
{
|
|
2135
|
-
type: "button",
|
|
2136
|
-
className: "wandox-console-featureview__back",
|
|
2137
|
-
onClick: t,
|
|
2138
|
-
children: [
|
|
2139
|
-
/* @__PURE__ */ e.jsx(Fs, {}),
|
|
2140
|
-
"返回控制台"
|
|
2141
|
-
]
|
|
2142
|
-
}
|
|
2143
|
-
),
|
|
2144
|
-
/* @__PURE__ */ e.jsx("span", { className: "wandox-console-featureview__title", children: n })
|
|
2145
|
-
] }),
|
|
2146
|
-
/* @__PURE__ */ e.jsx("div", { className: "wandox-console-featureview__body", children: d })
|
|
2147
|
-
]
|
|
2148
|
-
}
|
|
2149
|
-
);
|
|
2150
|
-
}
|
|
2151
|
-
function En({
|
|
2152
|
-
agents: n,
|
|
2153
|
-
initialAgentId: t,
|
|
2154
|
-
initialPlaybookId: l,
|
|
2155
|
-
initialPlaybookParams: r,
|
|
2156
|
-
onReady: d
|
|
2157
|
-
} = {}) {
|
|
2158
|
-
const {
|
|
2159
|
-
agents: b,
|
|
2160
|
-
agentLoading: _,
|
|
2161
|
-
selectedAgentId: h,
|
|
2162
|
-
selectedAgent: y,
|
|
2163
|
-
selectAgent: v,
|
|
2164
|
-
...P
|
|
2165
|
-
} = xn({ presetAgents: n, initialAgentId: t }), [f, M] = a.useState(null), g = a.useRef(null), C = a.useRef(!1), [w, m] = a.useState("home"), [u, S] = a.useState(
|
|
2166
|
-
null
|
|
2167
|
-
), [Z, N] = a.useState(!1), [T, K] = a.useState(null), [se, z] = a.useState(""), F = y == null ? void 0 : y.name, D = a.useCallback((p) => {
|
|
2168
|
-
if (g.current) {
|
|
2169
|
-
g.current.showInspectionResults(p);
|
|
2170
|
-
return;
|
|
2171
|
-
}
|
|
2172
|
-
M({ robotName: p });
|
|
2173
|
-
}, []);
|
|
2174
|
-
a.useEffect(() => {
|
|
2175
|
-
d == null || d({ showInspectionResults: D });
|
|
2176
|
-
}, [D, d]), a.useEffect(() => {
|
|
2177
|
-
!f || g.current || !h || w === "chat" || (K({
|
|
2178
|
-
agentId: h,
|
|
2179
|
-
agentName: F,
|
|
2180
|
-
playbookParams: {},
|
|
2181
|
-
message: ""
|
|
2182
|
-
}), m("chat"));
|
|
2183
|
-
}, [w, f, h, F]), a.useEffect(() => {
|
|
2184
|
-
z("");
|
|
2185
|
-
}, [h]);
|
|
2186
|
-
const {
|
|
2187
|
-
playbooks: ne,
|
|
2188
|
-
userPlaybooks: V,
|
|
2189
|
-
useMapCategories: ee,
|
|
2190
|
-
useMapCards: de,
|
|
2191
|
-
sceneLoading: k,
|
|
2192
|
-
useMapError: J,
|
|
2193
|
-
reload: q
|
|
2194
|
-
} = P, I = a.useMemo(
|
|
2195
|
-
() => ee.length > 0 ? ee : dn(ne),
|
|
2196
|
-
[ee, ne]
|
|
2197
|
-
);
|
|
2198
|
-
a.useEffect(() => {
|
|
2199
|
-
if (I.length === 0) return;
|
|
2200
|
-
I.some(
|
|
2201
|
-
(W) => W.key === se
|
|
2202
|
-
) || z(I[0].key);
|
|
2203
|
-
}, [I]);
|
|
2204
|
-
const ye = a.useRef(!1);
|
|
2205
|
-
a.useEffect(() => {
|
|
2206
|
-
if (ye.current || !l || !h || k)
|
|
2207
|
-
return;
|
|
2208
|
-
const p = b.find(
|
|
2209
|
-
(W) => W.id === h && es(W, t)
|
|
2210
|
-
);
|
|
2211
|
-
p && (ye.current = !0, K({
|
|
2212
|
-
agentId: h,
|
|
2213
|
-
agentName: p.name,
|
|
2214
|
-
playbookId: l,
|
|
2215
|
-
playbookParams: r || {},
|
|
2216
|
-
message: ""
|
|
2217
|
-
}), m("chat"));
|
|
2218
|
-
}, [
|
|
2219
|
-
k,
|
|
2220
|
-
b,
|
|
2221
|
-
t,
|
|
2222
|
-
l,
|
|
2223
|
-
r,
|
|
2224
|
-
h,
|
|
2225
|
-
F
|
|
2226
|
-
]), a.useEffect(() => {
|
|
2227
|
-
if (C.current || !t || l || !h || k)
|
|
2228
|
-
return;
|
|
2229
|
-
const p = b.find(
|
|
2230
|
-
(W) => W.id === h && es(W, t)
|
|
2231
|
-
);
|
|
2232
|
-
p && (C.current = !0, K({
|
|
2233
|
-
agentId: p.id,
|
|
2234
|
-
agentName: p.name,
|
|
2235
|
-
playbookParams: {},
|
|
2236
|
-
message: ""
|
|
2237
|
-
}), m("chat"));
|
|
2238
|
-
}, [b, k, t, l, h]);
|
|
2239
|
-
const [H, te] = a.useState(!0), [re, he] = a.useState(!1);
|
|
2240
|
-
a.useEffect(() => {
|
|
2241
|
-
if (!H || !(!_ && b.length > 0 && !!h && !k)) return;
|
|
2242
|
-
he(!0);
|
|
2243
|
-
const ie = setTimeout(() => te(!1), 280);
|
|
2244
|
-
return () => clearTimeout(ie);
|
|
2245
|
-
}, [_, b.length, h, k, H]);
|
|
2246
|
-
const ge = a.useCallback(() => {
|
|
2247
|
-
m("home"), S(null), N(!1);
|
|
2248
|
-
}, []), G = a.useCallback(
|
|
2249
|
-
(p) => {
|
|
2250
|
-
if (p === "conversation") {
|
|
2251
|
-
ge();
|
|
2252
|
-
return;
|
|
2253
|
-
}
|
|
2254
|
-
N(!1), S(p);
|
|
2255
|
-
},
|
|
2256
|
-
[ge]
|
|
2257
|
-
), ce = (p) => {
|
|
2258
|
-
v(p), m("home");
|
|
2259
|
-
}, R = (p) => {
|
|
2260
|
-
if (p === h) return;
|
|
2261
|
-
const W = b.find((ie) => ie.id === p);
|
|
2262
|
-
v(p), K({
|
|
2263
|
-
agentId: p,
|
|
2264
|
-
agentName: W == null ? void 0 : W.name,
|
|
2265
|
-
playbookParams: {},
|
|
2266
|
-
message: ""
|
|
2267
|
-
});
|
|
2268
|
-
}, fe = () => {
|
|
2269
|
-
h && (K({
|
|
2270
|
-
agentId: h,
|
|
2271
|
-
agentName: F,
|
|
2272
|
-
playbookParams: {},
|
|
2273
|
-
message: ""
|
|
2274
|
-
}), m("chat"));
|
|
2275
|
-
}, ve = (p) => {
|
|
2276
|
-
K({
|
|
2277
|
-
agentId: h,
|
|
2278
|
-
agentName: F,
|
|
2279
|
-
playbookId: p.playbookId,
|
|
2280
|
-
playbookParams: p.playbookParams,
|
|
2281
|
-
message: p.message,
|
|
2282
|
-
attachments: p.attachments
|
|
2283
|
-
}), m("chat");
|
|
2284
|
-
};
|
|
2285
|
-
return w === "chat" && T ? /* @__PURE__ */ e.jsxs("div", { className: "wandox-console-chat-shell", children: [
|
|
2286
|
-
/* @__PURE__ */ e.jsx(
|
|
2287
|
-
wn,
|
|
2288
|
-
{
|
|
2289
|
-
agentId: T.agentId,
|
|
2290
|
-
agentName: T.agentName,
|
|
2291
|
-
playbookId: T.playbookId,
|
|
2292
|
-
playbookParams: T.playbookParams,
|
|
2293
|
-
initialMessage: T.message,
|
|
2294
|
-
initialAttachments: T.attachments,
|
|
2295
|
-
useMapCards: de,
|
|
2296
|
-
useMapCategories: ee,
|
|
2297
|
-
playbooks: ne,
|
|
2298
|
-
userPlaybooks: V,
|
|
2299
|
-
agents: b,
|
|
2300
|
-
onReady: (p) => {
|
|
2301
|
-
g.current = p, f && (p.showInspectionResults(f.robotName), M(null));
|
|
2302
|
-
},
|
|
2303
|
-
onChangeAgent: R,
|
|
2304
|
-
onBack: () => {
|
|
2305
|
-
g.current = null, m("home");
|
|
2306
|
-
},
|
|
2307
|
-
onSelectScene: () => {
|
|
2308
|
-
}
|
|
2309
|
-
},
|
|
2310
|
-
`${T.agentId}:${T.playbookId || "free-chat"}`
|
|
2311
|
-
),
|
|
2312
|
-
H && /* @__PURE__ */ e.jsx(Cs, { fading: re })
|
|
2313
|
-
] }) : /* @__PURE__ */ e.jsxs(
|
|
2314
|
-
"div",
|
|
2315
|
-
{
|
|
2316
|
-
className: `wandox-console${Z ? " wandox-console--secondary" : ""}`,
|
|
2317
|
-
children: [
|
|
2318
|
-
H && /* @__PURE__ */ e.jsx(Cs, { fading: re }),
|
|
2319
|
-
!Z && /* @__PURE__ */ e.jsx(
|
|
2320
|
-
Nn,
|
|
2321
|
-
{
|
|
2322
|
-
features: vn,
|
|
2323
|
-
activeId: u ?? "conversation",
|
|
2324
|
-
onOpenFeature: G
|
|
2325
|
-
}
|
|
2326
|
-
),
|
|
2327
|
-
/* @__PURE__ */ e.jsxs("main", { className: "wandox-console-main", children: [
|
|
2328
|
-
u === "automation" && /* @__PURE__ */ e.jsx(
|
|
2329
|
-
Ss,
|
|
2330
|
-
{
|
|
2331
|
-
title: "自动化",
|
|
2332
|
-
onBack: () => S(null),
|
|
2333
|
-
hideHeader: !0,
|
|
2334
|
-
className: "wandox-console-featureview--automation",
|
|
2335
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2336
|
-
Ha,
|
|
2337
|
-
{
|
|
2338
|
-
onCockpitEnter: () => N(!0),
|
|
2339
|
-
onCockpitExit: () => N(!1),
|
|
2340
|
-
onInboxEnter: () => N(!0)
|
|
2341
|
-
}
|
|
2342
|
-
)
|
|
2343
|
-
}
|
|
2344
|
-
),
|
|
2345
|
-
u === "notification" && /* @__PURE__ */ e.jsx(
|
|
2346
|
-
Ss,
|
|
2347
|
-
{
|
|
2348
|
-
title: "通知配置",
|
|
2349
|
-
onBack: () => S(null),
|
|
2350
|
-
hideHeader: !0,
|
|
2351
|
-
children: /* @__PURE__ */ e.jsx(Ga, {})
|
|
2352
|
-
}
|
|
2353
|
-
),
|
|
2354
|
-
!u && /* @__PURE__ */ e.jsx(
|
|
2355
|
-
kn,
|
|
2356
|
-
{
|
|
2357
|
-
useMapCards: de,
|
|
2358
|
-
useMapCategories: I,
|
|
2359
|
-
playbooks: ne,
|
|
2360
|
-
selectedCategoryKey: se,
|
|
2361
|
-
onCategorySelect: z,
|
|
2362
|
-
loading: k,
|
|
2363
|
-
useMapError: J,
|
|
2364
|
-
onRetry: q,
|
|
2365
|
-
onStartAnalysis: ve,
|
|
2366
|
-
agents: b,
|
|
2367
|
-
selectedAgentId: h,
|
|
2368
|
-
onAgentSelect: ce,
|
|
2369
|
-
onOpenAgentChat: fe
|
|
2370
|
-
}
|
|
2371
|
-
)
|
|
2372
|
-
] })
|
|
2373
|
-
]
|
|
2374
|
-
}
|
|
2375
|
-
);
|
|
2376
|
-
}
|
|
2377
|
-
export {
|
|
2378
|
-
En as default
|
|
2379
|
-
};
|