@blueking/ai-blueking 2.2.3-dev.2 → 2.2.4-beta.1
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/ai-header/index.vue.d.ts.map +1 -1
- package/dist/components/chat-bot.vue.d.ts.map +1 -1
- package/dist/composables/use-ai-blueking-init.d.ts.map +1 -1
- package/dist/standalone/index.es.min.js +1036 -1023
- package/dist/standalone/index.iife.min.js +4 -4
- package/dist/standalone/index.umd.min.js +4 -4
- package/dist/standalone/style.css +1 -1
- package/dist/vue2/index.es.min.js +211 -198
- package/dist/vue2/index.iife.min.js +3 -3
- package/dist/vue2/index.umd.min.js +3 -3
- package/dist/vue2/style.css +1 -1
- package/dist/vue3/index.es.min.js +140 -131
- package/dist/vue3/index.iife.min.js +4 -4
- package/dist/vue3/index.umd.min.js +4 -4
- package/dist/vue3/style.css +1 -1
- package/package.json +3 -3
|
@@ -2624,7 +2624,11 @@ var hn = { class: "left-section" }, gn = { class: "logo" }, _n = ["src"], vn = {
|
|
|
2624
2624
|
}, xn = {
|
|
2625
2625
|
key: 1,
|
|
2626
2626
|
class: "bkai-icon bkai-auto-refresh-line"
|
|
2627
|
-
}, Sn = { class: "right-section" }, Cn =
|
|
2627
|
+
}, Sn = { class: "right-section" }, Cn = {
|
|
2628
|
+
key: 4,
|
|
2629
|
+
"aria-hidden": "true",
|
|
2630
|
+
class: "header-toolbar-divider"
|
|
2631
|
+
}, wn = /* @__PURE__ */ $t(/* @__PURE__ */ d({
|
|
2628
2632
|
__name: "index",
|
|
2629
2633
|
props: {
|
|
2630
2634
|
agentName: { default: "" },
|
|
@@ -2790,7 +2794,10 @@ var hn = { class: "left-section" }, gn = { class: "logo" }, _n = ["src"], vn = {
|
|
|
2790
2794
|
}), (t, n) => (C(), o("div", {
|
|
2791
2795
|
ref_key: "headerRef",
|
|
2792
2796
|
ref: g,
|
|
2793
|
-
class: _(["ai-header drag-handle", {
|
|
2797
|
+
class: _(["ai-header drag-handle", {
|
|
2798
|
+
draggable: f.draggable,
|
|
2799
|
+
"is-aside-expanded": !f.asideCollapsed
|
|
2800
|
+
}])
|
|
2794
2801
|
}, [
|
|
2795
2802
|
s("div", hn, [
|
|
2796
2803
|
s("div", gn, [s("img", {
|
|
@@ -2912,57 +2919,59 @@ var hn = { class: "left-section" }, gn = { class: "logo" }, _n = ["src"], vn = {
|
|
|
2912
2919
|
content: M($)("转人工"),
|
|
2913
2920
|
boundary: "parent"
|
|
2914
2921
|
}]]) : a("v-if", !0),
|
|
2915
|
-
f.showAsideToggle ? z((C(), o("span", {
|
|
2916
|
-
key: 3,
|
|
2917
|
-
class: "bkai-icon aside-toggle",
|
|
2918
|
-
onClick: n[5] ||= B((e) => p("toggle-aside"), ["stop"])
|
|
2919
|
-
}, [u(M(m))])), [[M(h), {
|
|
2920
|
-
content: f.asideCollapsed ? M($)("展开侧栏") : M($)("收起侧栏"),
|
|
2921
|
-
boundary: "parent"
|
|
2922
|
-
}]]) : a("v-if", !0),
|
|
2923
2922
|
f.showCompressionIcon ? z((C(), o("i", {
|
|
2924
|
-
key:
|
|
2923
|
+
key: 3,
|
|
2925
2924
|
class: _(["bkai-icon", I.value]),
|
|
2926
|
-
onClick: n[
|
|
2925
|
+
onClick: n[5] ||= (e) => p("toggle-compression")
|
|
2927
2926
|
}, null, 2)), [[M(h), {
|
|
2928
2927
|
content: te.value,
|
|
2929
2928
|
boundary: "parent"
|
|
2930
2929
|
}]]) : a("v-if", !0),
|
|
2931
2930
|
z(s("i", {
|
|
2932
2931
|
class: "bkai-icon bkai-close-line-2",
|
|
2933
|
-
onClick: n[
|
|
2932
|
+
onClick: n[6] ||= (e) => p("close")
|
|
2934
2933
|
}, null, 512), [[M(h), {
|
|
2935
2934
|
content: M($)("关闭"),
|
|
2936
2935
|
boundary: "parent"
|
|
2937
|
-
}]])
|
|
2936
|
+
}]]),
|
|
2937
|
+
a(" 设计稿:关闭与侧栏展开之间有竖线分隔 "),
|
|
2938
|
+
f.showAsideToggle ? (C(), o("span", Cn)) : a("v-if", !0),
|
|
2939
|
+
f.showAsideToggle ? z((C(), o("span", {
|
|
2940
|
+
key: 5,
|
|
2941
|
+
class: "bkai-icon aside-toggle",
|
|
2942
|
+
onClick: n[7] ||= B((e) => p("toggle-aside"), ["stop"])
|
|
2943
|
+
}, [u(M(m))])), [[M(h), {
|
|
2944
|
+
content: f.asideCollapsed ? M($)("展开侧栏") : M($)("收起侧栏"),
|
|
2945
|
+
boundary: "parent"
|
|
2946
|
+
}]]) : a("v-if", !0)
|
|
2938
2947
|
])
|
|
2939
2948
|
], 2));
|
|
2940
2949
|
}
|
|
2941
|
-
}), [["__scopeId", "data-v-
|
|
2950
|
+
}), [["__scopeId", "data-v-03aace06"]]);
|
|
2942
2951
|
//#endregion
|
|
2943
2952
|
//#region src/bootstrap/agent-bootstrap.ts
|
|
2944
|
-
function
|
|
2953
|
+
function Tn(e) {
|
|
2945
2954
|
let t = zt(e);
|
|
2946
2955
|
fetch(t, {
|
|
2947
2956
|
method: "GET",
|
|
2948
2957
|
credentials: "include"
|
|
2949
2958
|
}).catch(() => {});
|
|
2950
2959
|
}
|
|
2951
|
-
async function
|
|
2960
|
+
async function En(e, t = {}) {
|
|
2952
2961
|
let { enableModelSelect: n = !0 } = t, r = [e.agent.getAgentInfo(), e.session.getSessions()];
|
|
2953
2962
|
n && typeof e.agent.getLlms == "function" && r.push(e.agent.getLlms().catch((e) => {
|
|
2954
2963
|
console.error("[runAgentBootstrap] Failed to load models:", e);
|
|
2955
2964
|
})), await Promise.all(r);
|
|
2956
2965
|
let i = e.agent.info.value?.saasUrl;
|
|
2957
|
-
i &&
|
|
2966
|
+
i && Tn(i);
|
|
2958
2967
|
}
|
|
2959
2968
|
//#endregion
|
|
2960
2969
|
//#region src/manager/business/model-selection-manager.ts
|
|
2961
|
-
var
|
|
2970
|
+
var Dn = class extends Error {
|
|
2962
2971
|
constructor(e = "当前没有可用模型,无法创建会话") {
|
|
2963
2972
|
super(e), this.name = "ModelUnavailableError";
|
|
2964
2973
|
}
|
|
2965
|
-
},
|
|
2974
|
+
}, On = class {
|
|
2966
2975
|
_isLoading;
|
|
2967
2976
|
_models;
|
|
2968
2977
|
_selectedLlmCode;
|
|
@@ -3067,7 +3076,7 @@ var En = class extends Error {
|
|
|
3067
3076
|
resolveModelForSession(e) {
|
|
3068
3077
|
if (!this.enabled) return e;
|
|
3069
3078
|
let t = this._models.value;
|
|
3070
|
-
if (t.length === 0) throw new
|
|
3079
|
+
if (t.length === 0) throw new Dn();
|
|
3071
3080
|
return e && t.some((t) => t.llm_code === e) ? e : this.hasValidSelection() ? this._selectedLlmCode.value : this.defaultModelCode();
|
|
3072
3081
|
}
|
|
3073
3082
|
setModels(e) {
|
|
@@ -3083,7 +3092,7 @@ var En = class extends Error {
|
|
|
3083
3092
|
}
|
|
3084
3093
|
this._selectedLlmCode.value = this._models.value.find((t) => t.llm_name === e)?.llm_code;
|
|
3085
3094
|
}
|
|
3086
|
-
},
|
|
3095
|
+
}, kn = class {
|
|
3087
3096
|
_isGenerating;
|
|
3088
3097
|
_isStopLoading;
|
|
3089
3098
|
agentModule;
|
|
@@ -3118,7 +3127,7 @@ var En = class extends Error {
|
|
|
3118
3127
|
this.eventEmitter?.emit(e, t);
|
|
3119
3128
|
}
|
|
3120
3129
|
constructor(e, t, n = null, r = null, i = {}, a) {
|
|
3121
|
-
this.agentModule = e, this.messageModule = t, this.sessionModule = n, this.eventEmitter = r, this.config = i, this.modelSelection = a ?? new
|
|
3130
|
+
this.agentModule = e, this.messageModule = t, this.sessionModule = n, this.eventEmitter = r, this.config = i, this.modelSelection = a ?? new On(e, n), this._isGenerating = T(!1), this._isStopLoading = T(!1);
|
|
3122
3131
|
}
|
|
3123
3132
|
get isGenerating() {
|
|
3124
3133
|
return this._isGenerating;
|
|
@@ -3286,7 +3295,7 @@ var En = class extends Error {
|
|
|
3286
3295
|
this._isStopLoading.value = !1;
|
|
3287
3296
|
}
|
|
3288
3297
|
}
|
|
3289
|
-
},
|
|
3298
|
+
}, An = class {
|
|
3290
3299
|
agentModule;
|
|
3291
3300
|
config;
|
|
3292
3301
|
eventEmitter;
|
|
@@ -3300,7 +3309,7 @@ var En = class extends Error {
|
|
|
3300
3309
|
return await this.modelSelection.ensureLoaded(), this.modelSelection.resolveModelForSession(e);
|
|
3301
3310
|
}
|
|
3302
3311
|
constructor(e, t = null, n = null, r = {}, i = null, a) {
|
|
3303
|
-
this.sessionModule = e, this.agentModule = t, this.eventEmitter = n, this.config = r, this.messageModule = i, this.modelSelection = a ?? new
|
|
3312
|
+
this.sessionModule = e, this.agentModule = t, this.eventEmitter = n, this.config = r, this.messageModule = i, this.modelSelection = a ?? new On(t, e, { enabled: !1 });
|
|
3304
3313
|
}
|
|
3305
3314
|
get currentSession() {
|
|
3306
3315
|
return this.sessionModule.current;
|
|
@@ -3471,7 +3480,7 @@ var En = class extends Error {
|
|
|
3471
3480
|
}), e;
|
|
3472
3481
|
}
|
|
3473
3482
|
}
|
|
3474
|
-
},
|
|
3483
|
+
}, jn = class {
|
|
3475
3484
|
messageModule;
|
|
3476
3485
|
sessionModule;
|
|
3477
3486
|
constructor(e, t) {
|
|
@@ -3488,7 +3497,7 @@ var En = class extends Error {
|
|
|
3488
3497
|
userMessageIds: e.map((e) => String(e.id))
|
|
3489
3498
|
};
|
|
3490
3499
|
}
|
|
3491
|
-
},
|
|
3500
|
+
}, Mn = class {
|
|
3492
3501
|
_agentShortcuts;
|
|
3493
3502
|
_effectiveShortcuts;
|
|
3494
3503
|
_propsShortcuts;
|
|
@@ -3545,7 +3554,7 @@ var En = class extends Error {
|
|
|
3545
3554
|
setShortcuts(e) {
|
|
3546
3555
|
this._propsShortcuts.value = e;
|
|
3547
3556
|
}
|
|
3548
|
-
},
|
|
3557
|
+
}, Nn = class {
|
|
3549
3558
|
_isCompressed;
|
|
3550
3559
|
_isDraggingOrResizing;
|
|
3551
3560
|
_nimbusMinimized;
|
|
@@ -3764,12 +3773,12 @@ var En = class extends Error {
|
|
|
3764
3773
|
};
|
|
3765
3774
|
}
|
|
3766
3775
|
};
|
|
3767
|
-
function
|
|
3768
|
-
return new
|
|
3776
|
+
function Pn(e) {
|
|
3777
|
+
return new Nn(e);
|
|
3769
3778
|
}
|
|
3770
3779
|
//#endregion
|
|
3771
3780
|
//#region src/manager/event-types.ts
|
|
3772
|
-
var
|
|
3781
|
+
var Fn = {
|
|
3773
3782
|
"panel-show": "show",
|
|
3774
3783
|
"panel-hide": "close",
|
|
3775
3784
|
"panel-toggle": null,
|
|
@@ -3819,7 +3828,7 @@ var Pn = {
|
|
|
3819
3828
|
"agent-info-loaded": null,
|
|
3820
3829
|
error: null
|
|
3821
3830
|
};
|
|
3822
|
-
function
|
|
3831
|
+
function In(e, t) {
|
|
3823
3832
|
switch (e) {
|
|
3824
3833
|
case "send-message": return [t.content];
|
|
3825
3834
|
case "rename": return [t.newName, t.sessionCode];
|
|
@@ -3850,7 +3859,7 @@ function Fn(e, t) {
|
|
|
3850
3859
|
}
|
|
3851
3860
|
//#endregion
|
|
3852
3861
|
//#region src/manager/ui/ui-state-manager.ts
|
|
3853
|
-
var
|
|
3862
|
+
var Ln = class {
|
|
3854
3863
|
_selectedMessageIds;
|
|
3855
3864
|
_isSelectionMode;
|
|
3856
3865
|
_editingSessionCode;
|
|
@@ -3923,12 +3932,12 @@ var In = class {
|
|
|
3923
3932
|
reset() {
|
|
3924
3933
|
this.clearSelection(), this.disableSelectionMode(), this.stopEditingSession(), this.clearLoadingStates();
|
|
3925
3934
|
}
|
|
3926
|
-
},
|
|
3935
|
+
}, Rn = class extends Error {
|
|
3927
3936
|
constructor() {
|
|
3928
3937
|
super("[ChatBot] Initialization was superseded by a newer init"), this.name = "ChatBotInitStaleError";
|
|
3929
3938
|
}
|
|
3930
3939
|
};
|
|
3931
|
-
function
|
|
3940
|
+
function zn(e) {
|
|
3932
3941
|
let { props: t, emit: n, reportError: i, managerErrorBridge: a } = e, o = k(null), s = k(null), c = k(null), l = k(null), u = T(!1), d = T(!t.chatHelper), f = T(null), p = r(() => u.value), m = () => t.chatHelper ? !t.chatHelper.agent || !t.chatHelper.session || !t.chatHelper.message ? {
|
|
3933
3942
|
valid: !1,
|
|
3934
3943
|
error: "[ChatBot] Invalid chatHelper: missing required modules (agent, session, message)"
|
|
@@ -3964,7 +3973,7 @@ function Rn(e) {
|
|
|
3964
3973
|
}, _ = 0, v = null, y = null, x = null, S = (e) => {
|
|
3965
3974
|
x &&= (e ? x.reject(e) : x.resolve(), null), v = null;
|
|
3966
3975
|
}, C = (e) => {
|
|
3967
|
-
if (e !== _) throw new
|
|
3976
|
+
if (e !== _) throw new Rn();
|
|
3968
3977
|
}, w = async (e) => {
|
|
3969
3978
|
if (t.enableModelSelect !== !1) {
|
|
3970
3979
|
if (t.models?.length) {
|
|
@@ -3978,26 +3987,26 @@ function Rn(e) {
|
|
|
3978
3987
|
u.value = !1, f.value = null, d.value = !t.chatHelper, g(r), C(e), o.value = null, s.value = null, c.value = null, l.value = null;
|
|
3979
3988
|
let p = h();
|
|
3980
3989
|
if (!p) throw f.value ?? /* @__PURE__ */ Error("[ChatBot] Failed to create chatHelper");
|
|
3981
|
-
let m = t.modelSelectionManager ?? new
|
|
3990
|
+
let m = t.modelSelectionManager ?? new On(p.agent, p.session, { enabled: t.enableModelSelect !== !1 }), _ = new An(p.session, p.agent, a, {
|
|
3982
3991
|
enableChatSession: !0,
|
|
3983
3992
|
autoSwitchToInitialSession: !!t.sessionCode,
|
|
3984
3993
|
loadRecentSessionOnMount: t.autoLoad,
|
|
3985
3994
|
initialSessionCode: t.sessionCode,
|
|
3986
3995
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
3987
|
-
}, p.message, m), v = new
|
|
3996
|
+
}, p.message, m), v = new kn(p.agent, p.message, p.session, a, {
|
|
3988
3997
|
openingRemark: t.helloText,
|
|
3989
3998
|
predefinedQuestions: t.prompts,
|
|
3990
3999
|
placeholder: t.placeholder,
|
|
3991
4000
|
onSessionRenamed: (e, t) => n("rename", e, t)
|
|
3992
|
-
}, m), y = new
|
|
4001
|
+
}, m), y = new Mn(null, t.shortcuts || []);
|
|
3993
4002
|
o.value = p, s.value = _, c.value = v, l.value = y;
|
|
3994
4003
|
try {
|
|
3995
|
-
d.value ? (await
|
|
4004
|
+
d.value ? (await En(p, { enableModelSelect: t.enableModelSelect !== !1 && !t.models?.length }), C(e), await w(m), C(e), await _.loadRecentSession({ skipLoadSessions: !0 }), C(e)) : await w(m), C(e), u.value = !0, n("agent-info-loaded", p);
|
|
3996
4005
|
} catch (t) {
|
|
3997
4006
|
throw C(e), f.value = i(t, "Failed to initialize ChatBot"), t;
|
|
3998
4007
|
}
|
|
3999
4008
|
}, D = () => {
|
|
4000
|
-
S(new
|
|
4009
|
+
S(new Rn()), y = null;
|
|
4001
4010
|
let e = ++_;
|
|
4002
4011
|
v = new Promise((t, n) => {
|
|
4003
4012
|
x = {
|
|
@@ -4028,7 +4037,7 @@ function Rn(e) {
|
|
|
4028
4037
|
}
|
|
4029
4038
|
//#endregion
|
|
4030
4039
|
//#region src/components/composables/use-chatbot-state.ts
|
|
4031
|
-
function
|
|
4040
|
+
function Bn(e) {
|
|
4032
4041
|
let { props: t, chatHelper: n, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = r(() => i.value?.isStopLoading.value ? G.StopLoading : ((t.chatHelper || n.value)?.agent)?.isChatting?.value ? G.Streaming : G.Complete), d = r(() => u.value === G.Streaming ? ae.Disabled : void 0), f = r(() => i.value?.messages.value ?? []), p = r(() => i.value?.isMessagesLoading.value ?? !1);
|
|
4033
4042
|
return {
|
|
4034
4043
|
messageStatus: u,
|
|
@@ -4057,12 +4066,12 @@ function zn(e) {
|
|
|
4057
4066
|
}
|
|
4058
4067
|
//#endregion
|
|
4059
4068
|
//#region src/components/composables/use-error-reporter.ts
|
|
4060
|
-
var
|
|
4069
|
+
var Vn = new Set([
|
|
4061
4070
|
"chat-error",
|
|
4062
4071
|
"receive-error",
|
|
4063
4072
|
"session-error"
|
|
4064
4073
|
]);
|
|
4065
|
-
function
|
|
4074
|
+
function Hn(e, t = {}) {
|
|
4066
4075
|
let n = /* @__PURE__ */ new WeakSet(), r = (r, i) => {
|
|
4067
4076
|
let a = It(r);
|
|
4068
4077
|
return n.has(a) ? a : (n.add(a), console.error(i ? `[ChatBot] ${i}:` : "[ChatBot] error:", r), e("error", a), j(t.errorToast) !== !1 && de({
|
|
@@ -4072,50 +4081,50 @@ function Vn(e, t = {}) {
|
|
|
4072
4081
|
};
|
|
4073
4082
|
return {
|
|
4074
4083
|
managerErrorBridge: { emit: (e, t) => {
|
|
4075
|
-
|
|
4084
|
+
Vn.has(e) && r(t?.error);
|
|
4076
4085
|
} },
|
|
4077
4086
|
reportError: r
|
|
4078
4087
|
};
|
|
4079
4088
|
}
|
|
4080
4089
|
//#endregion
|
|
4081
4090
|
//#region src/components/composables/use-interrupt-resume.ts
|
|
4082
|
-
var
|
|
4091
|
+
var Un = {
|
|
4083
4092
|
[U.ApprovalCancel]: Se.ApprovalCancel,
|
|
4084
4093
|
[U.FlowNodeRetry]: Se.FlowNodeRetry,
|
|
4085
4094
|
[U.FlowNodeSkip]: Se.FlowNodeSkip
|
|
4086
4095
|
};
|
|
4087
|
-
function
|
|
4096
|
+
function Wn(e) {
|
|
4088
4097
|
return "operation" in e;
|
|
4089
4098
|
}
|
|
4090
|
-
function
|
|
4099
|
+
function Gn(e) {
|
|
4091
4100
|
return "interruptId" in e && "reason" in e && e.reason === H.UserQuestion;
|
|
4092
4101
|
}
|
|
4093
|
-
function
|
|
4102
|
+
function Kn(e) {
|
|
4094
4103
|
return e === "cancelled" ? Ae.Cancelled : Ae.Resolved;
|
|
4095
4104
|
}
|
|
4096
|
-
function
|
|
4105
|
+
function qn(e) {
|
|
4097
4106
|
let t = e?.session.current?.value?.sessionCode;
|
|
4098
4107
|
if (!t) throw Error("[ChatBot] Cannot resume interrupt: no active session");
|
|
4099
4108
|
return t;
|
|
4100
4109
|
}
|
|
4101
|
-
function
|
|
4110
|
+
function Jn(e) {
|
|
4102
4111
|
return {
|
|
4103
4112
|
interruptId: e.interruptId,
|
|
4104
|
-
status:
|
|
4113
|
+
status: Kn(e.status),
|
|
4105
4114
|
payload: e.payload
|
|
4106
4115
|
};
|
|
4107
4116
|
}
|
|
4108
|
-
function
|
|
4117
|
+
function Yn(e) {
|
|
4109
4118
|
let { chatHelper: t, reportError: n } = e, r = async (e) => {
|
|
4110
4119
|
let n = t.value;
|
|
4111
4120
|
if (!n) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
4112
|
-
if (!
|
|
4113
|
-
let r =
|
|
4121
|
+
if (!Wn(e)) throw Error("[ChatBot] Unsupported interrupt resume payload");
|
|
4122
|
+
let r = qn(n);
|
|
4114
4123
|
if (e.operation === U.ApprovalRefresh) {
|
|
4115
4124
|
n.agent.pollResumeSession(r);
|
|
4116
4125
|
return;
|
|
4117
4126
|
}
|
|
4118
|
-
let i =
|
|
4127
|
+
let i = Un[e.operation];
|
|
4119
4128
|
if (!i) throw Error(`[ChatBot] Unsupported interrupt resume operation: ${e.operation}`);
|
|
4120
4129
|
let a = n.agent;
|
|
4121
4130
|
if (e.operation === U.ApprovalCancel) {
|
|
@@ -4129,21 +4138,21 @@ function Jn(e) {
|
|
|
4129
4138
|
}, i = async (e, n) => {
|
|
4130
4139
|
let r = t.value;
|
|
4131
4140
|
if (!r) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
4132
|
-
let i =
|
|
4141
|
+
let i = qn(r);
|
|
4133
4142
|
await r.agent.streamRequest({
|
|
4134
4143
|
sessionCode: i,
|
|
4135
|
-
resume:
|
|
4144
|
+
resume: Jn(e),
|
|
4136
4145
|
...n ? { input: n } : {}
|
|
4137
4146
|
});
|
|
4138
4147
|
};
|
|
4139
4148
|
return {
|
|
4140
4149
|
handleInterruptResume: async (e, t) => {
|
|
4141
4150
|
try {
|
|
4142
|
-
if (
|
|
4151
|
+
if (Wn(e)) {
|
|
4143
4152
|
await r(e);
|
|
4144
4153
|
return;
|
|
4145
4154
|
}
|
|
4146
|
-
if (
|
|
4155
|
+
if (Gn(e)) {
|
|
4147
4156
|
await i(e);
|
|
4148
4157
|
return;
|
|
4149
4158
|
}
|
|
@@ -4154,7 +4163,7 @@ function Jn(e) {
|
|
|
4154
4163
|
},
|
|
4155
4164
|
resumeUserQuestionWithInput: async (e, t) => {
|
|
4156
4165
|
try {
|
|
4157
|
-
if (!t.payload || !
|
|
4166
|
+
if (!t.payload || !Gn(t.payload)) throw Error("[ChatBot] Invalid user question resume options");
|
|
4158
4167
|
let n = typeof e == "string" ? e.trim() : "";
|
|
4159
4168
|
if (!n) throw Error("[ChatBot] User question free text input is empty");
|
|
4160
4169
|
await i(t.payload, n);
|
|
@@ -4166,7 +4175,7 @@ function Jn(e) {
|
|
|
4166
4175
|
}
|
|
4167
4176
|
//#endregion
|
|
4168
4177
|
//#region src/components/composables/use-message-sender.ts
|
|
4169
|
-
function
|
|
4178
|
+
function Xn(e) {
|
|
4170
4179
|
let { emit: t, chatHelper: n, chatBusinessManager: r, getRequestOptions: i, reportError: a, resumeUserQuestionWithInput: o, selectedShortcut: s, selectedResources: c } = e, l = k([[]]), u = k(""), d = (e, t) => {
|
|
4171
4180
|
l.value = e, c.value = t;
|
|
4172
4181
|
}, f = async (e, a = {}) => {
|
|
@@ -4231,11 +4240,11 @@ function Yn(e) {
|
|
|
4231
4240
|
}
|
|
4232
4241
|
//#endregion
|
|
4233
4242
|
//#region src/components/composables/use-share-selection.ts
|
|
4234
|
-
var
|
|
4235
|
-
function
|
|
4243
|
+
var Zn = (e) => !e || e.id === "share";
|
|
4244
|
+
function Qn(e) {
|
|
4236
4245
|
let { emit: t, chatHelper: n, isStandaloneMode: r } = e, i = async (e) => {
|
|
4237
4246
|
if (!(!n.value || e.length === 0)) try {
|
|
4238
|
-
await Bt((await new
|
|
4247
|
+
await Bt((await new jn(n.value.message, n.value.session).shareMessages(e)).shareUrl), de({
|
|
4239
4248
|
message: "分享链接已复制到剪贴板",
|
|
4240
4249
|
theme: "success"
|
|
4241
4250
|
});
|
|
@@ -4247,12 +4256,12 @@ function Zn(e) {
|
|
|
4247
4256
|
}
|
|
4248
4257
|
};
|
|
4249
4258
|
return { handleConfirmShare: async (e, n) => {
|
|
4250
|
-
r.value &&
|
|
4259
|
+
r.value && Zn(n) && await i(e), t("confirm-share", e, n);
|
|
4251
4260
|
} };
|
|
4252
4261
|
}
|
|
4253
4262
|
//#endregion
|
|
4254
4263
|
//#region src/components/composables/use-shortcuts.ts
|
|
4255
|
-
function
|
|
4264
|
+
function $n(e) {
|
|
4256
4265
|
let { props: t, emit: n, shortcutManager: i, doSendMessage: a, reportError: o, selectedShortcut: s } = e, c = r(() => i.value?.effectiveShortcuts.value ?? []), l = (e, t) => {
|
|
4257
4266
|
let n = e, r;
|
|
4258
4267
|
if (r = n.enable_fill_back && n.fill_back_component_key ? n.fill_back_component_key : n.components?.find((e) => e.fillBack)?.key, r && t) {
|
|
@@ -4346,7 +4355,7 @@ function Qn(e) {
|
|
|
4346
4355
|
}
|
|
4347
4356
|
//#endregion
|
|
4348
4357
|
//#region src/components/composables/use-tool-actions.ts
|
|
4349
|
-
function
|
|
4358
|
+
function er(e) {
|
|
4350
4359
|
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) => {
|
|
4351
4360
|
if (!r.value || !n.value) {
|
|
4352
4361
|
console.error("[ChatBot] Cannot delete messages: chatBusinessManager not initialized");
|
|
@@ -4518,7 +4527,7 @@ function $n(e) {
|
|
|
4518
4527
|
}
|
|
4519
4528
|
//#endregion
|
|
4520
4529
|
//#region src/components/chat-bot.vue
|
|
4521
|
-
var
|
|
4530
|
+
var tr = /* @__PURE__ */ d({
|
|
4522
4531
|
__name: "chat-bot",
|
|
4523
4532
|
props: {
|
|
4524
4533
|
alwaysCreateNewSession: { type: Boolean },
|
|
@@ -4616,15 +4625,15 @@ var er = /* @__PURE__ */ d({
|
|
|
4616
4625
|
set: () => {}
|
|
4617
4626
|
}), A = r(() => H.value?.selectedLlmCode.value), j = () => {
|
|
4618
4627
|
S.value?.focus?.();
|
|
4619
|
-
}, { reportError: N, managerErrorBridge: P } =
|
|
4628
|
+
}, { reportError: N, managerErrorBridge: P } = Hn(p, { errorToast: () => s.errorToast }), { chatHelper: F, isStandaloneMode: I, isInitialized: z, isReady: B, initError: te, whenReady: ne, chatBusinessManager: H, sessionBusinessManager: U, shortcutManager: W } = zn({
|
|
4620
4629
|
props: s,
|
|
4621
4630
|
emit: p,
|
|
4622
4631
|
reportError: N,
|
|
4623
4632
|
managerErrorBridge: P
|
|
4624
|
-
}), { handleInterruptResume: ie, resumeUserQuestionWithInput: G } =
|
|
4633
|
+
}), { handleInterruptResume: ie, resumeUserQuestionWithInput: G } = Yn({
|
|
4625
4634
|
chatHelper: F,
|
|
4626
4635
|
reportError: N
|
|
4627
|
-
}), { userInput: ae, cite: oe, handleUpdateModelValue: ce, doSendMessage: le, handleSendMessage: ue, handleUpload: de, handleArtifactClick: fe, handleStopSending: pe, stopGeneration: me } =
|
|
4636
|
+
}), { userInput: ae, cite: oe, handleUpdateModelValue: ce, doSendMessage: le, handleSendMessage: ue, handleUpload: de, handleArtifactClick: fe, handleStopSending: pe, stopGeneration: me } = Xn({
|
|
4628
4637
|
emit: p,
|
|
4629
4638
|
chatHelper: F,
|
|
4630
4639
|
chatBusinessManager: H,
|
|
@@ -4633,7 +4642,7 @@ var er = /* @__PURE__ */ d({
|
|
|
4633
4642
|
resumeUserQuestionWithInput: G,
|
|
4634
4643
|
selectedShortcut: E,
|
|
4635
4644
|
selectedResources: w
|
|
4636
|
-
}), { handleSelectShortcut: he, handleCloseShortcut: ge, handleShortcutSubmit: _e, selectShortcutWithText: ve, getShortcutFromMessage: ye, buildShortcutProperty: be, sendShortcutDirectly: K } =
|
|
4645
|
+
}), { handleSelectShortcut: he, handleCloseShortcut: ge, handleShortcutSubmit: _e, selectShortcutWithText: ve, getShortcutFromMessage: ye, buildShortcutProperty: be, sendShortcutDirectly: K } = $n({
|
|
4637
4646
|
props: s,
|
|
4638
4647
|
emit: p,
|
|
4639
4648
|
chatHelper: F,
|
|
@@ -4641,7 +4650,7 @@ var er = /* @__PURE__ */ d({
|
|
|
4641
4650
|
doSendMessage: le,
|
|
4642
4651
|
reportError: N,
|
|
4643
4652
|
selectedShortcut: E
|
|
4644
|
-
}), { messageStatus: q, messageToolsStatus: J, messages: xe, isMessagesLoading: Se, isGenerating: Ce, currentSession: we, isWelcomeState: Te, openingRemark: Ee, effectiveResources: Y, effectivePrompts: X, effectiveSkills: De, effectiveSupportUpload: Oe, chatbotStyle: ke, filteredShortcuts: Ae } =
|
|
4653
|
+
}), { messageStatus: q, messageToolsStatus: J, messages: xe, isMessagesLoading: Se, isGenerating: Ce, currentSession: we, isWelcomeState: Te, openingRemark: Ee, effectiveResources: Y, effectivePrompts: X, effectiveSkills: De, effectiveSupportUpload: Oe, chatbotStyle: ke, filteredShortcuts: Ae } = Bn({
|
|
4645
4654
|
props: s,
|
|
4646
4655
|
chatHelper: F,
|
|
4647
4656
|
chatBusinessManager: H,
|
|
@@ -4650,7 +4659,7 @@ var er = /* @__PURE__ */ d({
|
|
|
4650
4659
|
isStandaloneMode: I,
|
|
4651
4660
|
isInitialized: z,
|
|
4652
4661
|
selectedShortcut: E
|
|
4653
|
-
}), { handleAgentAction: Z, handleAgentFeedback: je, handleUserAction: Me, handleUserInputConfirm: Ne, handleUserShortcutConfirm: Pe, handleStopStreaming: Fe } =
|
|
4662
|
+
}), { handleAgentAction: Z, handleAgentFeedback: je, handleUserAction: Me, handleUserInputConfirm: Ne, handleUserShortcutConfirm: Pe, handleStopStreaming: Fe } = er({
|
|
4654
4663
|
emit: p,
|
|
4655
4664
|
chatHelper: F,
|
|
4656
4665
|
chatBusinessManager: H,
|
|
@@ -4678,7 +4687,7 @@ var er = /* @__PURE__ */ d({
|
|
|
4678
4687
|
L(() => s.models, (e) => {
|
|
4679
4688
|
s.enableModelSelect === !1 || !H.value || e?.length && H.value.setModels(e);
|
|
4680
4689
|
});
|
|
4681
|
-
let { handleConfirmShare: Q } =
|
|
4690
|
+
let { handleConfirmShare: Q } = Qn({
|
|
4682
4691
|
emit: p,
|
|
4683
4692
|
chatHelper: F,
|
|
4684
4693
|
isStandaloneMode: I
|
|
@@ -4831,13 +4840,13 @@ var er = /* @__PURE__ */ d({
|
|
|
4831
4840
|
key: "0"
|
|
4832
4841
|
} : void 0]), 1032, /* @__PURE__ */ "aside-collapsed.cite.render-mode.selected-model.selected-shortcut.chat-loading.common-tippy-options.execution-tab-visible.get-side-render-component.get-side-tab-render-component.message-status.message-tools.message-tools-status.messages.model-value.models.on-agent-action.on-agent-feedback.on-artifact-click.on-interrupt-resume.on-send-message.on-stop-sending.on-upload.on-user-action.on-user-input-confirm.on-user-shortcut-confirm.opening-remark.placeholder.prompts.resize-props.resources.shortcut-id.shortcuts.size.skills.timezone.support-upload.update-tools.welcome-title.onConfirmShare.onDeleteShortcut.onSelectShortcut.onShortcutClose.onShortcutSubmit.onStopStreaming.onUpdate:modelValue".split("."))], 6));
|
|
4833
4842
|
}
|
|
4834
|
-
}),
|
|
4843
|
+
}), nr = /* @__PURE__ */ function(e) {
|
|
4835
4844
|
return e.ERROR = "error", e.IDLE = "idle", e.LOADING_AGENT = "loading_agent", e.READY = "ready", e;
|
|
4836
4845
|
}({});
|
|
4837
|
-
function
|
|
4846
|
+
function rr(e) {
|
|
4838
4847
|
let { url: t, requestOptions: n, autoInit: i = !0, protocolCallbacks: a, enableModelSelect: o = !0 } = e, s = j(t);
|
|
4839
4848
|
if (!s) throw Error("[useChatBootstrap] url is required");
|
|
4840
|
-
let c = T(
|
|
4849
|
+
let c = T(nr.IDLE), l = T(null), u = T(!1), d = /* @__PURE__ */ new Map(), f = new Z({
|
|
4841
4850
|
onStart: () => {
|
|
4842
4851
|
a?.onStart?.();
|
|
4843
4852
|
},
|
|
@@ -4855,14 +4864,14 @@ function nr(e) {
|
|
|
4855
4864
|
protocol: f
|
|
4856
4865
|
});
|
|
4857
4866
|
f.injectMessageModule(p.message);
|
|
4858
|
-
let m = r(() => c.value ===
|
|
4867
|
+
let m = r(() => c.value === nr.LOADING_AGENT), h = r(() => c.value === nr.READY), g = r(() => p.agent.info.value ?? null), _ = r(() => g.value?.agentName ?? ""), v = r(() => p.session.current.value ?? null), y = r(() => p.session.list.value ?? []), b = null, x = 0, S = async (e) => {
|
|
4859
4868
|
l.value = null;
|
|
4860
4869
|
try {
|
|
4861
|
-
if (c.value =
|
|
4862
|
-
c.value =
|
|
4870
|
+
if (c.value = nr.LOADING_AGENT, await En(p, { enableModelSelect: o }), e !== x) return;
|
|
4871
|
+
c.value = nr.READY, u.value = !0;
|
|
4863
4872
|
} catch (t) {
|
|
4864
4873
|
if (e !== x) return;
|
|
4865
|
-
throw console.error("[useChatBootstrap] Initialization failed:", t), l.value = t, c.value =
|
|
4874
|
+
throw console.error("[useChatBootstrap] Initialization failed:", t), l.value = t, c.value = nr.ERROR, t;
|
|
4866
4875
|
}
|
|
4867
4876
|
}, C = async () => {
|
|
4868
4877
|
if (u.value) return;
|
|
@@ -4872,7 +4881,7 @@ function nr(e) {
|
|
|
4872
4881
|
e === x && (b = null);
|
|
4873
4882
|
}), b;
|
|
4874
4883
|
}, w = () => {
|
|
4875
|
-
x += 1, c.value =
|
|
4884
|
+
x += 1, c.value = nr.IDLE, l.value = null, u.value = !1, b = null;
|
|
4876
4885
|
}, E = async () => {
|
|
4877
4886
|
w(), await C();
|
|
4878
4887
|
}, D = async (e) => {
|
|
@@ -4906,7 +4915,7 @@ function nr(e) {
|
|
|
4906
4915
|
}
|
|
4907
4916
|
//#endregion
|
|
4908
4917
|
//#region src/composables/use-event-bridge.ts
|
|
4909
|
-
function
|
|
4918
|
+
function ir(e) {
|
|
4910
4919
|
return {
|
|
4911
4920
|
sendMessage: (t) => e("send-message", { content: t }),
|
|
4912
4921
|
receiveStart: () => e("receive-start", {}),
|
|
@@ -4927,12 +4936,12 @@ function rr(e) {
|
|
|
4927
4936
|
shareMessages: (t) => e("share-messages", { messageIds: t })
|
|
4928
4937
|
};
|
|
4929
4938
|
}
|
|
4930
|
-
function
|
|
4939
|
+
function ar(e) {
|
|
4931
4940
|
let { componentManager: t, emit: n, debug: r = !1 } = e, i = [], a = () => {
|
|
4932
|
-
for (let [e, a] of Object.entries(
|
|
4941
|
+
for (let [e, a] of Object.entries(Fn)) {
|
|
4933
4942
|
if (a === null) continue;
|
|
4934
4943
|
let o = t.on(e, (t) => {
|
|
4935
|
-
let i =
|
|
4944
|
+
let i = In(e, t);
|
|
4936
4945
|
r && console.debug(`[useEventBridge] ${e} -> ${a}`, i), n(a, ...i);
|
|
4937
4946
|
});
|
|
4938
4947
|
i.push(o);
|
|
@@ -4954,17 +4963,17 @@ function ir(e) {
|
|
|
4954
4963
|
}
|
|
4955
4964
|
//#endregion
|
|
4956
4965
|
//#region src/composables/use-ai-blueking-init.ts
|
|
4957
|
-
function
|
|
4958
|
-
let { props: t, emit: n } = e, i = T(), a = T(), o = r(() => zt(t.url ?? "")), s =
|
|
4966
|
+
function or(e) {
|
|
4967
|
+
let { props: t, emit: n } = e, i = T(), a = T(), o = r(() => zt(t.url ?? "")), s = Pn({
|
|
4959
4968
|
initialPanelVisible: !1,
|
|
4960
4969
|
initialNimbusMinimized: t.defaultMinimize,
|
|
4961
4970
|
enablePopup: t.enablePopup,
|
|
4962
4971
|
enableNimbus: !t.hideNimbus,
|
|
4963
4972
|
enableDraggable: t.draggable
|
|
4964
|
-
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } =
|
|
4973
|
+
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } = ar({
|
|
4965
4974
|
componentManager: s,
|
|
4966
4975
|
emit: n
|
|
4967
|
-
}), d =
|
|
4976
|
+
}), d = ir(u), f = /* @__PURE__ */ new WeakSet(), p = null, m = null, h = () => {
|
|
4968
4977
|
p &&= (clearTimeout(p.timer), null);
|
|
4969
4978
|
}, g = (e) => {
|
|
4970
4979
|
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;
|
|
@@ -5006,7 +5015,7 @@ function ar(e) {
|
|
|
5006
5015
|
error: e,
|
|
5007
5016
|
source: "business"
|
|
5008
5017
|
});
|
|
5009
|
-
}, { chatHelper: S, isReady: C, error: w, agentInfo: E, agentName: D, currentSession: O, initialize: k } =
|
|
5018
|
+
}, { chatHelper: S, isReady: C, error: w, agentInfo: E, agentName: D, currentSession: O, initialize: k } = rr({
|
|
5010
5019
|
url: o,
|
|
5011
5020
|
requestOptions: () => j(t.requestOptions),
|
|
5012
5021
|
autoInit: !0,
|
|
@@ -5033,7 +5042,7 @@ function ar(e) {
|
|
|
5033
5042
|
A.onError?.((e) => {
|
|
5034
5043
|
_(e);
|
|
5035
5044
|
}, { ignoreErrors: t.ignoreErrors });
|
|
5036
|
-
let M = new
|
|
5045
|
+
let M = new On(A.agent, A.session, { enabled: t.enableModelSelect !== !1 }), N = async () => {
|
|
5037
5046
|
if (t.enableModelSelect !== !1) {
|
|
5038
5047
|
if (t.models?.length) {
|
|
5039
5048
|
M.setModels(t.models);
|
|
@@ -5041,11 +5050,11 @@ function ar(e) {
|
|
|
5041
5050
|
}
|
|
5042
5051
|
await M.ensureLoaded();
|
|
5043
5052
|
}
|
|
5044
|
-
}, P = new
|
|
5053
|
+
}, P = new An(A.session, A.agent, null, {
|
|
5045
5054
|
enableChatSession: t.enableChatSession,
|
|
5046
5055
|
initialSessionCode: t.initialSessionCode,
|
|
5047
5056
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
5048
|
-
}, A.message, M), ee = new
|
|
5057
|
+
}, A.message, M), ee = new jn(A.message, A.session), F = new Mn(null, t.shortcuts || []), I = null, R = () => t.loadRecentSessionOnMount ? (I ||= N().then(() => P.loadRecentSession({ skipLoadSessions: !0 })).finally(() => {
|
|
5049
5058
|
I = null;
|
|
5050
5059
|
}), I) : Promise.resolve(), z = async () => {
|
|
5051
5060
|
await v("init", async () => {
|
|
@@ -5137,7 +5146,7 @@ function ar(e) {
|
|
|
5137
5146
|
}
|
|
5138
5147
|
//#endregion
|
|
5139
5148
|
//#region src/composables/use-ai-selection.ts
|
|
5140
|
-
function
|
|
5149
|
+
function sr(e) {
|
|
5141
5150
|
let { shortcutManager: t, chatBotRef: n, forwardToManager: i, show: a, props: o } = e, s = T(!1), c = T("");
|
|
5142
5151
|
return {
|
|
5143
5152
|
aiSelectionVisible: s,
|
|
@@ -5159,7 +5168,7 @@ function or(e) {
|
|
|
5159
5168
|
}
|
|
5160
5169
|
//#endregion
|
|
5161
5170
|
//#region src/composables/use-nimbus.ts
|
|
5162
|
-
function
|
|
5171
|
+
function cr(e, t = !1) {
|
|
5163
5172
|
let n = window.innerHeight - 48 - 40, r = window.innerWidth - 48 - 16, i = T(r), a = T(n), o = T(0), s = T(t), c = T(!1), l = T(!1), u = 0, d = (e) => {
|
|
5164
5173
|
e ? i.value = window.innerWidth - 12 : i.value = r;
|
|
5165
5174
|
}, f = (e, t) => {
|
|
@@ -5212,9 +5221,9 @@ function sr(e, t = !1) {
|
|
|
5212
5221
|
}
|
|
5213
5222
|
//#endregion
|
|
5214
5223
|
//#region src/composables/use-panel-container.ts
|
|
5215
|
-
var
|
|
5216
|
-
function
|
|
5217
|
-
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = T(!0), c =
|
|
5224
|
+
var lr = 560;
|
|
5225
|
+
function ur(e) {
|
|
5226
|
+
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = T(!0), c = lr, l = async (e) => {
|
|
5218
5227
|
t.showPanel(e), o && await o(), e && n.value && await n.value.switchSession(e);
|
|
5219
5228
|
}, u = async (e) => {
|
|
5220
5229
|
await l(e);
|
|
@@ -5241,7 +5250,7 @@ function lr(e) {
|
|
|
5241
5250
|
}, y = (e) => {
|
|
5242
5251
|
t.setCompressed(e);
|
|
5243
5252
|
}, b = (e, t) => {
|
|
5244
|
-
c = Math.max(
|
|
5253
|
+
c = Math.max(lr, t ?? c);
|
|
5245
5254
|
}, x = async () => {
|
|
5246
5255
|
s.value &&= (await t.expandForSidePanel(c, { onBeforeSizeChange: () => {
|
|
5247
5256
|
s.value = !1;
|
|
@@ -5316,7 +5325,7 @@ function lr(e) {
|
|
|
5316
5325
|
}
|
|
5317
5326
|
//#endregion
|
|
5318
5327
|
//#region src/composables/use-session-handlers.ts
|
|
5319
|
-
function
|
|
5328
|
+
function dr(e) {
|
|
5320
5329
|
let { chatHelper: t, sessionBusinessManager: n, chatBotRef: r, forwarders: i, reportSdkError: a, currentSession: o } = e, s = T(""), c = T(!0), l = T(!1), u = T(!1), d = () => Mt(t.message.list.value);
|
|
5321
5330
|
return L(() => o.value, (e) => {
|
|
5322
5331
|
e && (s.value = e.sessionName || "", l.value = (e.sessionContentCount ?? 0) > 0 || d());
|
|
@@ -5447,7 +5456,7 @@ function ur(e) {
|
|
|
5447
5456
|
}
|
|
5448
5457
|
//#endregion
|
|
5449
5458
|
//#region src/composables/use-share-handlers.ts
|
|
5450
|
-
function
|
|
5459
|
+
function fr(e) {
|
|
5451
5460
|
let { shareBusinessManager: t, chatBotRef: n, emit: r, forwarders: i, reportSdkError: a } = e, o = T(!1);
|
|
5452
5461
|
return {
|
|
5453
5462
|
isShareLoading: o,
|
|
@@ -5458,7 +5467,7 @@ function dr(e) {
|
|
|
5458
5467
|
n.value?.exitShareMode();
|
|
5459
5468
|
},
|
|
5460
5469
|
handleConfirmShare: async (e, s) => {
|
|
5461
|
-
if (!
|
|
5470
|
+
if (!Zn(s)) {
|
|
5462
5471
|
n.value?.exitShareMode(), r("confirm-share", e, s);
|
|
5463
5472
|
return;
|
|
5464
5473
|
}
|
|
@@ -5484,7 +5493,7 @@ function dr(e) {
|
|
|
5484
5493
|
}
|
|
5485
5494
|
//#endregion
|
|
5486
5495
|
//#region src/composables/use-tippy.ts
|
|
5487
|
-
function
|
|
5496
|
+
function pr(e = {}) {
|
|
5488
5497
|
let t = T([]), n = (n, r, i = {}) => {
|
|
5489
5498
|
try {
|
|
5490
5499
|
let a = typeof n == "string" ? document.querySelector(n) : n;
|
|
@@ -5537,7 +5546,7 @@ function fr(e = {}) {
|
|
|
5537
5546
|
}
|
|
5538
5547
|
//#endregion
|
|
5539
5548
|
//#region src/config/prop-defaults.ts
|
|
5540
|
-
var
|
|
5549
|
+
var mr = {
|
|
5541
5550
|
url: "",
|
|
5542
5551
|
title: "",
|
|
5543
5552
|
extCls: "",
|
|
@@ -5584,7 +5593,7 @@ var pr = {
|
|
|
5584
5593
|
defaultChatInputPosition: void 0,
|
|
5585
5594
|
errorToast: !0,
|
|
5586
5595
|
ignoreErrors: () => []
|
|
5587
|
-
},
|
|
5596
|
+
}, hr = class extends Z {
|
|
5588
5597
|
eventEmitter;
|
|
5589
5598
|
constructor(e = {}) {
|
|
5590
5599
|
super({
|
|
@@ -5613,7 +5622,7 @@ var pr = {
|
|
|
5613
5622
|
super.handleToolCallStartEvent(e), this.eventEmitter?.emit("tool-call-start", { event: e });
|
|
5614
5623
|
}
|
|
5615
5624
|
};
|
|
5616
|
-
function
|
|
5625
|
+
function gr(e = {}) {
|
|
5617
5626
|
let { eventEmitter: t, onStart: n, onMessage: r, onDone: i, onError: a, onTextChunk: o } = e;
|
|
5618
5627
|
return new Z({
|
|
5619
5628
|
onStart: () => {
|
|
@@ -5632,7 +5641,7 @@ function hr(e = {}) {
|
|
|
5632
5641
|
}
|
|
5633
5642
|
//#endregion
|
|
5634
5643
|
//#region src/containers/use-draggable.ts
|
|
5635
|
-
function
|
|
5644
|
+
function _r(e = {}, t) {
|
|
5636
5645
|
let n = e.initWidth || 400, r = e.minWidth || 400, i = e.minHeight || 400, a = e.maxWidthPercent || 40, o = e.compressedHeight || 800, s = e.compressedPadding === void 0 ? 0 : e.compressedPadding, c = T(e.defaultLeft === void 0 ? window.innerWidth - n : e.defaultLeft), l = T(e.defaultTop === void 0 ? 0 : e.defaultTop), u = T(e.defaultHeight === void 0 ? window.innerHeight - (e.defaultTop === void 0 ? 0 : e.defaultTop) : e.defaultHeight), d = T(n), f = T(l.value), p = T(c.value), m = T(d.value), h = T(u.value), _ = T(Math.max(window.innerWidth * (a / 100), m.value)), v = T(!1), y = T(0), S = null, C = null, w = 0, E = 0, D = T(!1), O = (e) => {
|
|
5637
5646
|
let t = window.innerWidth, n = { ...e };
|
|
5638
5647
|
return n.width > t && (n.width = t), n.x + n.width > t && (n.x = t - n.width), n.x < 0 && (n.x = 0), n;
|
|
@@ -5743,7 +5752,7 @@ function gr(e = {}, t) {
|
|
|
5743
5752
|
}
|
|
5744
5753
|
//#endregion
|
|
5745
5754
|
//#region src/containers/draggable-container.vue?vue&type=script&setup=true&lang.ts
|
|
5746
|
-
var
|
|
5755
|
+
var vr = { class: "draggable-container-content" }, yr = /* @__PURE__ */ $t(/* @__PURE__ */ d({
|
|
5747
5756
|
__name: "draggable-container",
|
|
5748
5757
|
props: {
|
|
5749
5758
|
className: { default: "" },
|
|
@@ -5780,7 +5789,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5780
5789
|
"compression-change"
|
|
5781
5790
|
],
|
|
5782
5791
|
setup(e, { expose: t, emit: n }) {
|
|
5783
|
-
let a = e, o = n, c = T(!1), { minWidth: l, minHeight: u, maxWidth: d, top: f, left: p, width: m, height: h, isCompressed: g, isSidePanelExpanded: v, handleDragging: b, handleResizing: x, handleDragStop: S, handleResizeStop: w, toggleCompression: E, updatePosition: D, updateSize: k, updatePositionAndSize: A, expandForSidePanel: j, collapseSidePanel: N, abortSidePanelSequence: P } =
|
|
5792
|
+
let a = e, o = n, c = T(!1), { minWidth: l, minHeight: u, maxWidth: d, top: f, left: p, width: m, height: h, isCompressed: g, isSidePanelExpanded: v, handleDragging: b, handleResizing: x, handleDragStop: S, handleResizeStop: w, toggleCompression: E, updatePosition: D, updateSize: k, updatePositionAndSize: A, expandForSidePanel: j, collapseSidePanel: N, abortSidePanelSequence: P } = _r({
|
|
5784
5793
|
initWidth: a.defaultWidth,
|
|
5785
5794
|
minWidth: a.minWidth,
|
|
5786
5795
|
minHeight: a.minHeight,
|
|
@@ -5857,7 +5866,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5857
5866
|
onResizeStop: U,
|
|
5858
5867
|
onResizing: ne
|
|
5859
5868
|
}, {
|
|
5860
|
-
default: R(() => [s("div",
|
|
5869
|
+
default: R(() => [s("div", vr, [O(e.$slots, "default", {}, void 0, !0)])]),
|
|
5861
5870
|
_: 3
|
|
5862
5871
|
}, 8, [
|
|
5863
5872
|
"active",
|
|
@@ -5875,11 +5884,11 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5875
5884
|
"y"
|
|
5876
5885
|
])), [[I, a.visible]]);
|
|
5877
5886
|
}
|
|
5878
|
-
}), [["__scopeId", "data-v-7417a71b"]]),
|
|
5887
|
+
}), [["__scopeId", "data-v-7417a71b"]]), br = { class: "nimbus-bkai-wrapper" }, xr = [
|
|
5879
5888
|
"width",
|
|
5880
5889
|
"height",
|
|
5881
5890
|
"src"
|
|
5882
|
-
],
|
|
5891
|
+
], Sr = /* @__PURE__ */ $t(/* @__PURE__ */ d({
|
|
5883
5892
|
name: "NimbusButton",
|
|
5884
5893
|
__name: "nimbus",
|
|
5885
5894
|
props: {
|
|
@@ -5931,11 +5940,11 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5931
5940
|
right: -6
|
|
5932
5941
|
}
|
|
5933
5942
|
}
|
|
5934
|
-
}, c = r(() => o[n.size]), l = T(null), u = T(null), { nimbusLeft: d, nimbusTop: f, isMinimize: p, handleClick: m, handleMinimize: h, handleDragging: v, handleMouseEnter: y, handleMouseLeave: S, handleMouseDown: w, handleMouseUp: E } =
|
|
5943
|
+
}, c = r(() => o[n.size]), l = T(null), u = T(null), { nimbusLeft: d, nimbusTop: f, isMinimize: p, handleClick: m, handleMinimize: h, handleDragging: v, handleMouseEnter: y, handleMouseLeave: S, handleMouseDown: w, handleMouseUp: E } = cr(a, n.isMinimize);
|
|
5935
5944
|
L(p, (e) => {
|
|
5936
5945
|
a("update:isMinimize", e);
|
|
5937
5946
|
});
|
|
5938
|
-
let D = r(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } =
|
|
5947
|
+
let D = r(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } = pr({
|
|
5939
5948
|
theme: "ai-blueking",
|
|
5940
5949
|
delay: [0, 0]
|
|
5941
5950
|
}), A = () => {
|
|
@@ -5977,12 +5986,12 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5977
5986
|
onMouseenter: n[3] ||= (...e) => M(y) && M(y)(...e),
|
|
5978
5987
|
onMouseleave: n[4] ||= (...e) => M(S) && M(S)(...e),
|
|
5979
5988
|
onMouseup: n[5] ||= (...e) => M(E) && M(E)(...e)
|
|
5980
|
-
}, [s("div",
|
|
5989
|
+
}, [s("div", br, [s("img", {
|
|
5981
5990
|
width: c.value.img,
|
|
5982
5991
|
height: c.value.img,
|
|
5983
5992
|
src: M(be),
|
|
5984
5993
|
alt: "nimbus"
|
|
5985
|
-
}, null, 8,
|
|
5994
|
+
}, null, 8, xr)]), s("i", {
|
|
5986
5995
|
ref_key: "minimizeButtonRef",
|
|
5987
5996
|
ref: u,
|
|
5988
5997
|
class: _(["nimbus-mini bkai-icon", M(p) ? "bkai-yinyong" : "bkai-minus-line"]),
|
|
@@ -5998,7 +6007,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
5998
6007
|
"onDragging"
|
|
5999
6008
|
]));
|
|
6000
6009
|
}
|
|
6001
|
-
}), [["__scopeId", "data-v-26b6f3ea"]]),
|
|
6010
|
+
}), [["__scopeId", "data-v-26b6f3ea"]]), Cr = /* @__PURE__ */ $t(/* @__PURE__ */ d({
|
|
6002
6011
|
inheritAttrs: !1,
|
|
6003
6012
|
__name: "ai-blueking",
|
|
6004
6013
|
props: /* @__PURE__ */ h({
|
|
@@ -6055,7 +6064,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6055
6064
|
resizeProps: {},
|
|
6056
6065
|
size: {},
|
|
6057
6066
|
timezone: {}
|
|
6058
|
-
},
|
|
6067
|
+
}, mr),
|
|
6059
6068
|
emits: [
|
|
6060
6069
|
"show",
|
|
6061
6070
|
"close",
|
|
@@ -6084,30 +6093,30 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6084
6093
|
"share"
|
|
6085
6094
|
],
|
|
6086
6095
|
setup(e, { expose: n, emit: o }) {
|
|
6087
|
-
let l = e, d = o, p = N(), { chatHelper: h, componentManager: g, modelSelection: b, sessionBusinessManager: x, shareBusinessManager: S, shortcutManager: w, forwarders: T, forwardToManager: E, chatBotRef: D, draggableContainerRef: k, panelVisible: A, nimbusMinimized: j, normalizedUrl: P, agentName: ee, currentSession: F, isCompressed: I, isWelcomeState: L, messageToolsTippyOptions: z, agentResources: B, agentPrompts: V, agentSkills: ne, handleError: H, reportSdkError: U, ensureSessionReady: W, updateAgentInfo: re } =
|
|
6096
|
+
let l = e, d = o, p = N(), { chatHelper: h, componentManager: g, modelSelection: b, sessionBusinessManager: x, shareBusinessManager: S, shortcutManager: w, forwarders: T, forwardToManager: E, chatBotRef: D, draggableContainerRef: k, panelVisible: A, nimbusMinimized: j, normalizedUrl: P, agentName: ee, currentSession: F, isCompressed: I, isWelcomeState: L, messageToolsTippyOptions: z, agentResources: B, agentPrompts: V, agentSkills: ne, handleError: H, reportSdkError: U, ensureSessionReady: W, updateAgentInfo: re } = or({
|
|
6088
6097
|
props: l,
|
|
6089
6098
|
emit: d
|
|
6090
|
-
}), ie = r(() => b.selectedLlmCode.value), { show: G, hide: ae, handleShow: oe, handleClose: se, handleNimbusClick: ce, handleDragging: le, handleResizing: ue, handleDragStop: de, handleResizeStop: fe, handleToggleCompression: pe, handleCompressionChange: me, handleExecutionPanelChange: he, handleToggleAside: ge, handleAsideCollapsedUpdate: _e, asideCollapsed: ve, sendMessage: ye, handleReceiveStart: be, handleReceiveText: K, handleReceiveEnd: q, handleStop: J, stopGeneration: xe, setCiteText: Se, focusInput: Ce, selectShortcut: we, sendShortcut: Te, getChatHelper: Ee, updatePosition: Y, updateSize: X, updatePositionAndSize: De, handleShortcutClick: Oe } =
|
|
6099
|
+
}), ie = r(() => b.selectedLlmCode.value), { show: G, hide: ae, handleShow: oe, handleClose: se, handleNimbusClick: ce, handleDragging: le, handleResizing: ue, handleDragStop: de, handleResizeStop: fe, handleToggleCompression: pe, handleCompressionChange: me, handleExecutionPanelChange: he, handleToggleAside: ge, handleAsideCollapsedUpdate: _e, asideCollapsed: ve, sendMessage: ye, handleReceiveStart: be, handleReceiveText: K, handleReceiveEnd: q, handleStop: J, stopGeneration: xe, setCiteText: Se, focusInput: Ce, selectShortcut: we, sendShortcut: Te, getChatHelper: Ee, updatePosition: Y, updateSize: X, updatePositionAndSize: De, handleShortcutClick: Oe } = ur({
|
|
6091
6100
|
componentManager: g,
|
|
6092
6101
|
chatBotRef: D,
|
|
6093
6102
|
forwarders: T,
|
|
6094
6103
|
forwardToManager: E,
|
|
6095
6104
|
beforeNimbusClick: l.beforeNimbusClick,
|
|
6096
6105
|
ensureSessionReady: W
|
|
6097
|
-
}), { sessionName: ke, hasPermission: Ae, hasSessionContents: Z, autoGenerateLoading: je, handleNewChat: Me, handleNewChatCreated: Ne, handleHistoryClick: Pe, handleHistorySessionSwitch: Fe, handleHistorySessionDelete: Ie, handleHistorySessionRename: Le, handleAutoGenerateName: Re, handleHelpClick: ze, handleRename: Be, handleSessionRenamed: Q, handleSessionSwitched: Ve, addNewSession: He, switchToSession: Ue, updateSessionName: We } =
|
|
6106
|
+
}), { sessionName: ke, hasPermission: Ae, hasSessionContents: Z, autoGenerateLoading: je, handleNewChat: Me, handleNewChatCreated: Ne, handleHistoryClick: Pe, handleHistorySessionSwitch: Fe, handleHistorySessionDelete: Ie, handleHistorySessionRename: Le, handleAutoGenerateName: Re, handleHelpClick: ze, handleRename: Be, handleSessionRenamed: Q, handleSessionSwitched: Ve, addNewSession: He, switchToSession: Ue, updateSessionName: We } = dr({
|
|
6098
6107
|
chatHelper: h,
|
|
6099
6108
|
sessionBusinessManager: x,
|
|
6100
6109
|
chatBotRef: D,
|
|
6101
6110
|
forwarders: T,
|
|
6102
6111
|
reportSdkError: U,
|
|
6103
6112
|
currentSession: F
|
|
6104
|
-
}), { isShareLoading: Ge, handleShare: Ke, handleCancelShare: qe, handleConfirmShare: Je } =
|
|
6113
|
+
}), { isShareLoading: Ge, handleShare: Ke, handleCancelShare: qe, handleConfirmShare: Je } = fr({
|
|
6105
6114
|
shareBusinessManager: S,
|
|
6106
6115
|
chatBotRef: D,
|
|
6107
6116
|
emit: (e, t, n) => d(e, t, n),
|
|
6108
6117
|
forwarders: T,
|
|
6109
6118
|
reportSdkError: U
|
|
6110
|
-
}), { aiSelectionVisible: Ye, filteredPopupShortcuts: Xe, handleSelectionChange: Ze, handleAiSelectionShortcut: Qe } =
|
|
6119
|
+
}), { aiSelectionVisible: Ye, filteredPopupShortcuts: Xe, handleSelectionChange: Ze, handleAiSelectionShortcut: Qe } = sr({
|
|
6111
6120
|
shortcutManager: w,
|
|
6112
6121
|
chatBotRef: D,
|
|
6113
6122
|
forwardToManager: E,
|
|
@@ -6141,7 +6150,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6141
6150
|
M(p).class
|
|
6142
6151
|
]) }, [
|
|
6143
6152
|
a(" 可拖拽容器 "),
|
|
6144
|
-
u(M(
|
|
6153
|
+
u(M(yr), {
|
|
6145
6154
|
ref_key: "draggableContainerRef",
|
|
6146
6155
|
ref: k,
|
|
6147
6156
|
"compressed-padding": l.miniPadding,
|
|
@@ -6162,7 +6171,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6162
6171
|
}, {
|
|
6163
6172
|
default: R(() => [s("div", { class: _(["ai-blueking-panel", { "has-messages": !M(L) }]) }, [
|
|
6164
6173
|
a(" 独立的 Header 组件 "),
|
|
6165
|
-
l.hideHeader ? a("v-if", !0) : (C(), i(
|
|
6174
|
+
l.hideHeader ? a("v-if", !0) : (C(), i(wn, {
|
|
6166
6175
|
key: 0,
|
|
6167
6176
|
"agent-name": M(ee),
|
|
6168
6177
|
"aside-collapsed": M(ve),
|
|
@@ -6202,7 +6211,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6202
6211
|
key: "0"
|
|
6203
6212
|
} : void 0]), 1032, /* @__PURE__ */ "agent-name.aside-collapsed.auto-generate-loading.chat-helper.draggable.dropdown-menu-config.enable-chat-session.has-permission.has-session-contents.is-compression-height.render-mode.selected-llm-code.session-business-manager.session-name.show-compression-icon.show-history-icon.show-more-icon.show-new-chat-icon.title.onAutoGenerateName.onClose.onHelpClick.onHistoryClick.onHistorySessionDelete.onHistorySessionRename.onHistorySessionSwitch.onNewChat.onNewChatCreated.onRename.onShare.onToggleAside.onToggleCompression".split("."))),
|
|
6204
6213
|
a(" ChatBot 核心组件(仅聊天区域) "),
|
|
6205
|
-
u(
|
|
6214
|
+
u(tr, {
|
|
6206
6215
|
ref_key: "chatBotRef",
|
|
6207
6216
|
ref: D,
|
|
6208
6217
|
"always-create-new-session": l.alwaysCreateNewSession,
|
|
@@ -6290,7 +6299,7 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6290
6299
|
"onResizing"
|
|
6291
6300
|
]),
|
|
6292
6301
|
a(" Nimbus 悬浮球 "),
|
|
6293
|
-
l.hideNimbus ? a("v-if", !0) : (C(), i(
|
|
6302
|
+
l.hideNimbus ? a("v-if", !0) : (C(), i(Sr, {
|
|
6294
6303
|
key: 0,
|
|
6295
6304
|
"is-minimize": M(j),
|
|
6296
6305
|
"onUpdate:isMinimize": n[5] ||= (e) => m(j) ? j.value = e : null,
|
|
@@ -6327,4 +6336,4 @@ var _r = { class: "draggable-container-content" }, vr = /* @__PURE__ */ $t(/* @_
|
|
|
6327
6336
|
}
|
|
6328
6337
|
}), [["__scopeId", "data-v-133cd210"]]);
|
|
6329
6338
|
//#endregion
|
|
6330
|
-
export { Z as AGUIProtocol,
|
|
6339
|
+
export { Z as AGUIProtocol, Cr as AIBlueking, Cr as default, hr as BluekingProtocol, nr as BootstrapPhase, tr as ChatBot, kn as ChatBusinessManager, Nn as ComponentManager, yr as DraggableContainer, W as MessageContentType, oe as RenderMode, An as SessionBusinessManager, Mn as ShortcutManager, Ln as UIStateManager, gr as createBluekingProtocol, Pn as createComponentManager, mr as defaultProps, Ft as parseCustomBlocks, rr as useChatBootstrap, Et as useChatHelper, _r as useDraggable };
|