@blueking/ai-blueking 2.2.2-beta.4 → 2.2.2-beta.5
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/components/chat-bot.vue.d.ts.map +1 -1
- package/dist/components/composables/use-chatbot-init.d.ts +0 -1
- package/dist/components/composables/use-chatbot-init.d.ts.map +1 -1
- package/dist/components/composables/use-interrupt-resume.d.ts.map +1 -1
- package/dist/components/composables/use-tool-actions.d.ts +0 -1
- package/dist/components/composables/use-tool-actions.d.ts.map +1 -1
- package/dist/composables/use-ai-blueking-init.d.ts.map +1 -1
- package/dist/standalone/index.es.min.js +245 -231
- package/dist/standalone/index.iife.min.js +5 -5
- package/dist/standalone/index.umd.min.js +5 -5
- package/dist/vue2/index.es.min.js +245 -231
- package/dist/vue2/index.iife.min.js +4 -4
- package/dist/vue2/index.umd.min.js +4 -4
- package/dist/vue3/index.es.min.js +304 -308
- package/dist/vue3/index.iife.min.js +5 -5
- package/dist/vue3/index.umd.min.js +3 -3
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Fragment as e, Teleport as t, computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, createSlots as s, createTextVNode as c, createVNode as l, defineComponent as u, guardReactiveProps as d, h as f, isRef as p, mergeDefaults as m, nextTick as h, normalizeClass as g, normalizeProps as _, normalizeStyle as v, onBeforeUnmount as y, onMounted as b, onUnmounted as x, openBlock as S, reactive as C, ref as w, render as T, renderList as E, renderSlot as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useAttrs as M, useCssVars as N, useSlots as P, useTemplateRef as F, vShow as I, watch as L, withCtx as R, withDirectives as z, withModifiers as B } from "vue";
|
|
2
|
-
import { AiSelection as ee, ChatContainer as V, InterruptReason as
|
|
3
|
-
import { Exception as
|
|
4
|
-
import { Tippy as
|
|
5
|
-
import
|
|
2
|
+
import { AiSelection as ee, ChatContainer as V, InterruptReason as H, InterruptResumeOperation as U, MessageContentType as W, MessageRender as te, MessageRole as ne, MessageStatus as G, MessageToolsStatus as re, RenderMode as ie, RenderMode as ae } from "@blueking/chat-x";
|
|
3
|
+
import { Exception as oe, Input as se, Loading as ce, Message as le, OverflowTitle as ue, PopConfirm as de, bkTooltips as fe } from "bkui-vue";
|
|
4
|
+
import { Tippy as pe, directive as me } from "vue-tippy";
|
|
5
|
+
import he from "tippy.js";
|
|
6
6
|
import { Search as ge } from "bkui-vue/lib/icon";
|
|
7
7
|
import "tippy.js/dist/tippy.css";
|
|
8
8
|
import _e from "vue-draggable-resizable";
|
|
@@ -2253,7 +2253,7 @@ function Ht(e) {
|
|
|
2253
2253
|
offset: [0, 8],
|
|
2254
2254
|
appendTo: document.querySelector(".ai-blueking-container-wrapper") || document.body
|
|
2255
2255
|
};
|
|
2256
|
-
a.value =
|
|
2256
|
+
a.value = he(t.value, {
|
|
2257
2257
|
content: s(),
|
|
2258
2258
|
interactive: !0,
|
|
2259
2259
|
trigger: "manual",
|
|
@@ -2328,7 +2328,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2328
2328
|
"rename-confirm"
|
|
2329
2329
|
],
|
|
2330
2330
|
setup(t, { emit: n }) {
|
|
2331
|
-
let i = t, s = n, u =
|
|
2331
|
+
let i = t, s = n, u = fe, d = w(null), f = w("");
|
|
2332
2332
|
L(() => i.isEditing, (e) => {
|
|
2333
2333
|
e && (f.value = i.session.sessionName, h(() => {
|
|
2334
2334
|
if (d.value) try {
|
|
@@ -2358,7 +2358,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2358
2358
|
return (t, n) => (S(), a("div", {
|
|
2359
2359
|
class: g(["history-item", { active: i.isActive }]),
|
|
2360
2360
|
onClick: p
|
|
2361
|
-
}, [i.isEditing ? (S(), r(j(
|
|
2361
|
+
}, [i.isEditing ? (S(), r(j(se), {
|
|
2362
2362
|
key: 1,
|
|
2363
2363
|
ref_key: "editInputRef",
|
|
2364
2364
|
ref: d,
|
|
@@ -2371,7 +2371,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2371
2371
|
onBlur: v,
|
|
2372
2372
|
onKeyup: b,
|
|
2373
2373
|
onClick: n[2] ||= B(() => {}, ["stop"])
|
|
2374
|
-
}, null, 8, ["modelValue"])) : (S(), a(e, { key: 0 }, [l(j(
|
|
2374
|
+
}, null, 8, ["modelValue"])) : (S(), a(e, { key: 0 }, [l(j(ue), { style: { width: "calc(100% - 42px)" } }, {
|
|
2375
2375
|
default: R(() => [c(k(i.session.sessionName), 1)]),
|
|
2376
2376
|
_: 1
|
|
2377
2377
|
}), o("span", Yt, [z(o("i", {
|
|
@@ -2380,7 +2380,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2380
2380
|
}, null, 512), [[j(u), {
|
|
2381
2381
|
content: j($)("编辑"),
|
|
2382
2382
|
boundary: "parent"
|
|
2383
|
-
}]]), l(j(
|
|
2383
|
+
}]]), l(j(de), {
|
|
2384
2384
|
title: j($)("确认删除会话 ?"),
|
|
2385
2385
|
content: "删除操作无法撤回,请谨慎操作!",
|
|
2386
2386
|
"confirm-config": { theme: "danger" },
|
|
@@ -2409,7 +2409,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2409
2409
|
let n = e, r = t, i = (e) => {
|
|
2410
2410
|
r("update:modelValue", e);
|
|
2411
2411
|
};
|
|
2412
|
-
return (e, t) => (S(), a("div", Zt, [l(j(
|
|
2412
|
+
return (e, t) => (S(), a("div", Zt, [l(j(se), {
|
|
2413
2413
|
"model-value": n.modelValue,
|
|
2414
2414
|
behavior: "simplicity",
|
|
2415
2415
|
placeholder: n.placeholder || j($)("搜索会话名称"),
|
|
@@ -2534,7 +2534,7 @@ var Ut = { class: "history-group" }, Wt = { class: "history-group-title" }, Gt =
|
|
|
2534
2534
|
key: e,
|
|
2535
2535
|
class: "history-dropdown-loading-dot",
|
|
2536
2536
|
style: v({ "--dot-index": e - 1 })
|
|
2537
|
-
}, null, 4)), 64))])])) : i("v-if", !0)], 64)) : (S(), r(j(
|
|
2537
|
+
}, null, 4)), 64))])])) : i("v-if", !0)], 64)) : (S(), r(j(oe), {
|
|
2538
2538
|
key: 1,
|
|
2539
2539
|
description: d.value ? j($)("搜索为空") : j($)("暂无对话"),
|
|
2540
2540
|
scene: "part",
|
|
@@ -2632,7 +2632,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2632
2632
|
}) },
|
|
2633
2633
|
sessionBusinessManager: { default: void 0 },
|
|
2634
2634
|
selectedLlmCode: { default: void 0 },
|
|
2635
|
-
renderMode: { default:
|
|
2635
|
+
renderMode: { default: ae.Chat }
|
|
2636
2636
|
},
|
|
2637
2637
|
emits: [
|
|
2638
2638
|
"close",
|
|
@@ -2649,7 +2649,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2649
2649
|
"new-chat-created"
|
|
2650
2650
|
],
|
|
2651
2651
|
setup(e, { expose: t, emit: s }) {
|
|
2652
|
-
let u = e, d = s, f =
|
|
2652
|
+
let u = e, d = s, f = fe, p = w(null), m = w(null), h = F("moreMenuTippyRef"), _ = w(!1), x = w(""), C = w(null), T = w(!1), E = () => document.querySelector(".ai-blueking-panel") || document.body, O = null, A = () => {
|
|
2653
2653
|
!m.value || !u.sessionBusinessManager || (O = cn({
|
|
2654
2654
|
triggerRef: m,
|
|
2655
2655
|
sessionBusinessManager: u.sessionBusinessManager,
|
|
@@ -2657,7 +2657,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2657
2657
|
onSessionDelete: (e) => d("history-session-delete", e),
|
|
2658
2658
|
onSessionRename: (e, t) => d("history-session-rename", e, t)
|
|
2659
2659
|
}));
|
|
2660
|
-
}, M = n(() => u.hasPermission ? u.enableChatSession ? u.title || `${u.agentName || ""}-${u.sessionName || ""}` : u.agentName : $("无智能体使用权限")), N = n(() => u.isCompressionHeight ? "bkai-morenchicun" : "bkai-yasuo"), P = n(() => u.isCompressionHeight ? $("恢复默认尺寸") : $("缩小高度")), I = n(() => u.hasPermission), B = (e) => I.value ? e : $("暂无使用权限"), ee = () => ({ cursor: I.value ? "pointer" : "not-allowed" }), V = w(!1),
|
|
2660
|
+
}, M = n(() => u.hasPermission ? u.enableChatSession ? u.title || `${u.agentName || ""}-${u.sessionName || ""}` : u.agentName : $("无智能体使用权限")), N = n(() => u.isCompressionHeight ? "bkai-morenchicun" : "bkai-yasuo"), P = n(() => u.isCompressionHeight ? $("恢复默认尺寸") : $("缩小高度")), I = n(() => u.hasPermission), B = (e) => I.value ? e : $("暂无使用权限"), ee = () => ({ cursor: I.value ? "pointer" : "not-allowed" }), V = w(!1), H = async () => {
|
|
2661
2661
|
if (!V.value) {
|
|
2662
2662
|
V.value = !0;
|
|
2663
2663
|
try {
|
|
@@ -2669,7 +2669,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2669
2669
|
createdAt: e.createdAt
|
|
2670
2670
|
});
|
|
2671
2671
|
} catch (e) {
|
|
2672
|
-
console.error("Failed to create new session:", e),
|
|
2672
|
+
console.error("Failed to create new session:", e), le({
|
|
2673
2673
|
theme: "error",
|
|
2674
2674
|
message: $("创建会话失败")
|
|
2675
2675
|
});
|
|
@@ -2679,21 +2679,21 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2679
2679
|
V.value = !1;
|
|
2680
2680
|
}
|
|
2681
2681
|
}
|
|
2682
|
-
},
|
|
2682
|
+
}, U = (e) => {
|
|
2683
2683
|
e.stopPropagation(), u.sessionBusinessManager ? (O || A(), O && O.handleTriggerClick(e)) : d("history-click", e);
|
|
2684
|
-
},
|
|
2684
|
+
}, W = () => {
|
|
2685
2685
|
d("help-click");
|
|
2686
|
-
},
|
|
2686
|
+
}, te = (e) => {
|
|
2687
2687
|
e.stopPropagation(), O && O.isVisible() && O.hide(), h.value && (T.value ? h.value.hide() : h.value.show());
|
|
2688
|
-
},
|
|
2689
|
-
h.value?.hide(),
|
|
2690
|
-
},
|
|
2688
|
+
}, ne = () => {
|
|
2689
|
+
h.value?.hide(), ie();
|
|
2690
|
+
}, G = () => {
|
|
2691
2691
|
!u.hasSessionContents || u.autoGenerateLoading || d("auto-generate-name");
|
|
2692
|
-
},
|
|
2692
|
+
}, re = () => {
|
|
2693
2693
|
u.hasSessionContents && (h.value?.hide(), d("share"));
|
|
2694
|
-
},
|
|
2695
|
-
document.removeEventListener("click",
|
|
2696
|
-
document.addEventListener("click",
|
|
2694
|
+
}, ie = () => {
|
|
2695
|
+
document.removeEventListener("click", he), x.value = u.sessionName || "", _.value = !0, setTimeout(() => {
|
|
2696
|
+
document.addEventListener("click", he);
|
|
2697
2697
|
}, 100), setTimeout(() => {
|
|
2698
2698
|
if (C.value) try {
|
|
2699
2699
|
let e = C.value;
|
|
@@ -2704,28 +2704,28 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2704
2704
|
console.warn("Failed to focus rename input:", e);
|
|
2705
2705
|
}
|
|
2706
2706
|
}, 100);
|
|
2707
|
-
},
|
|
2707
|
+
}, oe = () => {
|
|
2708
2708
|
let e = x.value.trim();
|
|
2709
2709
|
if (!e) {
|
|
2710
|
-
|
|
2710
|
+
ue();
|
|
2711
2711
|
return;
|
|
2712
2712
|
}
|
|
2713
2713
|
d("rename", e), _.value = !1, x.value = "";
|
|
2714
|
-
},
|
|
2714
|
+
}, ue = () => {
|
|
2715
2715
|
_.value = !1, x.value = "";
|
|
2716
|
-
},
|
|
2717
|
-
x.value = e, t.key === "Enter" ?
|
|
2718
|
-
},
|
|
2716
|
+
}, de = (e, t) => {
|
|
2717
|
+
x.value = e, t.key === "Enter" ? oe() : t.key === "Escape" && ue();
|
|
2718
|
+
}, he = (e) => {
|
|
2719
2719
|
if (!_.value) return;
|
|
2720
2720
|
let t = e.target, n = document.querySelector(".rename-tooltip");
|
|
2721
|
-
n && !n.contains(t) &&
|
|
2721
|
+
n && !n.contains(t) && ue();
|
|
2722
2722
|
};
|
|
2723
2723
|
return L(() => u.autoGenerateLoading, (e, t) => {
|
|
2724
2724
|
t && !e && T.value && h.value?.hide();
|
|
2725
2725
|
}), b(() => {
|
|
2726
|
-
u.sessionBusinessManager && A(), document.addEventListener("click",
|
|
2726
|
+
u.sessionBusinessManager && A(), document.addEventListener("click", he);
|
|
2727
2727
|
}), y(() => {
|
|
2728
|
-
O &&= (O.destroy(), null), document.removeEventListener("click",
|
|
2728
|
+
O &&= (O.destroy(), null), document.removeEventListener("click", he);
|
|
2729
2729
|
}), t({
|
|
2730
2730
|
headerRef: p,
|
|
2731
2731
|
historyIconRef: m
|
|
@@ -2742,24 +2742,24 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2742
2742
|
o("div", { class: g(["title", { "title-with-tooltip": _.value }]) }, [
|
|
2743
2743
|
c(k(M.value) + " ", 1),
|
|
2744
2744
|
i(" 重命名 tooltip 直接绑定在 title 上 "),
|
|
2745
|
-
_.value ? (S(), a("div", fn, [o("div", pn, [l(j(
|
|
2745
|
+
_.value ? (S(), a("div", fn, [o("div", pn, [l(j(se), {
|
|
2746
2746
|
ref_key: "renameInputRef",
|
|
2747
2747
|
ref: C,
|
|
2748
2748
|
modelValue: x.value,
|
|
2749
2749
|
"onUpdate:modelValue": n[0] ||= (e) => x.value = e,
|
|
2750
2750
|
class: "rename-input",
|
|
2751
2751
|
placeholder: j($)("请输入新的会话名称"),
|
|
2752
|
-
onKeyup:
|
|
2752
|
+
onKeyup: de
|
|
2753
2753
|
}, null, 8, ["modelValue", "placeholder"]), o("div", { class: "rename-buttons" }, [o("i", {
|
|
2754
2754
|
class: "bkai-icon bkai-check-1 rename-btn confirm-btn",
|
|
2755
|
-
onClick:
|
|
2755
|
+
onClick: oe
|
|
2756
2756
|
}), o("i", {
|
|
2757
2757
|
class: "bkai-icon bkai-close rename-btn cancel-btn",
|
|
2758
|
-
onClick:
|
|
2758
|
+
onClick: ue
|
|
2759
2759
|
})])])])) : i("v-if", !0)
|
|
2760
2760
|
], 2),
|
|
2761
2761
|
i(" 更多图标下拉菜单 - 使用 vue-tippy "),
|
|
2762
|
-
u.showMoreIcon && I.value ? (S(), r(j(
|
|
2762
|
+
u.showMoreIcon && I.value ? (S(), r(j(pe), {
|
|
2763
2763
|
key: 0,
|
|
2764
2764
|
ref_key: "moreMenuTippyRef",
|
|
2765
2765
|
ref: h,
|
|
@@ -2777,29 +2777,29 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2777
2777
|
u.dropdownMenuConfig?.showRename ? (S(), a("div", {
|
|
2778
2778
|
key: 0,
|
|
2779
2779
|
class: "tippy-menu-item",
|
|
2780
|
-
onClick:
|
|
2780
|
+
onClick: ne
|
|
2781
2781
|
}, [n[7] ||= o("i", { class: "bkai-icon bkai-bianji" }, null, -1), o("span", null, k(j($)("重命名")), 1)])) : i("v-if", !0),
|
|
2782
2782
|
u.dropdownMenuConfig?.showAutoGenerate ? z((S(), a("div", {
|
|
2783
2783
|
key: 1,
|
|
2784
2784
|
class: g(["tippy-menu-item", { disabled: !u.hasSessionContents || u.autoGenerateLoading }]),
|
|
2785
|
-
onClick:
|
|
2786
|
-
}, [u.autoGenerateLoading ? (S(), r(j(
|
|
2785
|
+
onClick: G
|
|
2786
|
+
}, [u.autoGenerateLoading ? (S(), r(j(ce), {
|
|
2787
2787
|
key: 0,
|
|
2788
2788
|
mode: "spin",
|
|
2789
2789
|
size: "mini",
|
|
2790
2790
|
theme: "primary"
|
|
2791
|
-
})) : (S(), a("i", hn)), o("span", null, k(j($)("自动生成命名")), 1)], 2)), [[j(
|
|
2791
|
+
})) : (S(), a("i", hn)), o("span", null, k(j($)("自动生成命名")), 1)], 2)), [[j(me), {
|
|
2792
2792
|
content: u.hasSessionContents ? "" : j($)("请先发起会话"),
|
|
2793
2793
|
theme: "ai-blueking-tooltip",
|
|
2794
2794
|
arrow: !0,
|
|
2795
2795
|
delay: [300, 0],
|
|
2796
2796
|
appendTo: E
|
|
2797
2797
|
}]]) : i("v-if", !0),
|
|
2798
|
-
u.dropdownMenuConfig?.showShare && u.renderMode !== j(
|
|
2798
|
+
u.dropdownMenuConfig?.showShare && u.renderMode !== j(ae).Test ? z((S(), a("div", {
|
|
2799
2799
|
key: 2,
|
|
2800
2800
|
class: g(["tippy-menu-item", { disabled: !u.hasSessionContents }]),
|
|
2801
|
-
onClick:
|
|
2802
|
-
}, [n[8] ||= o("i", { class: "bkai-icon bkai-fenxiang" }, null, -1), o("span", null, k(j($)("分享会话")), 1)], 2)), [[j(
|
|
2801
|
+
onClick: re
|
|
2802
|
+
}, [n[8] ||= o("i", { class: "bkai-icon bkai-fenxiang" }, null, -1), o("span", null, k(j($)("分享会话")), 1)], 2)), [[j(me), {
|
|
2803
2803
|
content: u.hasSessionContents ? "" : j($)("请先发起会话"),
|
|
2804
2804
|
theme: "ai-blueking-tooltip",
|
|
2805
2805
|
arrow: !0,
|
|
@@ -2809,7 +2809,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2809
2809
|
])) : i("v-if", !0)]),
|
|
2810
2810
|
default: R(() => [o("span", {
|
|
2811
2811
|
class: "bkai-icon bkai-more",
|
|
2812
|
-
onClick:
|
|
2812
|
+
onClick: te
|
|
2813
2813
|
})]),
|
|
2814
2814
|
_: 1
|
|
2815
2815
|
}, 512)) : i("v-if", !0)
|
|
@@ -2825,7 +2825,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2825
2825
|
{ disabled: !I.value || V.value || !e.hasSessionContents }
|
|
2826
2826
|
]),
|
|
2827
2827
|
style: v(ee()),
|
|
2828
|
-
onClick: n[3] ||= (t) => I.value && !V.value && e.hasSessionContents ?
|
|
2828
|
+
onClick: n[3] ||= (t) => I.value && !V.value && e.hasSessionContents ? H() : void 0
|
|
2829
2829
|
}, null, 6)), [[j(f), {
|
|
2830
2830
|
content: V.value ? j($)("正在创建会话...") : e.hasSessionContents ? B(j($)("新增会话")) : j($)("当前已是新会话"),
|
|
2831
2831
|
boundary: "parent"
|
|
@@ -2841,7 +2841,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2841
2841
|
{ disabled: !I.value }
|
|
2842
2842
|
]),
|
|
2843
2843
|
style: v(ee()),
|
|
2844
|
-
onClick: n[4] ||= (e) => I.value ?
|
|
2844
|
+
onClick: n[4] ||= (e) => I.value ? U(e) : void 0
|
|
2845
2845
|
}, null, 6)), [[j(f), {
|
|
2846
2846
|
content: B(j($)("历史会话")),
|
|
2847
2847
|
boundary: "parent"
|
|
@@ -2849,7 +2849,7 @@ var ln = { class: "left-section" }, un = { class: "logo" }, dn = ["src"], fn = {
|
|
|
2849
2849
|
e.chatGroup?.enabled ? z((S(), a("i", {
|
|
2850
2850
|
key: 2,
|
|
2851
2851
|
class: "bkai-icon bkai-zhushou",
|
|
2852
|
-
onClick:
|
|
2852
|
+
onClick: W
|
|
2853
2853
|
}, null, 512)), [[j(f), {
|
|
2854
2854
|
content: j($)("转人工"),
|
|
2855
2855
|
boundary: "parent"
|
|
@@ -3793,15 +3793,15 @@ var On = class {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
};
|
|
3795
3795
|
function An(e) {
|
|
3796
|
-
let { props: t, emit: r,
|
|
3796
|
+
let { props: t, emit: r, reportError: i, managerErrorBridge: a } = e, o = O(null), s = O(null), c = O(null), l = O(null), u = w(!1), d = w(!t.chatHelper), f = w(null), p = n(() => u.value), m = () => t.chatHelper ? !t.chatHelper.agent || !t.chatHelper.session || !t.chatHelper.message ? {
|
|
3797
3797
|
valid: !1,
|
|
3798
3798
|
error: "[ChatBot] Invalid chatHelper: missing required modules (agent, session, message)"
|
|
3799
3799
|
} : { valid: !0 } : t.url ? { valid: !0 } : {
|
|
3800
3800
|
valid: !1,
|
|
3801
3801
|
error: "[ChatBot] Neither chatHelper nor url provided. Component requires at least one."
|
|
3802
|
-
},
|
|
3803
|
-
let e =
|
|
3804
|
-
if (!e.valid) return console.error(e.error),
|
|
3802
|
+
}, h = () => {
|
|
3803
|
+
let e = m();
|
|
3804
|
+
if (!e.valid) return console.error(e.error), f.value = Error(e.error), null;
|
|
3805
3805
|
if (t.chatHelper) return t.chatHelper;
|
|
3806
3806
|
let n = new Z({
|
|
3807
3807
|
onStart: () => {
|
|
@@ -3811,82 +3811,82 @@ function An(e) {
|
|
|
3811
3811
|
r("receive-text");
|
|
3812
3812
|
},
|
|
3813
3813
|
onDone: () => {
|
|
3814
|
-
r("receive-end")
|
|
3814
|
+
r("receive-end");
|
|
3815
3815
|
},
|
|
3816
3816
|
onError: (e) => {
|
|
3817
|
-
|
|
3817
|
+
i(e, "Stream error");
|
|
3818
3818
|
}
|
|
3819
|
-
}),
|
|
3819
|
+
}), a = bt({
|
|
3820
3820
|
requestData: St(Nt(t.url), () => A(t.requestOptions)),
|
|
3821
3821
|
protocol: n
|
|
3822
3822
|
});
|
|
3823
|
-
return n.injectMessageModule(
|
|
3824
|
-
},
|
|
3823
|
+
return n.injectMessageModule(a.message), a;
|
|
3824
|
+
}, g = async (e, t) => {
|
|
3825
3825
|
if (e) try {
|
|
3826
3826
|
let n = e.session.current?.value?.sessionCode ?? "";
|
|
3827
3827
|
await e.agent.stopChat(n), t && e.agent.abortChat();
|
|
3828
3828
|
} catch {}
|
|
3829
|
-
},
|
|
3830
|
-
|
|
3831
|
-
},
|
|
3832
|
-
if (e !==
|
|
3833
|
-
},
|
|
3834
|
-
let n =
|
|
3835
|
-
|
|
3836
|
-
let m =
|
|
3837
|
-
if (!m) throw
|
|
3838
|
-
let
|
|
3829
|
+
}, _ = 0, v = null, b = null, x = null, S = (e) => {
|
|
3830
|
+
x &&= (e ? x.reject(e) : x.resolve(), null), v = null;
|
|
3831
|
+
}, C = (e) => {
|
|
3832
|
+
if (e !== _) throw new kn();
|
|
3833
|
+
}, T = async (e) => {
|
|
3834
|
+
let n = o.value, p = d.value;
|
|
3835
|
+
u.value = !1, f.value = null, d.value = !t.chatHelper, await g(n, p), C(e), o.value = null, s.value = null, c.value = null, l.value = null;
|
|
3836
|
+
let m = h();
|
|
3837
|
+
if (!m) throw f.value ?? /* @__PURE__ */ Error("[ChatBot] Failed to create chatHelper");
|
|
3838
|
+
let _ = new xn(m.session, m.agent, a, {
|
|
3839
3839
|
enableChatSession: !0,
|
|
3840
3840
|
autoSwitchToInitialSession: !!t.sessionCode,
|
|
3841
3841
|
loadRecentSessionOnMount: t.autoLoad,
|
|
3842
3842
|
initialSessionCode: t.sessionCode,
|
|
3843
3843
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
3844
|
-
}, m.message), v = new bn(m.agent, m.message, m.session,
|
|
3844
|
+
}, m.message), v = new bn(m.agent, m.message, m.session, a, {
|
|
3845
3845
|
openingRemark: t.helloText,
|
|
3846
3846
|
predefinedQuestions: t.prompts,
|
|
3847
3847
|
placeholder: t.placeholder,
|
|
3848
3848
|
onSessionRenamed: (e) => r("rename", e)
|
|
3849
3849
|
}), y = new Cn(null, t.shortcuts || []);
|
|
3850
|
-
|
|
3850
|
+
o.value = m, s.value = _, c.value = v, l.value = y;
|
|
3851
3851
|
try {
|
|
3852
|
-
|
|
3852
|
+
d.value && (await yn(m, { enableModelSelect: t.enableModelSelect !== !1 && !t.models?.length }), C(e), await _.loadRecentSession({ skipLoadSessions: !0 }), C(e)), t.enableModelSelect !== !1 && (t.models?.length ? v.setModels(t.models) : await v.loadModels(), C(e)), C(e), u.value = !0, r("agent-info-loaded", m);
|
|
3853
3853
|
} catch (t) {
|
|
3854
|
-
throw
|
|
3854
|
+
throw C(e), f.value = i(t, "Failed to initialize ChatBot"), t;
|
|
3855
3855
|
}
|
|
3856
|
-
},
|
|
3857
|
-
|
|
3858
|
-
let e = ++
|
|
3859
|
-
|
|
3860
|
-
|
|
3856
|
+
}, E = () => {
|
|
3857
|
+
S(new kn()), b = null;
|
|
3858
|
+
let e = ++_;
|
|
3859
|
+
v = new Promise((t, n) => {
|
|
3860
|
+
x = {
|
|
3861
3861
|
resolve: t,
|
|
3862
3862
|
reject: n
|
|
3863
|
-
},
|
|
3864
|
-
|
|
3863
|
+
}, T(e).then(() => {
|
|
3864
|
+
x &&= (b = Promise.resolve(), x.resolve(), null);
|
|
3865
3865
|
}).catch((e) => {
|
|
3866
|
-
|
|
3866
|
+
x &&= (x.reject(At(e)), null);
|
|
3867
3867
|
}).finally(() => {
|
|
3868
|
-
e ===
|
|
3868
|
+
e === _ && (v = null);
|
|
3869
3869
|
});
|
|
3870
|
-
}),
|
|
3870
|
+
}), v.catch(() => {});
|
|
3871
3871
|
};
|
|
3872
|
-
return L([() => t.url, () => t.chatHelper], () =>
|
|
3873
|
-
|
|
3872
|
+
return L([() => t.url, () => t.chatHelper], () => E(), { immediate: !0 }), y(() => {
|
|
3873
|
+
S(), g(o.value, d.value);
|
|
3874
3874
|
}), {
|
|
3875
|
-
chatHelper:
|
|
3876
|
-
isStandaloneMode:
|
|
3877
|
-
isInitialized:
|
|
3878
|
-
isReady:
|
|
3879
|
-
initError:
|
|
3880
|
-
whenReady: () =>
|
|
3881
|
-
chatBusinessManager:
|
|
3882
|
-
sessionBusinessManager:
|
|
3883
|
-
shortcutManager:
|
|
3875
|
+
chatHelper: o,
|
|
3876
|
+
isStandaloneMode: d,
|
|
3877
|
+
isInitialized: u,
|
|
3878
|
+
isReady: p,
|
|
3879
|
+
initError: f,
|
|
3880
|
+
whenReady: () => u.value ? (b ||= Promise.resolve(), b) : f.value ? Promise.reject(f.value) : v || Promise.resolve(),
|
|
3881
|
+
chatBusinessManager: c,
|
|
3882
|
+
sessionBusinessManager: s,
|
|
3883
|
+
shortcutManager: l
|
|
3884
3884
|
};
|
|
3885
3885
|
}
|
|
3886
3886
|
//#endregion
|
|
3887
3887
|
//#region src/components/composables/use-chatbot-state.ts
|
|
3888
3888
|
function jn(e) {
|
|
3889
|
-
let { props: t, chatHelper: r, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = n(() => i.value?.isStopLoading.value ?
|
|
3889
|
+
let { props: t, chatHelper: r, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = n(() => i.value?.isStopLoading.value ? G.StopLoading : ((t.chatHelper || r.value)?.agent)?.isChatting?.value ? G.Streaming : G.Complete), d = n(() => u.value === G.Streaming ? re.Disabled : void 0), f = n(() => i.value?.messages.value ?? []), p = n(() => i.value?.isMessagesLoading.value ?? !1);
|
|
3890
3890
|
return {
|
|
3891
3891
|
messageStatus: u,
|
|
3892
3892
|
messageToolsStatus: d,
|
|
@@ -3934,15 +3934,15 @@ function Nn(e) {
|
|
|
3934
3934
|
//#endregion
|
|
3935
3935
|
//#region src/components/composables/use-interrupt-resume.ts
|
|
3936
3936
|
var Pn = {
|
|
3937
|
-
[
|
|
3938
|
-
[
|
|
3939
|
-
[
|
|
3937
|
+
[U.ApprovalCancel]: be.ApprovalCancel,
|
|
3938
|
+
[U.FlowNodeRetry]: be.FlowNodeRetry,
|
|
3939
|
+
[U.FlowNodeSkip]: be.FlowNodeSkip
|
|
3940
3940
|
};
|
|
3941
3941
|
function Fn(e) {
|
|
3942
3942
|
return "operation" in e;
|
|
3943
3943
|
}
|
|
3944
3944
|
function In(e) {
|
|
3945
|
-
return "interruptId" in e && "reason" in e && e.reason ===
|
|
3945
|
+
return "interruptId" in e && "reason" in e && e.reason === H.UserQuestion;
|
|
3946
3946
|
}
|
|
3947
3947
|
function Ln(e) {
|
|
3948
3948
|
return e === "cancelled" ? Ee.Cancelled : Ee.Resolved;
|
|
@@ -3965,18 +3965,18 @@ function Bn(e) {
|
|
|
3965
3965
|
if (!n) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
3966
3966
|
if (!Fn(e)) throw Error("[ChatBot] Unsupported interrupt resume payload");
|
|
3967
3967
|
let r = Rn(n);
|
|
3968
|
-
if (e.operation ===
|
|
3968
|
+
if (e.operation === U.ApprovalRefresh) {
|
|
3969
3969
|
n.agent.pollResumeSession(r);
|
|
3970
3970
|
return;
|
|
3971
3971
|
}
|
|
3972
3972
|
let i = Pn[e.operation];
|
|
3973
3973
|
if (!i) throw Error(`[ChatBot] Unsupported interrupt resume operation: ${e.operation}`);
|
|
3974
3974
|
let a = n.agent;
|
|
3975
|
-
if (e.operation ===
|
|
3975
|
+
if (e.operation === U.ApprovalCancel) {
|
|
3976
3976
|
await a.userOperationStreamRequest(r, i, { interrupt_id: e.payload.interrupt_id });
|
|
3977
3977
|
return;
|
|
3978
3978
|
}
|
|
3979
|
-
(e.operation ===
|
|
3979
|
+
(e.operation === U.FlowNodeRetry || e.operation === U.FlowNodeSkip) && await a.userOperationStreamRequest(r, i, {
|
|
3980
3980
|
node_id: e.payload.node_id,
|
|
3981
3981
|
task_id: String(e.payload.task_id)
|
|
3982
3982
|
});
|
|
@@ -4089,12 +4089,12 @@ var Hn = (e) => !e || e.id === "share";
|
|
|
4089
4089
|
function Un(e) {
|
|
4090
4090
|
let { emit: t, chatHelper: n, isStandaloneMode: r } = e, i = async (e) => {
|
|
4091
4091
|
if (!(!n.value || e.length === 0)) try {
|
|
4092
|
-
await Pt((await new Sn(n.value.message, n.value.session).shareMessages(e)).shareUrl),
|
|
4092
|
+
await Pt((await new Sn(n.value.message, n.value.session).shareMessages(e)).shareUrl), le({
|
|
4093
4093
|
message: "分享链接已复制到剪贴板",
|
|
4094
4094
|
theme: "success"
|
|
4095
4095
|
});
|
|
4096
4096
|
} catch (e) {
|
|
4097
|
-
console.error("[ChatBot] Failed to share messages:", e),
|
|
4097
|
+
console.error("[ChatBot] Failed to share messages:", e), le({
|
|
4098
4098
|
message: "分享失败,请重试",
|
|
4099
4099
|
theme: "error"
|
|
4100
4100
|
});
|
|
@@ -4201,7 +4201,7 @@ function Wn(e) {
|
|
|
4201
4201
|
//#endregion
|
|
4202
4202
|
//#region src/components/composables/use-tool-actions.ts
|
|
4203
4203
|
function Gn(e) {
|
|
4204
|
-
let { emit: t, chatHelper: n, chatBusinessManager: r, cite: i, focusInput: a,
|
|
4204
|
+
let { emit: t, chatHelper: n, chatBusinessManager: r, cite: i, focusInput: a, getShortcutFromMessage: o, buildShortcutProperty: s, getRequestOptions: c, reportError: l, stopGeneration: u } = e, d = async (e) => {
|
|
4205
4205
|
if (!r.value || !n.value) {
|
|
4206
4206
|
console.error("[ChatBot] Cannot delete messages: chatBusinessManager not initialized");
|
|
4207
4207
|
return;
|
|
@@ -4215,9 +4215,9 @@ function Gn(e) {
|
|
|
4215
4215
|
let a = [i, ...e];
|
|
4216
4216
|
await n.value.message.deleteMessages(a);
|
|
4217
4217
|
} catch (e) {
|
|
4218
|
-
|
|
4218
|
+
l(e, "Failed to delete messages");
|
|
4219
4219
|
}
|
|
4220
|
-
},
|
|
4220
|
+
}, f = async (e) => {
|
|
4221
4221
|
if (!r.value || !n.value) {
|
|
4222
4222
|
console.error("[ChatBot] Cannot regenerate: chatBusinessManager not initialized");
|
|
4223
4223
|
return;
|
|
@@ -4228,11 +4228,11 @@ function Gn(e) {
|
|
|
4228
4228
|
return;
|
|
4229
4229
|
}
|
|
4230
4230
|
try {
|
|
4231
|
-
await r.value.regenerateFromAIMessages(e, t)
|
|
4231
|
+
await r.value.regenerateFromAIMessages(e, t);
|
|
4232
4232
|
} catch (e) {
|
|
4233
|
-
|
|
4233
|
+
l(e, "Failed to regenerate");
|
|
4234
4234
|
}
|
|
4235
|
-
},
|
|
4235
|
+
}, p = async (e) => {
|
|
4236
4236
|
if (!r.value || !n.value) {
|
|
4237
4237
|
console.error("[ChatBot] Cannot delete message: chatHelper not initialized");
|
|
4238
4238
|
return;
|
|
@@ -4246,27 +4246,27 @@ function Gn(e) {
|
|
|
4246
4246
|
let a = [];
|
|
4247
4247
|
for (let e = i + 1; e < t.length; e++) {
|
|
4248
4248
|
let n = t[e];
|
|
4249
|
-
if (n.role ===
|
|
4249
|
+
if (n.role === ne.User) break;
|
|
4250
4250
|
a.push(n);
|
|
4251
4251
|
}
|
|
4252
4252
|
let o = [e, ...a];
|
|
4253
4253
|
await n.value.message.deleteMessages(o);
|
|
4254
4254
|
} catch (e) {
|
|
4255
|
-
|
|
4255
|
+
l(e, "Failed to delete user message");
|
|
4256
4256
|
}
|
|
4257
4257
|
};
|
|
4258
4258
|
return {
|
|
4259
4259
|
handleAgentAction: async (e, r) => {
|
|
4260
4260
|
if (e.id === "cite") {
|
|
4261
|
-
i.value = r.filter((e) => e.role !==
|
|
4261
|
+
i.value = r.filter((e) => e.role !== ne.Reasoning).map((e) => typeof e.content == "string" ? e.content : JSON.stringify(e.content || "")).join("\n"), a();
|
|
4262
4262
|
return;
|
|
4263
4263
|
}
|
|
4264
4264
|
if (e.id === "rebuild") {
|
|
4265
|
-
await
|
|
4265
|
+
await f(r);
|
|
4266
4266
|
return;
|
|
4267
4267
|
}
|
|
4268
4268
|
if (e.id === "delete") {
|
|
4269
|
-
await
|
|
4269
|
+
await d(r);
|
|
4270
4270
|
return;
|
|
4271
4271
|
}
|
|
4272
4272
|
if (e.id === "like" || e.id === "unlike") {
|
|
@@ -4294,22 +4294,22 @@ function Gn(e) {
|
|
|
4294
4294
|
console.error("[ChatBot] Cannot submit feedback: no user message found");
|
|
4295
4295
|
return;
|
|
4296
4296
|
}
|
|
4297
|
-
let
|
|
4297
|
+
let u = e.id === "like" ? 5 : 0;
|
|
4298
4298
|
try {
|
|
4299
4299
|
await n.value.session.postSessionFeedback({
|
|
4300
4300
|
sessionCode: s,
|
|
4301
4301
|
sessionContentIds: [c],
|
|
4302
|
-
rate:
|
|
4302
|
+
rate: u,
|
|
4303
4303
|
labels: a,
|
|
4304
4304
|
comment: o
|
|
4305
4305
|
}), t("feedback", e, i[0], a, o);
|
|
4306
4306
|
} catch (e) {
|
|
4307
|
-
|
|
4307
|
+
l(e, "Failed to submit feedback");
|
|
4308
4308
|
}
|
|
4309
4309
|
},
|
|
4310
4310
|
handleUserAction: async (e, t) => {
|
|
4311
4311
|
if (e.id === "delete") {
|
|
4312
|
-
await
|
|
4312
|
+
await p(t);
|
|
4313
4313
|
return;
|
|
4314
4314
|
}
|
|
4315
4315
|
if (e.id === "cite") {
|
|
@@ -4328,16 +4328,16 @@ function Gn(e) {
|
|
|
4328
4328
|
console.error("[ChatBot] Cannot edit message: no active session");
|
|
4329
4329
|
return;
|
|
4330
4330
|
}
|
|
4331
|
-
let
|
|
4332
|
-
if (
|
|
4331
|
+
let o = e.id;
|
|
4332
|
+
if (o === void 0) {
|
|
4333
4333
|
console.error("[ChatBot] Cannot edit message: message has no id");
|
|
4334
4334
|
return;
|
|
4335
4335
|
}
|
|
4336
4336
|
try {
|
|
4337
|
-
let n = e.property, i = wt(n,
|
|
4338
|
-
await r.value?.resendMessageWithProperty(String(
|
|
4337
|
+
let n = e.property, i = wt(n, c);
|
|
4338
|
+
await r.value?.resendMessageWithProperty(String(o), a, typeof t == "string" ? t : "", i);
|
|
4339
4339
|
} catch (e) {
|
|
4340
|
-
|
|
4340
|
+
l(e, "Failed to edit and resend message");
|
|
4341
4341
|
}
|
|
4342
4342
|
},
|
|
4343
4343
|
handleUserShortcutConfirm: async (e, t) => {
|
|
@@ -4356,18 +4356,18 @@ function Gn(e) {
|
|
|
4356
4356
|
return;
|
|
4357
4357
|
}
|
|
4358
4358
|
try {
|
|
4359
|
-
let n =
|
|
4359
|
+
let n = o(e);
|
|
4360
4360
|
if (!n) {
|
|
4361
4361
|
console.error("[ChatBot] Cannot edit shortcut message: shortcut not found");
|
|
4362
4362
|
return;
|
|
4363
4363
|
}
|
|
4364
|
-
let
|
|
4365
|
-
await r.value.resendMessageWithProperty(String(a), i,
|
|
4364
|
+
let l = wt(s(n, t), c), u = String(t.input ?? "");
|
|
4365
|
+
await r.value.resendMessageWithProperty(String(a), i, u, l);
|
|
4366
4366
|
} catch (e) {
|
|
4367
|
-
|
|
4367
|
+
l(e, "Failed to edit shortcut message");
|
|
4368
4368
|
}
|
|
4369
4369
|
},
|
|
4370
|
-
handleStopStreaming:
|
|
4370
|
+
handleStopStreaming: u
|
|
4371
4371
|
};
|
|
4372
4372
|
}
|
|
4373
4373
|
//#endregion
|
|
@@ -4391,7 +4391,7 @@ var Kn = /* @__PURE__ */ u({
|
|
|
4391
4391
|
},
|
|
4392
4392
|
models: { default: void 0 },
|
|
4393
4393
|
executionTabVisible: { type: Boolean },
|
|
4394
|
-
renderMode: { default:
|
|
4394
|
+
renderMode: { default: ae.Chat },
|
|
4395
4395
|
extCls: {},
|
|
4396
4396
|
height: {},
|
|
4397
4397
|
helloText: {},
|
|
@@ -4447,207 +4447,203 @@ var Kn = /* @__PURE__ */ u({
|
|
|
4447
4447
|
}, f = n(() => ({
|
|
4448
4448
|
...u,
|
|
4449
4449
|
...c.resizeProps
|
|
4450
|
-
})), m = o,
|
|
4451
|
-
get: () => c.renderMode ??
|
|
4450
|
+
})), m = o, h = P(), y = w(), b = w(), x = O([]), C = w(null), T = n({
|
|
4451
|
+
get: () => c.renderMode ?? ae.Chat,
|
|
4452
4452
|
set: () => {}
|
|
4453
|
-
}),
|
|
4454
|
-
|
|
4455
|
-
},
|
|
4456
|
-
C.value?.focus?.();
|
|
4457
|
-
}, { reportError: F, managerErrorBridge: I } = Nn(m), { chatHelper: z, isStandaloneMode: B, isInitialized: ee, isReady: te, initError: H, whenReady: ne, chatBusinessManager: U, sessionBusinessManager: W, shortcutManager: ie } = An({
|
|
4453
|
+
}), E = n(() => H.value?.selectedLlmCode.value), k = () => {
|
|
4454
|
+
b.value?.focus?.();
|
|
4455
|
+
}, { reportError: A, managerErrorBridge: M } = Nn(m), { chatHelper: N, isStandaloneMode: F, isInitialized: I, isReady: z, initError: B, whenReady: ee, chatBusinessManager: H, sessionBusinessManager: U, shortcutManager: W } = An({
|
|
4458
4456
|
props: c,
|
|
4459
4457
|
emit: m,
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
}), { userInput: ce, cite: le, handleUpdateModelValue: ue, doSendMessage: de, handleSendMessage: fe, handleUpload: pe, handleArtifactClick: me, handleStopSending: he, stopGeneration: G } = Vn({
|
|
4458
|
+
reportError: A,
|
|
4459
|
+
managerErrorBridge: M
|
|
4460
|
+
}), { handleInterruptResume: ne, resumeUserQuestionWithInput: G } = Bn({
|
|
4461
|
+
chatHelper: N,
|
|
4462
|
+
reportError: A
|
|
4463
|
+
}), { userInput: re, cite: ie, handleUpdateModelValue: oe, doSendMessage: se, handleSendMessage: ce, handleUpload: le, handleArtifactClick: ue, handleStopSending: de, stopGeneration: fe } = Vn({
|
|
4467
4464
|
emit: m,
|
|
4468
|
-
chatHelper:
|
|
4469
|
-
chatBusinessManager:
|
|
4465
|
+
chatHelper: N,
|
|
4466
|
+
chatBusinessManager: H,
|
|
4470
4467
|
getRequestOptions: () => c.requestOptions,
|
|
4471
|
-
reportError:
|
|
4472
|
-
resumeUserQuestionWithInput:
|
|
4473
|
-
selectedShortcut:
|
|
4474
|
-
selectedResources:
|
|
4475
|
-
}), { handleSelectShortcut:
|
|
4468
|
+
reportError: A,
|
|
4469
|
+
resumeUserQuestionWithInput: G,
|
|
4470
|
+
selectedShortcut: C,
|
|
4471
|
+
selectedResources: x
|
|
4472
|
+
}), { handleSelectShortcut: pe, handleCloseShortcut: me, handleShortcutSubmit: he, selectShortcutWithText: ge, getShortcutFromMessage: _e, buildShortcutProperty: ve, sendShortcutDirectly: K } = Wn({
|
|
4476
4473
|
props: c,
|
|
4477
4474
|
emit: m,
|
|
4478
|
-
chatHelper:
|
|
4479
|
-
shortcutManager:
|
|
4480
|
-
doSendMessage:
|
|
4481
|
-
reportError:
|
|
4482
|
-
selectedShortcut:
|
|
4483
|
-
}), { messageStatus:
|
|
4475
|
+
chatHelper: N,
|
|
4476
|
+
shortcutManager: W,
|
|
4477
|
+
doSendMessage: se,
|
|
4478
|
+
reportError: A,
|
|
4479
|
+
selectedShortcut: C
|
|
4480
|
+
}), { messageStatus: q, messageToolsStatus: J, messages: ye, isMessagesLoading: be, isGenerating: xe, currentSession: Se, isWelcomeState: Y, openingRemark: X, effectiveResources: Ce, effectivePrompts: we, effectiveSkills: Te, effectiveSupportUpload: Ee, chatbotStyle: Z, filteredShortcuts: De } = jn({
|
|
4484
4481
|
props: c,
|
|
4485
|
-
chatHelper:
|
|
4486
|
-
chatBusinessManager:
|
|
4487
|
-
sessionBusinessManager:
|
|
4488
|
-
shortcutManager:
|
|
4489
|
-
isStandaloneMode:
|
|
4490
|
-
isInitialized:
|
|
4491
|
-
selectedShortcut:
|
|
4492
|
-
}), { handleAgentAction:
|
|
4482
|
+
chatHelper: N,
|
|
4483
|
+
chatBusinessManager: H,
|
|
4484
|
+
sessionBusinessManager: U,
|
|
4485
|
+
shortcutManager: W,
|
|
4486
|
+
isStandaloneMode: F,
|
|
4487
|
+
isInitialized: I,
|
|
4488
|
+
selectedShortcut: C
|
|
4489
|
+
}), { handleAgentAction: Oe, handleAgentFeedback: ke, handleUserAction: Ae, handleUserInputConfirm: je, handleUserShortcutConfirm: Me, handleStopStreaming: Ne } = Gn({
|
|
4493
4490
|
emit: m,
|
|
4494
|
-
chatHelper:
|
|
4495
|
-
chatBusinessManager:
|
|
4496
|
-
cite:
|
|
4497
|
-
focusInput:
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
buildShortcutProperty: J,
|
|
4491
|
+
chatHelper: N,
|
|
4492
|
+
chatBusinessManager: H,
|
|
4493
|
+
cite: ie,
|
|
4494
|
+
focusInput: k,
|
|
4495
|
+
getShortcutFromMessage: _e,
|
|
4496
|
+
buildShortcutProperty: ve,
|
|
4501
4497
|
getRequestOptions: () => c.requestOptions,
|
|
4502
|
-
reportError:
|
|
4503
|
-
stopGeneration:
|
|
4504
|
-
}),
|
|
4505
|
-
if (c.useAgentName) return
|
|
4506
|
-
}),
|
|
4498
|
+
reportError: A,
|
|
4499
|
+
stopGeneration: fe
|
|
4500
|
+
}), Pe = n(() => !I.value || be.value), Q = n(() => {
|
|
4501
|
+
if (c.useAgentName) return N.value?.agent.info.value?.agentName || void 0;
|
|
4502
|
+
}), Fe = n(() => {
|
|
4507
4503
|
if (c.enableModelSelect === !1) return;
|
|
4508
|
-
let e =
|
|
4504
|
+
let e = H.value?.models.value ?? [];
|
|
4509
4505
|
return e.length > 0 ? e : void 0;
|
|
4510
|
-
}),
|
|
4511
|
-
get: () =>
|
|
4506
|
+
}), Ie = n({
|
|
4507
|
+
get: () => H.value?.selectedModelName.value ?? "",
|
|
4512
4508
|
set: (e) => {
|
|
4513
|
-
|
|
4509
|
+
H.value?.setSelectedModelByName(e);
|
|
4514
4510
|
}
|
|
4515
|
-
}),
|
|
4516
|
-
|
|
4511
|
+
}), Le = (e) => {
|
|
4512
|
+
H.value?.setSelectedModel(e);
|
|
4517
4513
|
};
|
|
4518
4514
|
L(() => c.models, (e) => {
|
|
4519
|
-
c.enableModelSelect === !1 || !
|
|
4515
|
+
c.enableModelSelect === !1 || !H.value || e?.length && H.value.setModels(e);
|
|
4520
4516
|
});
|
|
4521
|
-
let { handleConfirmShare:
|
|
4517
|
+
let { handleConfirmShare: Re } = Un({
|
|
4522
4518
|
emit: m,
|
|
4523
|
-
chatHelper:
|
|
4524
|
-
isStandaloneMode:
|
|
4525
|
-
}),
|
|
4519
|
+
chatHelper: N,
|
|
4520
|
+
isStandaloneMode: F
|
|
4521
|
+
}), ze = (e, t) => {
|
|
4526
4522
|
m("execution-panel-change", e, t);
|
|
4527
|
-
},
|
|
4523
|
+
}, Be = async (e) => {
|
|
4528
4524
|
if (c.onCustomTabChange) return c.onCustomTabChange(e);
|
|
4529
4525
|
let t = e.data?.props;
|
|
4530
|
-
if (t?.task_id != null && t?.node_id) return
|
|
4526
|
+
if (t?.task_id != null && t?.node_id) return N.value?.message.getFlowAgentTaskNodeInfo(t.task_id, t.node_id);
|
|
4531
4527
|
};
|
|
4532
4528
|
return r({
|
|
4533
|
-
sendMessage: (e) =>
|
|
4534
|
-
stopGeneration:
|
|
4529
|
+
sendMessage: (e) => ce(e, [[]]),
|
|
4530
|
+
stopGeneration: fe,
|
|
4535
4531
|
switchSession: async (e) => {
|
|
4536
|
-
if (!
|
|
4532
|
+
if (!U.value) {
|
|
4537
4533
|
console.error("[ChatBot] Cannot switch session: sessionBusinessManager not initialized");
|
|
4538
4534
|
return;
|
|
4539
4535
|
}
|
|
4540
4536
|
try {
|
|
4541
|
-
await
|
|
4537
|
+
await U.value.switchSession(e), m("session-switched", U.value.currentSession.value);
|
|
4542
4538
|
} catch (e) {
|
|
4543
|
-
|
|
4539
|
+
A(e, "Failed to switch session");
|
|
4544
4540
|
}
|
|
4545
4541
|
},
|
|
4546
|
-
messages:
|
|
4547
|
-
currentSession:
|
|
4548
|
-
isGenerating:
|
|
4542
|
+
messages: ye,
|
|
4543
|
+
currentSession: Se,
|
|
4544
|
+
isGenerating: xe,
|
|
4549
4545
|
get isReady() {
|
|
4550
|
-
return
|
|
4546
|
+
return z.value;
|
|
4551
4547
|
},
|
|
4552
|
-
whenReady:
|
|
4553
|
-
getChatHelper: () =>
|
|
4548
|
+
whenReady: ee,
|
|
4549
|
+
getChatHelper: () => N.value,
|
|
4554
4550
|
setCiteText: (e) => {
|
|
4555
|
-
|
|
4551
|
+
ie.value = e;
|
|
4556
4552
|
},
|
|
4557
|
-
focusInput:
|
|
4558
|
-
enterShareMode: () =>
|
|
4559
|
-
exitShareMode: () =>
|
|
4553
|
+
focusInput: k,
|
|
4554
|
+
enterShareMode: () => y.value?.enterShareMode(),
|
|
4555
|
+
exitShareMode: () => y.value?.exitShareMode(),
|
|
4560
4556
|
selectShortcut: (e, t) => {
|
|
4561
|
-
|
|
4557
|
+
ge(e, t);
|
|
4562
4558
|
},
|
|
4563
|
-
sendShortcut: (e, t) =>
|
|
4559
|
+
sendShortcut: (e, t) => K(e, t),
|
|
4564
4560
|
updateAgentInfo: async () => {
|
|
4565
|
-
let e =
|
|
4561
|
+
let e = N.value;
|
|
4566
4562
|
if (!e) return null;
|
|
4567
4563
|
try {
|
|
4568
4564
|
await e.agent.getAgentInfo();
|
|
4569
4565
|
let t = e.agent.info.value ?? null;
|
|
4570
|
-
return t?.conversationSettings?.commands &&
|
|
4566
|
+
return t?.conversationSettings?.commands && W.value?.setAgentShortcuts(t.conversationSettings.commands), t;
|
|
4571
4567
|
} catch (e) {
|
|
4572
|
-
return
|
|
4568
|
+
return A(e, "Failed to update agentInfo"), null;
|
|
4573
4569
|
}
|
|
4574
4570
|
},
|
|
4575
|
-
selectedLlmCode:
|
|
4571
|
+
selectedLlmCode: E
|
|
4576
4572
|
}), (n, r) => (S(), a("div", {
|
|
4577
4573
|
class: g([
|
|
4578
4574
|
"ai-chatbot",
|
|
4579
4575
|
c.extCls,
|
|
4580
|
-
{ "welcome-state": j(
|
|
4576
|
+
{ "welcome-state": j(Y) }
|
|
4581
4577
|
]),
|
|
4582
|
-
style: v(j(
|
|
4578
|
+
style: v(j(Z))
|
|
4583
4579
|
}, [l(j(V), {
|
|
4584
4580
|
ref_key: "chatContainerRef",
|
|
4585
|
-
ref:
|
|
4586
|
-
cite: j(
|
|
4587
|
-
"onUpdate:cite": r[0] ||= (e) => p(
|
|
4588
|
-
"selected-shortcut":
|
|
4589
|
-
"onUpdate:selectedShortcut": r[1] ||= (e) =>
|
|
4590
|
-
"selected-model":
|
|
4591
|
-
"onUpdate:selectedModel": r[2] ||= (e) =>
|
|
4592
|
-
"render-mode":
|
|
4593
|
-
"onUpdate:renderMode": r[3] ||= (e) =>
|
|
4594
|
-
"chat-loading":
|
|
4581
|
+
ref: y,
|
|
4582
|
+
cite: j(ie),
|
|
4583
|
+
"onUpdate:cite": r[0] ||= (e) => p(ie) ? ie.value = e : null,
|
|
4584
|
+
"selected-shortcut": C.value,
|
|
4585
|
+
"onUpdate:selectedShortcut": r[1] ||= (e) => C.value = e,
|
|
4586
|
+
"selected-model": Ie.value,
|
|
4587
|
+
"onUpdate:selectedModel": r[2] ||= (e) => Ie.value = e,
|
|
4588
|
+
"render-mode": T.value,
|
|
4589
|
+
"onUpdate:renderMode": r[3] ||= (e) => T.value = e,
|
|
4590
|
+
"chat-loading": Pe.value,
|
|
4595
4591
|
"common-tippy-options": t.messageToolsTippyOptions,
|
|
4596
4592
|
"execution-tab-visible": c.executionTabVisible,
|
|
4597
|
-
"message-status": j(
|
|
4593
|
+
"message-status": j(q),
|
|
4598
4594
|
"message-tools": c.messageTools,
|
|
4599
|
-
"message-tools-status": j(
|
|
4600
|
-
messages: j(
|
|
4601
|
-
"model-value": j(
|
|
4602
|
-
models:
|
|
4603
|
-
"on-agent-action": j(
|
|
4604
|
-
"on-agent-feedback": j(
|
|
4605
|
-
"on-interrupt-resume": j(
|
|
4595
|
+
"message-tools-status": j(J),
|
|
4596
|
+
messages: j(ye),
|
|
4597
|
+
"model-value": j(re),
|
|
4598
|
+
models: Fe.value,
|
|
4599
|
+
"on-agent-action": j(Oe),
|
|
4600
|
+
"on-agent-feedback": j(ke),
|
|
4601
|
+
"on-interrupt-resume": j(ne),
|
|
4606
4602
|
"get-side-render-component": c.getSideRenderComponent,
|
|
4607
4603
|
"get-side-tab-render-component": c.getSideTabRenderComponent,
|
|
4608
|
-
"on-custom-tab-change":
|
|
4609
|
-
"on-send-message": j(
|
|
4610
|
-
"on-stop-sending": j(
|
|
4611
|
-
"on-artifact-click": j(
|
|
4612
|
-
"on-upload": j(
|
|
4613
|
-
"on-user-action": j(
|
|
4614
|
-
"on-user-input-confirm": j(
|
|
4615
|
-
"on-user-shortcut-confirm": j(
|
|
4616
|
-
"opening-remark": j(
|
|
4604
|
+
"on-custom-tab-change": Be,
|
|
4605
|
+
"on-send-message": j(ce),
|
|
4606
|
+
"on-stop-sending": j(de),
|
|
4607
|
+
"on-artifact-click": j(ue),
|
|
4608
|
+
"on-upload": j(le),
|
|
4609
|
+
"on-user-action": j(Ae),
|
|
4610
|
+
"on-user-input-confirm": j(je),
|
|
4611
|
+
"on-user-shortcut-confirm": j(Me),
|
|
4612
|
+
"opening-remark": j(X),
|
|
4617
4613
|
placeholder: c.placeholder,
|
|
4618
4614
|
placement: c.placement,
|
|
4619
|
-
"welcome-title":
|
|
4620
|
-
prompts: j(
|
|
4615
|
+
"welcome-title": Q.value,
|
|
4616
|
+
prompts: j(we),
|
|
4621
4617
|
"resize-props": f.value,
|
|
4622
4618
|
size: c.size,
|
|
4623
|
-
resources: j(
|
|
4624
|
-
"shortcut-id":
|
|
4625
|
-
shortcuts: j(
|
|
4626
|
-
skills: j(
|
|
4627
|
-
"support-upload": j(
|
|
4619
|
+
resources: j(Ce),
|
|
4620
|
+
"shortcut-id": C.value?.id,
|
|
4621
|
+
shortcuts: j(De),
|
|
4622
|
+
skills: j(Te),
|
|
4623
|
+
"support-upload": j(Ee),
|
|
4628
4624
|
"update-tools": c.updateTools,
|
|
4629
|
-
onCollapseChange:
|
|
4630
|
-
onConfirmShare: j(
|
|
4631
|
-
onDeleteShortcut: j(
|
|
4632
|
-
onModelChange:
|
|
4633
|
-
onSelectShortcut: j(
|
|
4634
|
-
onShortcutClose: j(
|
|
4635
|
-
onShortcutSubmit: j(
|
|
4636
|
-
onStopStreaming: j(
|
|
4637
|
-
"onUpdate:modelValue": j(
|
|
4625
|
+
onCollapseChange: ze,
|
|
4626
|
+
onConfirmShare: j(Re),
|
|
4627
|
+
onDeleteShortcut: j(me),
|
|
4628
|
+
onModelChange: Le,
|
|
4629
|
+
onSelectShortcut: j(pe),
|
|
4630
|
+
onShortcutClose: j(me),
|
|
4631
|
+
onShortcutSubmit: j(he),
|
|
4632
|
+
onStopStreaming: j(Ne),
|
|
4633
|
+
"onUpdate:modelValue": j(oe)
|
|
4638
4634
|
}, s({
|
|
4639
|
-
message: R(({ message: r, messageToolsStatus: o, onInterruptResume: c }) => [i(" 消费方提供了 #message slot 时,优先使用消费方的渲染 "), j(
|
|
4635
|
+
message: R(({ message: r, messageToolsStatus: o, onInterruptResume: c }) => [i(" 消费方提供了 #message slot 时,优先使用消费方的渲染 "), j(h).message ? D(n.$slots, "message", {
|
|
4640
4636
|
key: 0,
|
|
4641
4637
|
message: r,
|
|
4642
4638
|
messageToolsStatus: o,
|
|
4643
4639
|
onInterruptResume: c
|
|
4644
|
-
}) : (S(), a(e, { key: 1 }, [i(" 否则使用默认的 MessageRender "), l(j(
|
|
4640
|
+
}) : (S(), a(e, { key: 1 }, [i(" 否则使用默认的 MessageRender "), l(j(te), {
|
|
4645
4641
|
message: r,
|
|
4646
4642
|
"message-tools-status": o,
|
|
4647
|
-
"on-action": (e) => j(
|
|
4648
|
-
"on-input-confirm": (e, t) => j(
|
|
4643
|
+
"on-action": (e) => j(Ae)(e, r),
|
|
4644
|
+
"on-input-confirm": (e, t) => j(je)(r, e, t),
|
|
4649
4645
|
"on-interrupt-resume": c,
|
|
4650
|
-
"on-shortcut-confirm": (e) => j(
|
|
4646
|
+
"on-shortcut-confirm": (e) => j(Me)(r, e),
|
|
4651
4647
|
"tippy-options": t.messageToolsTippyOptions
|
|
4652
4648
|
}, s({ _: 2 }, [n.$slots.codeHeader ? {
|
|
4653
4649
|
name: "codeHeader",
|
|
@@ -4803,7 +4799,7 @@ function Zn(e) {
|
|
|
4803
4799
|
p &&= (clearTimeout(p.timer), null);
|
|
4804
4800
|
}, g = (e) => {
|
|
4805
4801
|
let { apiName: n, error: r, action: i, source: a, shouldToast: o = !0 } = e, c = r instanceof Error ? r.message : String(r), l = r instanceof Error ? r : null;
|
|
4806
|
-
l && f.has(l) || (l && f.add(l), a !== "http" && l && p?.error === l && h(), console.error(`[AIBlueking] ${n} error:`, r), o && t.errorToast !== !1 &&
|
|
4802
|
+
l && f.has(l) || (l && f.add(l), a !== "http" && l && p?.error === l && h(), console.error(`[AIBlueking] ${n} error:`, r), o && t.errorToast !== !1 && le({
|
|
4807
4803
|
message: c || $("请求失败"),
|
|
4808
4804
|
theme: "error"
|
|
4809
4805
|
}), s.emitInternal("sdk-error", {
|
|
@@ -4881,7 +4877,7 @@ function Zn(e) {
|
|
|
4881
4877
|
}, z = { appendTo: (e) => {
|
|
4882
4878
|
let t = e.closest(".draggable-container-content");
|
|
4883
4879
|
return console.log("[ai-blueking] appendTo called, ref:", e), console.log("[ai-blueking] appendTo closest result:", t), t ?? document.body;
|
|
4884
|
-
} }, B = n(() => s.isCompressed.value), ee = n(() => D.value), V = n(() => j.message.list.value.length === 0),
|
|
4880
|
+
} }, B = n(() => s.isCompressed.value), ee = n(() => D.value), V = n(() => j.message.list.value.length === 0), H = n(() => t.resources?.length ? t.resources : E.value?.resources ?? []), U = n(() => t.prompts?.length ? t.prompts : E.value?.conversationSettings?.predefinedQuestions ?? []), W = n(() => (E.value?.relatedSkills ?? []).map((e) => ({
|
|
4885
4881
|
skill_name: e.skill_name,
|
|
4886
4882
|
skill_code: e.skill_code,
|
|
4887
4883
|
description: e.description,
|
|
@@ -4894,13 +4890,13 @@ function Zn(e) {
|
|
|
4894
4890
|
source: "http"
|
|
4895
4891
|
}));
|
|
4896
4892
|
});
|
|
4897
|
-
let
|
|
4893
|
+
let te = (e) => {
|
|
4898
4894
|
e.conversationSettings?.commands && P.setAgentShortcuts(e.conversationSettings.commands);
|
|
4899
|
-
},
|
|
4895
|
+
}, ne = async () => {
|
|
4900
4896
|
try {
|
|
4901
4897
|
await j.agent.getAgentInfo();
|
|
4902
4898
|
let e = E.value;
|
|
4903
|
-
return e &&
|
|
4899
|
+
return e && te(e), e;
|
|
4904
4900
|
} catch (e) {
|
|
4905
4901
|
return g({
|
|
4906
4902
|
apiName: "getAgentInfo",
|
|
@@ -4910,7 +4906,7 @@ function Zn(e) {
|
|
|
4910
4906
|
}
|
|
4911
4907
|
};
|
|
4912
4908
|
L(() => C.value, async (e) => {
|
|
4913
|
-
if (e && E.value && (
|
|
4909
|
+
if (e && E.value && (te(E.value), E.value.conversationSettings && u("session-initialized", {
|
|
4914
4910
|
openingRemark: E.value.conversationSettings.openingRemark || "",
|
|
4915
4911
|
predefinedQuestions: E.value.conversationSettings.predefinedQuestions || []
|
|
4916
4912
|
}), t.loadRecentSessionOnMount)) try {
|
|
@@ -4921,13 +4917,13 @@ function Zn(e) {
|
|
|
4921
4917
|
}, { immediate: !0 }), L(() => t.shortcuts, (e) => {
|
|
4922
4918
|
P.setShortcuts(e || []);
|
|
4923
4919
|
}, { immediate: !0 });
|
|
4924
|
-
let
|
|
4920
|
+
let G = (e) => {
|
|
4925
4921
|
Rt(e) && (e.preventDefault(), c.value ? s.hidePanel() : s.showPanel());
|
|
4926
4922
|
};
|
|
4927
4923
|
return b(async () => {
|
|
4928
|
-
i.value && s.setContainerRef(i.value), window.addEventListener("keydown",
|
|
4924
|
+
i.value && s.setContainerRef(i.value), window.addEventListener("keydown", G);
|
|
4929
4925
|
}), y(() => {
|
|
4930
|
-
h(), window.removeEventListener("keydown",
|
|
4926
|
+
h(), window.removeEventListener("keydown", G), s.destroy();
|
|
4931
4927
|
}), {
|
|
4932
4928
|
chatHelper: j,
|
|
4933
4929
|
componentManager: s,
|
|
@@ -4947,13 +4943,13 @@ function Zn(e) {
|
|
|
4947
4943
|
isCompressed: B,
|
|
4948
4944
|
isWelcomeState: V,
|
|
4949
4945
|
messageToolsTippyOptions: z,
|
|
4950
|
-
agentResources:
|
|
4951
|
-
agentPrompts:
|
|
4952
|
-
agentSkills:
|
|
4946
|
+
agentResources: H,
|
|
4947
|
+
agentPrompts: U,
|
|
4948
|
+
agentSkills: W,
|
|
4953
4949
|
handleError: x,
|
|
4954
4950
|
reportSdkError: g,
|
|
4955
4951
|
ensureSessionReady: R,
|
|
4956
|
-
updateAgentInfo:
|
|
4952
|
+
updateAgentInfo: ne
|
|
4957
4953
|
};
|
|
4958
4954
|
}
|
|
4959
4955
|
//#endregion
|
|
@@ -5280,7 +5276,7 @@ function rr(e) {
|
|
|
5280
5276
|
o.value = !0;
|
|
5281
5277
|
try {
|
|
5282
5278
|
let { shareUrl: a, userMessageIds: o } = await t.shareMessages(e);
|
|
5283
|
-
await Pt(a),
|
|
5279
|
+
await Pt(a), le({
|
|
5284
5280
|
message: $("分享链接已复制到剪贴板"),
|
|
5285
5281
|
theme: "success"
|
|
5286
5282
|
}), n.value?.exitShareMode(), i.shareMessages(o), r("confirm-share", e, s);
|
|
@@ -5304,7 +5300,7 @@ function ir(e = {}) {
|
|
|
5304
5300
|
try {
|
|
5305
5301
|
let a = typeof n == "string" ? document.querySelector(n) : n;
|
|
5306
5302
|
if (!a) return console.warn(`Tooltip target not found: ${n}`), null;
|
|
5307
|
-
let o =
|
|
5303
|
+
let o = he(a, {
|
|
5308
5304
|
content: r,
|
|
5309
5305
|
placement: "top",
|
|
5310
5306
|
arrow: !0,
|
|
@@ -5362,7 +5358,7 @@ var ar = {
|
|
|
5362
5358
|
draggable: !0,
|
|
5363
5359
|
enableChatSession: !0,
|
|
5364
5360
|
enableModelSelect: !0,
|
|
5365
|
-
renderMode:
|
|
5361
|
+
renderMode: ae.Chat,
|
|
5366
5362
|
defaultWidth: 400,
|
|
5367
5363
|
defaultHeight: void 0,
|
|
5368
5364
|
defaultTop: 0,
|
|
@@ -5606,11 +5602,11 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5606
5602
|
});
|
|
5607
5603
|
}, V = (e, t) => {
|
|
5608
5604
|
c.value || (c.value = !0, B()), b(e, t);
|
|
5609
|
-
},
|
|
5605
|
+
}, H = (e, t, n, r) => {
|
|
5610
5606
|
c.value || (c.value = !0, B()), x(e, t, n, r);
|
|
5611
|
-
},
|
|
5607
|
+
}, U = (e, t) => {
|
|
5612
5608
|
C(e, t), c.value = !1, ee();
|
|
5613
|
-
},
|
|
5609
|
+
}, W = (e, t, n, r) => {
|
|
5614
5610
|
T(e, t, n, r), c.value = !1, ee();
|
|
5615
5611
|
};
|
|
5616
5612
|
return L(_, (e) => {
|
|
@@ -5643,10 +5639,10 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5643
5639
|
w: j(m),
|
|
5644
5640
|
x: j(p),
|
|
5645
5641
|
y: j(f),
|
|
5646
|
-
onDragStop:
|
|
5642
|
+
onDragStop: U,
|
|
5647
5643
|
onDragging: V,
|
|
5648
|
-
onResizeStop:
|
|
5649
|
-
onResizing:
|
|
5644
|
+
onResizeStop: W,
|
|
5645
|
+
onResizing: H
|
|
5650
5646
|
}, {
|
|
5651
5647
|
default: R(() => [o("div", lr, [D(e.$slots, "default", {}, void 0, !0)])]),
|
|
5652
5648
|
_: 3
|
|
@@ -5874,44 +5870,44 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5874
5870
|
"share"
|
|
5875
5871
|
],
|
|
5876
5872
|
setup(e, { expose: a, emit: c }) {
|
|
5877
|
-
let u = e, f = c, m = M(), { chatHelper: h, componentManager: y, sessionBusinessManager: b, shareBusinessManager: x, shortcutManager: C, forwarders: w, forwardToManager: T, chatBotRef: E, draggableContainerRef: O, panelVisible: k, nimbusMinimized: A, normalizedUrl: N, agentName: P, currentSession: F, isCompressed: I, isWelcomeState: L, messageToolsTippyOptions: z, agentResources: B, agentPrompts: V, agentSkills:
|
|
5873
|
+
let u = e, f = c, m = M(), { chatHelper: h, componentManager: y, sessionBusinessManager: b, shareBusinessManager: x, shortcutManager: C, forwarders: w, forwardToManager: T, chatBotRef: E, draggableContainerRef: O, panelVisible: k, nimbusMinimized: A, normalizedUrl: N, agentName: P, currentSession: F, isCompressed: I, isWelcomeState: L, messageToolsTippyOptions: z, agentResources: B, agentPrompts: V, agentSkills: H, handleError: U, reportSdkError: W, ensureSessionReady: te, updateAgentInfo: ne } = Zn({
|
|
5878
5874
|
props: u,
|
|
5879
5875
|
emit: f
|
|
5880
|
-
}),
|
|
5876
|
+
}), G = n(() => E.value?.selectedLlmCode), { show: re, hide: ie, handleShow: ae, handleClose: oe, handleNimbusClick: se, handleDragging: ce, handleResizing: le, handleDragStop: ue, handleResizeStop: de, handleToggleCompression: fe, handleCompressionChange: pe, handleExecutionPanelChange: me, sendMessage: he, handleReceiveStart: ge, handleReceiveText: _e, handleReceiveEnd: ve, handleStop: K, stopGeneration: q, setCiteText: J, focusInput: ye, selectShortcut: be, sendShortcut: xe, getChatHelper: Se, updatePosition: Y, updateSize: X, updatePositionAndSize: Ce, handleShortcutClick: we } = tr({
|
|
5881
5877
|
componentManager: y,
|
|
5882
5878
|
chatBotRef: E,
|
|
5883
5879
|
forwarders: w,
|
|
5884
5880
|
forwardToManager: T,
|
|
5885
5881
|
beforeNimbusClick: u.beforeNimbusClick,
|
|
5886
|
-
ensureSessionReady:
|
|
5882
|
+
ensureSessionReady: te
|
|
5887
5883
|
}), { sessionName: Te, hasPermission: Ee, hasSessionContents: Z, autoGenerateLoading: De, handleNewChat: Oe, handleNewChatCreated: ke, handleHistoryClick: Ae, handleHistorySessionSwitch: je, handleHistorySessionDelete: Me, handleHistorySessionRename: Ne, handleAutoGenerateName: Pe, handleHelpClick: Q, handleRename: Fe, handleSessionRenamed: Ie, handleSessionSwitched: Le, addNewSession: Re, switchToSession: ze, updateSessionName: Be } = nr({
|
|
5888
5884
|
chatHelper: h,
|
|
5889
5885
|
sessionBusinessManager: b,
|
|
5890
5886
|
chatBotRef: E,
|
|
5891
5887
|
forwarders: w,
|
|
5892
|
-
reportSdkError:
|
|
5888
|
+
reportSdkError: W,
|
|
5893
5889
|
currentSession: F
|
|
5894
5890
|
}), { isShareLoading: Ve, handleShare: He, handleCancelShare: Ue, handleConfirmShare: We } = rr({
|
|
5895
5891
|
shareBusinessManager: x,
|
|
5896
5892
|
chatBotRef: E,
|
|
5897
5893
|
emit: (e, t, n) => f(e, t, n),
|
|
5898
5894
|
forwarders: w,
|
|
5899
|
-
reportSdkError:
|
|
5895
|
+
reportSdkError: W
|
|
5900
5896
|
}), { aiSelectionVisible: Ge, filteredPopupShortcuts: Ke, handleSelectionChange: qe, handleAiSelectionShortcut: Je } = Qn({
|
|
5901
5897
|
shortcutManager: C,
|
|
5902
5898
|
chatBotRef: E,
|
|
5903
5899
|
forwardToManager: T,
|
|
5904
|
-
show:
|
|
5900
|
+
show: re,
|
|
5905
5901
|
props: u
|
|
5906
5902
|
}), Ye = (e) => {
|
|
5907
5903
|
Z.value = !0, w.sendMessage(e);
|
|
5908
5904
|
};
|
|
5909
5905
|
return a({
|
|
5910
|
-
show:
|
|
5911
|
-
handleShow:
|
|
5912
|
-
handleClose:
|
|
5913
|
-
hide:
|
|
5914
|
-
sendMessage:
|
|
5906
|
+
show: re,
|
|
5907
|
+
handleShow: ae,
|
|
5908
|
+
handleClose: oe,
|
|
5909
|
+
hide: ie,
|
|
5910
|
+
sendMessage: he,
|
|
5915
5911
|
selectShortcut: be,
|
|
5916
5912
|
sendShortcut: xe,
|
|
5917
5913
|
getChatHelper: Se,
|
|
@@ -5924,7 +5920,7 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5924
5920
|
updatePositionAndSize: Ce,
|
|
5925
5921
|
setCiteText: J,
|
|
5926
5922
|
focusInput: ye,
|
|
5927
|
-
updateAgentInfo:
|
|
5923
|
+
updateAgentInfo: ne
|
|
5928
5924
|
}), (e, n) => (S(), r(t, { to: u.teleportTo }, [o("div", { class: g([
|
|
5929
5925
|
"ai-blueking-v2",
|
|
5930
5926
|
u.extCls,
|
|
@@ -5944,11 +5940,11 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5944
5940
|
"max-width": u.maxWidth,
|
|
5945
5941
|
"max-width-percent": 80,
|
|
5946
5942
|
visible: j(k),
|
|
5947
|
-
onCompressionChange: j(
|
|
5948
|
-
onDragStop: j(
|
|
5949
|
-
onDragging: j(
|
|
5950
|
-
onResizeStop: j(
|
|
5951
|
-
onResizing: j(
|
|
5943
|
+
onCompressionChange: j(pe),
|
|
5944
|
+
onDragStop: j(ue),
|
|
5945
|
+
onDragging: j(ce),
|
|
5946
|
+
onResizeStop: j(de),
|
|
5947
|
+
onResizing: j(le)
|
|
5952
5948
|
}, {
|
|
5953
5949
|
default: R(() => [o("div", { class: g(["ai-blueking-panel", { "has-messages": !j(L) }]) }, [
|
|
5954
5950
|
i(" 独立的 Header 组件 "),
|
|
@@ -5965,7 +5961,7 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5965
5961
|
"is-compression-height": j(I),
|
|
5966
5962
|
"render-mode": u.renderMode,
|
|
5967
5963
|
"session-business-manager": j(b),
|
|
5968
|
-
"selected-llm-code":
|
|
5964
|
+
"selected-llm-code": G.value,
|
|
5969
5965
|
"session-name": j(Te),
|
|
5970
5966
|
"show-compression-icon": u.showCompressionIcon,
|
|
5971
5967
|
"show-history-icon": u.showHistoryIcon,
|
|
@@ -5973,7 +5969,7 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5973
5969
|
"show-new-chat-icon": u.showNewChatIcon,
|
|
5974
5970
|
title: u.title,
|
|
5975
5971
|
onAutoGenerateName: j(Pe),
|
|
5976
|
-
onClose: j(
|
|
5972
|
+
onClose: j(oe),
|
|
5977
5973
|
onHelpClick: j(Q),
|
|
5978
5974
|
onHistoryClick: j(Ae),
|
|
5979
5975
|
onHistorySessionDelete: j(Me),
|
|
@@ -5983,7 +5979,7 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
5983
5979
|
onNewChatCreated: j(ke),
|
|
5984
5980
|
onRename: j(Fe),
|
|
5985
5981
|
onShare: j(He),
|
|
5986
|
-
onToggleCompression: j(
|
|
5982
|
+
onToggleCompression: j(fe)
|
|
5987
5983
|
}, s({ _: 2 }, [e.$slots.headerLeft ? {
|
|
5988
5984
|
name: "headerLeft",
|
|
5989
5985
|
fn: R(() => [D(e.$slots, "headerLeft", {}, void 0, !0)]),
|
|
@@ -6016,15 +6012,15 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
6016
6012
|
"session-code": u.initialSessionCode,
|
|
6017
6013
|
"share-loading": j(Ve),
|
|
6018
6014
|
shortcuts: u.shortcuts,
|
|
6019
|
-
skills: j(
|
|
6015
|
+
skills: j(H),
|
|
6020
6016
|
style: v({ height: u.hideHeader ? "100%" : "calc(100% - 48px)" }),
|
|
6021
6017
|
"update-tools": u.updateTools,
|
|
6022
6018
|
url: j(N),
|
|
6023
6019
|
onAgentAction: n[0] ||= (e, t) => f("agent-action", e, t),
|
|
6024
6020
|
onCancelShare: j(Ue),
|
|
6025
6021
|
onConfirmShare: n[1] ||= (e, t) => j(We)(e, t),
|
|
6026
|
-
onError: n[2] ||= (e) => j(
|
|
6027
|
-
onExecutionPanelChange: j(
|
|
6022
|
+
onError: n[2] ||= (e) => j(U)(e),
|
|
6023
|
+
onExecutionPanelChange: j(me),
|
|
6028
6024
|
onReceiveEnd: j(ve),
|
|
6029
6025
|
onReceiveStart: j(ge),
|
|
6030
6026
|
onReceiveText: j(_e),
|
|
@@ -6081,7 +6077,7 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
6081
6077
|
"onUpdate:isPanelShow": n[6] ||= (e) => p(k) ? k.value = e : null,
|
|
6082
6078
|
"default-minimize": u.defaultMinimize,
|
|
6083
6079
|
size: u.nimbusSize,
|
|
6084
|
-
onClick: j(
|
|
6080
|
+
onClick: j(se)
|
|
6085
6081
|
}, null, 8, [
|
|
6086
6082
|
"is-minimize",
|
|
6087
6083
|
"is-panel-show",
|
|
@@ -6110,4 +6106,4 @@ var lr = { class: "draggable-container-content" }, ur = /* @__PURE__ */ qt(/* @_
|
|
|
6110
6106
|
}
|
|
6111
6107
|
}), [["__scopeId", "data-v-362402ff"]]);
|
|
6112
6108
|
//#endregion
|
|
6113
|
-
export { Z as AGUIProtocol, mr as AIBlueking, mr as default, or as BluekingProtocol, qn as BootstrapPhase, Kn as ChatBot, bn as ChatBusinessManager, wn as ComponentManager, ur as DraggableContainer,
|
|
6109
|
+
export { Z as AGUIProtocol, mr as AIBlueking, mr as default, or as BluekingProtocol, qn as BootstrapPhase, Kn as ChatBot, bn as ChatBusinessManager, wn as ComponentManager, ur as DraggableContainer, W as MessageContentType, ie as RenderMode, xn as SessionBusinessManager, Cn as ShortcutManager, On as UIStateManager, sr as createBluekingProtocol, Tn as createComponentManager, ar as defaultProps, kt as parseCustomBlocks, Jn as useChatBootstrap, bt as useChatHelper, cr as useDraggable };
|