@blueking/ai-blueking 2.2.4-beta.8 → 2.2.4-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/ai-blueking.vue.d.ts +1 -0
- package/dist/ai-blueking.vue.d.ts.map +1 -1
- package/dist/components/ai-header/index.vue.d.ts +1 -0
- package/dist/components/ai-header/index.vue.d.ts.map +1 -1
- package/dist/standalone/index.es.min.js +200 -192
- package/dist/standalone/index.iife.min.js +3 -3
- package/dist/standalone/index.umd.min.js +3 -3
- package/dist/standalone/style.css +1 -1
- package/dist/vue2/index.es.min.js +201 -192
- 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 +138 -130
- package/dist/vue3/index.iife.min.js +3 -3
- package/dist/vue3/index.umd.min.js +3 -3
- package/dist/vue3/style.css +1 -1
- package/package.json +1 -1
|
@@ -2690,10 +2690,13 @@ var Cn = { class: "left-section" }, wn = { class: "logo" }, Tn = ["src"], En = {
|
|
|
2690
2690
|
key: 1,
|
|
2691
2691
|
class: "bkai-icon bkai-auto-refresh-line"
|
|
2692
2692
|
}, An = { class: "right-section" }, jn = {
|
|
2693
|
-
key:
|
|
2693
|
+
key: 3,
|
|
2694
|
+
class: "header-actions"
|
|
2695
|
+
}, Mn = {
|
|
2696
|
+
key: 5,
|
|
2694
2697
|
"aria-hidden": "true",
|
|
2695
2698
|
class: "header-toolbar-divider"
|
|
2696
|
-
},
|
|
2699
|
+
}, Nn = /* @__PURE__ */ cn(/* @__PURE__ */ d({
|
|
2697
2700
|
__name: "index",
|
|
2698
2701
|
props: {
|
|
2699
2702
|
agentName: { default: "" },
|
|
@@ -2984,8 +2987,9 @@ var Cn = { class: "left-section" }, wn = { class: "logo" }, Tn = ["src"], En = {
|
|
|
2984
2987
|
content: M($)("转人工"),
|
|
2985
2988
|
boundary: "parent"
|
|
2986
2989
|
}]]) : a("v-if", !0),
|
|
2990
|
+
t.$slots.headerActions ? (C(), o("div", jn, [O(t.$slots, "headerActions", {}, void 0, !0)])) : a("v-if", !0),
|
|
2987
2991
|
f.showCompressionIcon ? z((C(), o("i", {
|
|
2988
|
-
key:
|
|
2992
|
+
key: 4,
|
|
2989
2993
|
class: _(["bkai-icon", I.value]),
|
|
2990
2994
|
onClick: n[5] ||= (e) => p("toggle-compression")
|
|
2991
2995
|
}, null, 2)), [[M(h), {
|
|
@@ -3000,9 +3004,9 @@ var Cn = { class: "left-section" }, wn = { class: "logo" }, Tn = ["src"], En = {
|
|
|
3000
3004
|
boundary: "parent"
|
|
3001
3005
|
}]]),
|
|
3002
3006
|
a(" 设计稿:关闭与侧栏展开之间有竖线分隔 "),
|
|
3003
|
-
f.showAsideToggle ? (C(), o("span",
|
|
3007
|
+
f.showAsideToggle ? (C(), o("span", Mn)) : a("v-if", !0),
|
|
3004
3008
|
f.showAsideToggle ? z((C(), o("span", {
|
|
3005
|
-
key:
|
|
3009
|
+
key: 6,
|
|
3006
3010
|
class: "bkai-icon aside-toggle",
|
|
3007
3011
|
onClick: n[7] ||= B((e) => p("toggle-aside"), ["stop"])
|
|
3008
3012
|
}, [u(M(m))])), [[M(h), {
|
|
@@ -3012,31 +3016,31 @@ var Cn = { class: "left-section" }, wn = { class: "logo" }, Tn = ["src"], En = {
|
|
|
3012
3016
|
])
|
|
3013
3017
|
], 2));
|
|
3014
3018
|
}
|
|
3015
|
-
}), [["__scopeId", "data-v-
|
|
3019
|
+
}), [["__scopeId", "data-v-c3948a0e"]]);
|
|
3016
3020
|
//#endregion
|
|
3017
3021
|
//#region src/bootstrap/agent-bootstrap.ts
|
|
3018
|
-
function
|
|
3022
|
+
function Pn(e) {
|
|
3019
3023
|
let t = qt(e);
|
|
3020
3024
|
fetch(t, {
|
|
3021
3025
|
method: "GET",
|
|
3022
3026
|
credentials: "include"
|
|
3023
3027
|
}).catch(() => {});
|
|
3024
3028
|
}
|
|
3025
|
-
async function
|
|
3029
|
+
async function Fn(e, t = {}) {
|
|
3026
3030
|
let { enableModelSelect: n = !0 } = t, r = [e.agent.getAgentInfo(), e.session.getSessions()];
|
|
3027
3031
|
n && typeof e.agent.getLlms == "function" && r.push(e.agent.getLlms().catch((e) => {
|
|
3028
3032
|
console.error("[runAgentBootstrap] Failed to load models:", e);
|
|
3029
3033
|
})), await Promise.all(r);
|
|
3030
3034
|
let i = e.agent.info.value?.saasUrl;
|
|
3031
|
-
i &&
|
|
3035
|
+
i && Pn(i);
|
|
3032
3036
|
}
|
|
3033
3037
|
//#endregion
|
|
3034
3038
|
//#region src/manager/business/model-selection-manager.ts
|
|
3035
|
-
var
|
|
3039
|
+
var In = class extends Error {
|
|
3036
3040
|
constructor(e = "当前没有可用模型,无法创建会话") {
|
|
3037
3041
|
super(e), this.name = "ModelUnavailableError";
|
|
3038
3042
|
}
|
|
3039
|
-
},
|
|
3043
|
+
}, Ln = class {
|
|
3040
3044
|
_isLoading;
|
|
3041
3045
|
_models;
|
|
3042
3046
|
_selectedLlmCode;
|
|
@@ -3141,7 +3145,7 @@ var Fn = class extends Error {
|
|
|
3141
3145
|
resolveModelForSession(e) {
|
|
3142
3146
|
if (!this.enabled) return e;
|
|
3143
3147
|
let t = this._models.value;
|
|
3144
|
-
if (t.length === 0) throw new
|
|
3148
|
+
if (t.length === 0) throw new In();
|
|
3145
3149
|
return e && t.some((t) => t.llm_code === e) ? e : this.hasValidSelection() ? this._selectedLlmCode.value : this.defaultModelCode();
|
|
3146
3150
|
}
|
|
3147
3151
|
setModels(e) {
|
|
@@ -3157,7 +3161,7 @@ var Fn = class extends Error {
|
|
|
3157
3161
|
}
|
|
3158
3162
|
this._selectedLlmCode.value = this._models.value.find((t) => t.llm_name === e)?.llm_code;
|
|
3159
3163
|
}
|
|
3160
|
-
},
|
|
3164
|
+
}, Rn = class {
|
|
3161
3165
|
_isGenerating;
|
|
3162
3166
|
_isStopLoading;
|
|
3163
3167
|
agentModule;
|
|
@@ -3192,7 +3196,7 @@ var Fn = class extends Error {
|
|
|
3192
3196
|
this.eventEmitter?.emit(e, t);
|
|
3193
3197
|
}
|
|
3194
3198
|
constructor(e, t, n = null, r = null, i = {}, a) {
|
|
3195
|
-
this.agentModule = e, this.messageModule = t, this.sessionModule = n, this.eventEmitter = r, this.config = i, this.modelSelection = a ?? new
|
|
3199
|
+
this.agentModule = e, this.messageModule = t, this.sessionModule = n, this.eventEmitter = r, this.config = i, this.modelSelection = a ?? new Ln(e, n), this._isGenerating = T(!1), this._isStopLoading = T(!1);
|
|
3196
3200
|
}
|
|
3197
3201
|
get isGenerating() {
|
|
3198
3202
|
return this._isGenerating;
|
|
@@ -3360,7 +3364,7 @@ var Fn = class extends Error {
|
|
|
3360
3364
|
this._isStopLoading.value = !1;
|
|
3361
3365
|
}
|
|
3362
3366
|
}
|
|
3363
|
-
},
|
|
3367
|
+
}, zn = class {
|
|
3364
3368
|
agentModule;
|
|
3365
3369
|
config;
|
|
3366
3370
|
eventEmitter;
|
|
@@ -3374,7 +3378,7 @@ var Fn = class extends Error {
|
|
|
3374
3378
|
return await this.modelSelection.ensureLoaded(), this.modelSelection.resolveModelForSession(e);
|
|
3375
3379
|
}
|
|
3376
3380
|
constructor(e, t = null, n = null, r = {}, i = null, a) {
|
|
3377
|
-
this.sessionModule = e, this.agentModule = t, this.eventEmitter = n, this.config = r, this.messageModule = i, this.modelSelection = a ?? new
|
|
3381
|
+
this.sessionModule = e, this.agentModule = t, this.eventEmitter = n, this.config = r, this.messageModule = i, this.modelSelection = a ?? new Ln(t, e, { enabled: !1 });
|
|
3378
3382
|
}
|
|
3379
3383
|
get currentSession() {
|
|
3380
3384
|
return this.sessionModule.current;
|
|
@@ -3545,7 +3549,7 @@ var Fn = class extends Error {
|
|
|
3545
3549
|
}), e;
|
|
3546
3550
|
}
|
|
3547
3551
|
}
|
|
3548
|
-
},
|
|
3552
|
+
}, Bn = class {
|
|
3549
3553
|
messageModule;
|
|
3550
3554
|
sessionModule;
|
|
3551
3555
|
constructor(e, t) {
|
|
@@ -3562,7 +3566,7 @@ var Fn = class extends Error {
|
|
|
3562
3566
|
userMessageIds: e.map((e) => String(e.id))
|
|
3563
3567
|
};
|
|
3564
3568
|
}
|
|
3565
|
-
},
|
|
3569
|
+
}, Vn = class {
|
|
3566
3570
|
_agentShortcuts;
|
|
3567
3571
|
_effectiveShortcuts;
|
|
3568
3572
|
_propsShortcuts;
|
|
@@ -3619,7 +3623,7 @@ var Fn = class extends Error {
|
|
|
3619
3623
|
setShortcuts(e) {
|
|
3620
3624
|
this._propsShortcuts.value = e;
|
|
3621
3625
|
}
|
|
3622
|
-
},
|
|
3626
|
+
}, Hn = class {
|
|
3623
3627
|
_isCompressed;
|
|
3624
3628
|
_isDraggingOrResizing;
|
|
3625
3629
|
_nimbusMinimized;
|
|
@@ -3838,12 +3842,12 @@ var Fn = class extends Error {
|
|
|
3838
3842
|
};
|
|
3839
3843
|
}
|
|
3840
3844
|
};
|
|
3841
|
-
function
|
|
3842
|
-
return new
|
|
3845
|
+
function Un(e) {
|
|
3846
|
+
return new Hn(e);
|
|
3843
3847
|
}
|
|
3844
3848
|
//#endregion
|
|
3845
3849
|
//#region src/manager/event-types.ts
|
|
3846
|
-
var
|
|
3850
|
+
var Wn = {
|
|
3847
3851
|
"panel-show": "show",
|
|
3848
3852
|
"panel-hide": "close",
|
|
3849
3853
|
"panel-toggle": null,
|
|
@@ -3893,7 +3897,7 @@ var Un = {
|
|
|
3893
3897
|
"agent-info-loaded": null,
|
|
3894
3898
|
error: null
|
|
3895
3899
|
};
|
|
3896
|
-
function
|
|
3900
|
+
function Gn(e, t) {
|
|
3897
3901
|
switch (e) {
|
|
3898
3902
|
case "send-message": return [t.content];
|
|
3899
3903
|
case "rename": return [t.newName, t.sessionCode];
|
|
@@ -3924,7 +3928,7 @@ function Wn(e, t) {
|
|
|
3924
3928
|
}
|
|
3925
3929
|
//#endregion
|
|
3926
3930
|
//#region src/manager/ui/ui-state-manager.ts
|
|
3927
|
-
var
|
|
3931
|
+
var Kn = class {
|
|
3928
3932
|
_selectedMessageIds;
|
|
3929
3933
|
_isSelectionMode;
|
|
3930
3934
|
_editingSessionCode;
|
|
@@ -3997,12 +4001,12 @@ var Gn = class {
|
|
|
3997
4001
|
reset() {
|
|
3998
4002
|
this.clearSelection(), this.disableSelectionMode(), this.stopEditingSession(), this.clearLoadingStates();
|
|
3999
4003
|
}
|
|
4000
|
-
},
|
|
4004
|
+
}, qn = class extends Error {
|
|
4001
4005
|
constructor() {
|
|
4002
4006
|
super("[ChatBot] Initialization was superseded by a newer init"), this.name = "ChatBotInitStaleError";
|
|
4003
4007
|
}
|
|
4004
4008
|
};
|
|
4005
|
-
function
|
|
4009
|
+
function Jn(e) {
|
|
4006
4010
|
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 ? {
|
|
4007
4011
|
valid: !1,
|
|
4008
4012
|
error: "[ChatBot] Invalid chatHelper: missing required modules (agent, session, message)"
|
|
@@ -4038,7 +4042,7 @@ function qn(e) {
|
|
|
4038
4042
|
}, _ = 0, v = null, y = null, x = null, S = (e) => {
|
|
4039
4043
|
x &&= (e ? x.reject(e) : x.resolve(), null), v = null;
|
|
4040
4044
|
}, C = (e) => {
|
|
4041
|
-
if (e !== _) throw new
|
|
4045
|
+
if (e !== _) throw new qn();
|
|
4042
4046
|
}, w = async (e) => {
|
|
4043
4047
|
if (t.enableModelSelect !== !1) {
|
|
4044
4048
|
if (t.models?.length) {
|
|
@@ -4052,26 +4056,26 @@ function qn(e) {
|
|
|
4052
4056
|
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;
|
|
4053
4057
|
let p = h();
|
|
4054
4058
|
if (!p) throw f.value ?? /* @__PURE__ */ Error("[ChatBot] Failed to create chatHelper");
|
|
4055
|
-
let m = t.modelSelectionManager ?? new
|
|
4059
|
+
let m = t.modelSelectionManager ?? new Ln(p.agent, p.session, { enabled: t.enableModelSelect !== !1 }), _ = new zn(p.session, p.agent, a, {
|
|
4056
4060
|
enableChatSession: !0,
|
|
4057
4061
|
autoSwitchToInitialSession: !!t.sessionCode,
|
|
4058
4062
|
loadRecentSessionOnMount: t.autoLoad,
|
|
4059
4063
|
initialSessionCode: t.sessionCode,
|
|
4060
4064
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
4061
|
-
}, p.message, m), v = new
|
|
4065
|
+
}, p.message, m), v = new Rn(p.agent, p.message, p.session, a, {
|
|
4062
4066
|
openingRemark: t.helloText,
|
|
4063
4067
|
predefinedQuestions: t.prompts,
|
|
4064
4068
|
placeholder: t.placeholder,
|
|
4065
4069
|
onSessionRenamed: (e, t) => n("rename", e, t)
|
|
4066
|
-
}, m), y = new
|
|
4070
|
+
}, m), y = new Vn(null, t.shortcuts || []);
|
|
4067
4071
|
o.value = p, s.value = _, c.value = v, l.value = y;
|
|
4068
4072
|
try {
|
|
4069
|
-
d.value ? (await
|
|
4073
|
+
d.value ? (await Fn(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);
|
|
4070
4074
|
} catch (t) {
|
|
4071
4075
|
throw C(e), f.value = i(t, "Failed to initialize ChatBot"), t;
|
|
4072
4076
|
}
|
|
4073
4077
|
}, D = () => {
|
|
4074
|
-
S(new
|
|
4078
|
+
S(new qn()), y = null;
|
|
4075
4079
|
let e = ++_;
|
|
4076
4080
|
v = new Promise((t, n) => {
|
|
4077
4081
|
x = {
|
|
@@ -4102,24 +4106,24 @@ function qn(e) {
|
|
|
4102
4106
|
}
|
|
4103
4107
|
//#endregion
|
|
4104
4108
|
//#region src/components/composables/use-chatbot-state.ts
|
|
4105
|
-
var
|
|
4109
|
+
var Yn = [{
|
|
4106
4110
|
id: "rebuild",
|
|
4107
4111
|
hidden: !0
|
|
4108
|
-
}],
|
|
4112
|
+
}], Xn = [{
|
|
4109
4113
|
id: "delete",
|
|
4110
4114
|
hidden: !0
|
|
4111
|
-
}],
|
|
4115
|
+
}], Zn = [{
|
|
4112
4116
|
id: "edit",
|
|
4113
4117
|
hidden: !0
|
|
4114
4118
|
}, {
|
|
4115
4119
|
id: "delete",
|
|
4116
4120
|
hidden: !0
|
|
4117
4121
|
}];
|
|
4118
|
-
function
|
|
4122
|
+
function Qn(e, t, n) {
|
|
4119
4123
|
return e ? [...n, ...t ?? []] : t;
|
|
4120
4124
|
}
|
|
4121
|
-
function
|
|
4122
|
-
let { props: t, chatHelper: n, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = r(() => i.value?.isStopLoading.value ? ie.StopLoading : ((t.chatHelper || n.value)?.agent)?.isChatting?.value ? ie.Streaming : ie.Complete), d = r(() => u.value === ie.Streaming ? ae.Disabled : void 0), f = r(() => ((t.chatHelper || n.value)?.agent)?.info.value?.agentType === "claw"), p = r(() =>
|
|
4125
|
+
function $n(e) {
|
|
4126
|
+
let { props: t, chatHelper: n, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = r(() => i.value?.isStopLoading.value ? ie.StopLoading : ((t.chatHelper || n.value)?.agent)?.isChatting?.value ? ie.Streaming : ie.Complete), d = r(() => u.value === ie.Streaming ? ae.Disabled : void 0), f = r(() => ((t.chatHelper || n.value)?.agent)?.info.value?.agentType === "claw"), p = r(() => Qn(f.value, t.messageTools, Yn)), m = r(() => Qn(f.value, t.updateTools, Xn)), h = r(() => Qn(f.value, void 0, Zn)), g = r(() => i.value?.messages.value ?? []), _ = r(() => i.value?.isMessagesLoading.value ?? !1);
|
|
4123
4127
|
return {
|
|
4124
4128
|
messageStatus: u,
|
|
4125
4129
|
messageToolsStatus: d,
|
|
@@ -4150,12 +4154,12 @@ function Qn(e) {
|
|
|
4150
4154
|
}
|
|
4151
4155
|
//#endregion
|
|
4152
4156
|
//#region src/components/composables/use-error-reporter.ts
|
|
4153
|
-
var
|
|
4157
|
+
var er = new Set([
|
|
4154
4158
|
"chat-error",
|
|
4155
4159
|
"receive-error",
|
|
4156
4160
|
"session-error"
|
|
4157
4161
|
]);
|
|
4158
|
-
function
|
|
4162
|
+
function tr(e, t = {}) {
|
|
4159
4163
|
let n = /* @__PURE__ */ new WeakSet(), r = (r, i) => {
|
|
4160
4164
|
let a = Wt(r);
|
|
4161
4165
|
return n.has(a) ? a : (n.add(a), console.error(i ? `[ChatBot] ${i}:` : "[ChatBot] error:", r), e("error", a), j(t.errorToast) !== !1 && de({
|
|
@@ -4165,50 +4169,50 @@ function er(e, t = {}) {
|
|
|
4165
4169
|
};
|
|
4166
4170
|
return {
|
|
4167
4171
|
managerErrorBridge: { emit: (e, t) => {
|
|
4168
|
-
|
|
4172
|
+
er.has(e) && r(t?.error);
|
|
4169
4173
|
} },
|
|
4170
4174
|
reportError: r
|
|
4171
4175
|
};
|
|
4172
4176
|
}
|
|
4173
4177
|
//#endregion
|
|
4174
4178
|
//#region src/components/composables/use-interrupt-resume.ts
|
|
4175
|
-
var
|
|
4179
|
+
var nr = {
|
|
4176
4180
|
[U.ApprovalCancel]: Se.ApprovalCancel,
|
|
4177
4181
|
[U.FlowNodeRetry]: Se.FlowNodeRetry,
|
|
4178
4182
|
[U.FlowNodeSkip]: Se.FlowNodeSkip
|
|
4179
4183
|
};
|
|
4180
|
-
function
|
|
4184
|
+
function rr(e) {
|
|
4181
4185
|
return "operation" in e;
|
|
4182
4186
|
}
|
|
4183
|
-
function
|
|
4187
|
+
function ir(e) {
|
|
4184
4188
|
return "interruptId" in e && "reason" in e && e.reason === ne.UserQuestion;
|
|
4185
4189
|
}
|
|
4186
|
-
function
|
|
4190
|
+
function ar(e) {
|
|
4187
4191
|
return e === "cancelled" ? Ae.Cancelled : Ae.Resolved;
|
|
4188
4192
|
}
|
|
4189
|
-
function
|
|
4193
|
+
function or(e) {
|
|
4190
4194
|
let t = e?.session.current?.value?.sessionCode;
|
|
4191
4195
|
if (!t) throw Error("[ChatBot] Cannot resume interrupt: no active session");
|
|
4192
4196
|
return t;
|
|
4193
4197
|
}
|
|
4194
|
-
function
|
|
4198
|
+
function sr(e) {
|
|
4195
4199
|
return {
|
|
4196
4200
|
interruptId: e.interruptId,
|
|
4197
|
-
status:
|
|
4201
|
+
status: ar(e.status),
|
|
4198
4202
|
payload: e.payload
|
|
4199
4203
|
};
|
|
4200
4204
|
}
|
|
4201
|
-
function
|
|
4205
|
+
function cr(e) {
|
|
4202
4206
|
let { chatHelper: t, reportError: n } = e, r = async (e) => {
|
|
4203
4207
|
let n = t.value;
|
|
4204
4208
|
if (!n) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
4205
|
-
if (!
|
|
4206
|
-
let r =
|
|
4209
|
+
if (!rr(e)) throw Error("[ChatBot] Unsupported interrupt resume payload");
|
|
4210
|
+
let r = or(n);
|
|
4207
4211
|
if (e.operation === U.ApprovalRefresh) {
|
|
4208
4212
|
n.agent.pollResumeSession(r);
|
|
4209
4213
|
return;
|
|
4210
4214
|
}
|
|
4211
|
-
let i =
|
|
4215
|
+
let i = nr[e.operation];
|
|
4212
4216
|
if (!i) throw Error(`[ChatBot] Unsupported interrupt resume operation: ${e.operation}`);
|
|
4213
4217
|
let a = n.agent;
|
|
4214
4218
|
if (e.operation === U.ApprovalCancel) {
|
|
@@ -4222,21 +4226,21 @@ function sr(e) {
|
|
|
4222
4226
|
}, i = async (e, n) => {
|
|
4223
4227
|
let r = t.value;
|
|
4224
4228
|
if (!r) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
4225
|
-
let i =
|
|
4229
|
+
let i = or(r);
|
|
4226
4230
|
await r.agent.streamRequest({
|
|
4227
4231
|
sessionCode: i,
|
|
4228
|
-
resume:
|
|
4232
|
+
resume: sr(e),
|
|
4229
4233
|
...n ? { input: n } : {}
|
|
4230
4234
|
});
|
|
4231
4235
|
};
|
|
4232
4236
|
return {
|
|
4233
4237
|
handleInterruptResume: async (e, t) => {
|
|
4234
4238
|
try {
|
|
4235
|
-
if (
|
|
4239
|
+
if (rr(e)) {
|
|
4236
4240
|
await r(e);
|
|
4237
4241
|
return;
|
|
4238
4242
|
}
|
|
4239
|
-
if (
|
|
4243
|
+
if (ir(e)) {
|
|
4240
4244
|
await i(e);
|
|
4241
4245
|
return;
|
|
4242
4246
|
}
|
|
@@ -4247,7 +4251,7 @@ function sr(e) {
|
|
|
4247
4251
|
},
|
|
4248
4252
|
resumeUserQuestionWithInput: async (e, t) => {
|
|
4249
4253
|
try {
|
|
4250
|
-
if (!t.payload || !
|
|
4254
|
+
if (!t.payload || !ir(t.payload)) throw Error("[ChatBot] Invalid user question resume options");
|
|
4251
4255
|
let n = typeof e == "string" ? e.trim() : "";
|
|
4252
4256
|
if (!n) throw Error("[ChatBot] User question free text input is empty");
|
|
4253
4257
|
await i(t.payload, n);
|
|
@@ -4259,7 +4263,7 @@ function sr(e) {
|
|
|
4259
4263
|
}
|
|
4260
4264
|
//#endregion
|
|
4261
4265
|
//#region src/components/composables/use-message-sender.ts
|
|
4262
|
-
function
|
|
4266
|
+
function lr(e) {
|
|
4263
4267
|
let { emit: t, chatHelper: n, chatBusinessManager: r, getRequestOptions: i, reportError: a, resumeUserQuestionWithInput: o, selectedShortcut: s, selectedResources: c } = e, l = k([[]]), u = k("");
|
|
4264
4268
|
L(() => n.value?.session.current?.value?.sessionCode, (e, t) => {
|
|
4265
4269
|
t && t !== e && (u.value = "");
|
|
@@ -4328,11 +4332,11 @@ function cr(e) {
|
|
|
4328
4332
|
}
|
|
4329
4333
|
//#endregion
|
|
4330
4334
|
//#region src/components/composables/use-share-selection.ts
|
|
4331
|
-
var
|
|
4332
|
-
function
|
|
4335
|
+
var ur = (e) => !e || e.id === "share";
|
|
4336
|
+
function dr(e) {
|
|
4333
4337
|
let { emit: t, chatHelper: n, isStandaloneMode: r } = e, i = async (e) => {
|
|
4334
4338
|
if (!(!n.value || e.length === 0)) try {
|
|
4335
|
-
await Jt((await new
|
|
4339
|
+
await Jt((await new Bn(n.value.message, n.value.session).shareMessages(e)).shareUrl), de({
|
|
4336
4340
|
message: "分享链接已复制到剪贴板",
|
|
4337
4341
|
theme: "success"
|
|
4338
4342
|
});
|
|
@@ -4344,12 +4348,12 @@ function ur(e) {
|
|
|
4344
4348
|
}
|
|
4345
4349
|
};
|
|
4346
4350
|
return { handleConfirmShare: async (e, n) => {
|
|
4347
|
-
r.value &&
|
|
4351
|
+
r.value && ur(n) && await i(e), t("confirm-share", e, n);
|
|
4348
4352
|
} };
|
|
4349
4353
|
}
|
|
4350
4354
|
//#endregion
|
|
4351
4355
|
//#region src/components/composables/use-shortcuts.ts
|
|
4352
|
-
function
|
|
4356
|
+
function fr(e) {
|
|
4353
4357
|
let { props: t, emit: n, shortcutManager: i, doSendMessage: a, reportError: o, selectedShortcut: s } = e, c = r(() => i.value?.effectiveShortcuts.value ?? []), l = (e, t) => {
|
|
4354
4358
|
let n = e, r;
|
|
4355
4359
|
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) {
|
|
@@ -4443,7 +4447,7 @@ function dr(e) {
|
|
|
4443
4447
|
}
|
|
4444
4448
|
//#endregion
|
|
4445
4449
|
//#region src/components/composables/use-tool-actions.ts
|
|
4446
|
-
function
|
|
4450
|
+
function pr(e) {
|
|
4447
4451
|
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) => {
|
|
4448
4452
|
if (!r.value || !n.value) {
|
|
4449
4453
|
console.error("[ChatBot] Cannot delete messages: chatBusinessManager not initialized");
|
|
@@ -4615,7 +4619,7 @@ function fr(e) {
|
|
|
4615
4619
|
}
|
|
4616
4620
|
//#endregion
|
|
4617
4621
|
//#region src/components/chat-bot.vue
|
|
4618
|
-
var
|
|
4622
|
+
var mr = /* @__PURE__ */ d({
|
|
4619
4623
|
__name: "chat-bot",
|
|
4620
4624
|
props: {
|
|
4621
4625
|
alwaysCreateNewSession: { type: Boolean },
|
|
@@ -4716,15 +4720,15 @@ var pr = /* @__PURE__ */ d({
|
|
|
4716
4720
|
set: () => {}
|
|
4717
4721
|
}), N = r(() => W.value?.selectedLlmCode.value), P = () => {
|
|
4718
4722
|
w.value?.focus?.();
|
|
4719
|
-
}, { reportError: F, managerErrorBridge: I } =
|
|
4723
|
+
}, { reportError: F, managerErrorBridge: I } = tr(p, { errorToast: () => s.errorToast }), { chatHelper: z, isStandaloneMode: B, isInitialized: V, isReady: te, initError: ne, whenReady: U, chatBusinessManager: W, sessionBusinessManager: G, shortcutManager: ie } = Jn({
|
|
4720
4724
|
props: s,
|
|
4721
4725
|
emit: p,
|
|
4722
4726
|
reportError: F,
|
|
4723
4727
|
managerErrorBridge: I
|
|
4724
|
-
}), { handleInterruptResume: ae, resumeUserQuestionWithInput: oe } =
|
|
4728
|
+
}), { handleInterruptResume: ae, resumeUserQuestionWithInput: oe } = cr({
|
|
4725
4729
|
chatHelper: z,
|
|
4726
4730
|
reportError: F
|
|
4727
|
-
}), { userInput: ce, cite: le, handleUpdateModelValue: ue, doSendMessage: de, handleSendMessage: fe, handleUpload: pe, handleArtifactClick: me, handleStopSending: he, stopGeneration: ge } =
|
|
4731
|
+
}), { userInput: ce, cite: le, handleUpdateModelValue: ue, doSendMessage: de, handleSendMessage: fe, handleUpload: pe, handleArtifactClick: me, handleStopSending: he, stopGeneration: ge } = lr({
|
|
4728
4732
|
emit: p,
|
|
4729
4733
|
chatHelper: z,
|
|
4730
4734
|
chatBusinessManager: W,
|
|
@@ -4733,7 +4737,7 @@ var pr = /* @__PURE__ */ d({
|
|
|
4733
4737
|
resumeUserQuestionWithInput: oe,
|
|
4734
4738
|
selectedShortcut: A,
|
|
4735
4739
|
selectedResources: D
|
|
4736
|
-
}), { handleSelectShortcut: _e, handleCloseShortcut: ve, handleShortcutSubmit: ye, selectShortcutWithText: be, getShortcutFromMessage: K, buildShortcutProperty: q, sendShortcutDirectly: J } =
|
|
4740
|
+
}), { handleSelectShortcut: _e, handleCloseShortcut: ve, handleShortcutSubmit: ye, selectShortcutWithText: be, getShortcutFromMessage: K, buildShortcutProperty: q, sendShortcutDirectly: J } = fr({
|
|
4737
4741
|
props: s,
|
|
4738
4742
|
emit: p,
|
|
4739
4743
|
chatHelper: z,
|
|
@@ -4741,7 +4745,7 @@ var pr = /* @__PURE__ */ d({
|
|
|
4741
4745
|
doSendMessage: de,
|
|
4742
4746
|
reportError: F,
|
|
4743
4747
|
selectedShortcut: A
|
|
4744
|
-
}), { messageStatus: xe, messageToolsStatus: Se, effectiveMessageTools: Ce, effectiveUpdateTools: we, effectiveUserMessageTools: Te, messages: Ee, isMessagesLoading: Y, isGenerating: X, currentSession: De, isWelcomeState: Oe, openingRemark: ke, effectiveResources: Ae, effectivePrompts: Z, effectiveSkills: je, effectiveSupportUpload: Me, chatbotStyle: Ne, filteredShortcuts: Pe } =
|
|
4748
|
+
}), { messageStatus: xe, messageToolsStatus: Se, effectiveMessageTools: Ce, effectiveUpdateTools: we, effectiveUserMessageTools: Te, messages: Ee, isMessagesLoading: Y, isGenerating: X, currentSession: De, isWelcomeState: Oe, openingRemark: ke, effectiveResources: Ae, effectivePrompts: Z, effectiveSkills: je, effectiveSupportUpload: Me, chatbotStyle: Ne, filteredShortcuts: Pe } = $n({
|
|
4745
4749
|
props: s,
|
|
4746
4750
|
chatHelper: z,
|
|
4747
4751
|
chatBusinessManager: W,
|
|
@@ -4750,7 +4754,7 @@ var pr = /* @__PURE__ */ d({
|
|
|
4750
4754
|
isStandaloneMode: B,
|
|
4751
4755
|
isInitialized: V,
|
|
4752
4756
|
selectedShortcut: A
|
|
4753
|
-
}), { handleAgentAction: Fe, handleAgentFeedback: Ie, handleUserAction: Le, handleUserInputConfirm: Re, handleUserShortcutConfirm: ze, handleStopStreaming: Be } =
|
|
4757
|
+
}), { handleAgentAction: Fe, handleAgentFeedback: Ie, handleUserAction: Le, handleUserInputConfirm: Re, handleUserShortcutConfirm: ze, handleStopStreaming: Be } = pr({
|
|
4754
4758
|
emit: p,
|
|
4755
4759
|
chatHelper: z,
|
|
4756
4760
|
chatBusinessManager: W,
|
|
@@ -4778,7 +4782,7 @@ var pr = /* @__PURE__ */ d({
|
|
|
4778
4782
|
L(() => s.models, (e) => {
|
|
4779
4783
|
s.enableModelSelect === !1 || !W.value || e?.length && W.value.setModels(e);
|
|
4780
4784
|
});
|
|
4781
|
-
let { handleConfirmShare: Ge } =
|
|
4785
|
+
let { handleConfirmShare: Ge } = dr({
|
|
4782
4786
|
emit: p,
|
|
4783
4787
|
chatHelper: z,
|
|
4784
4788
|
isStandaloneMode: B
|
|
@@ -4936,13 +4940,13 @@ var pr = /* @__PURE__ */ d({
|
|
|
4936
4940
|
key: "0"
|
|
4937
4941
|
} : 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.user-message-tools.welcome-title.onConfirmShare.onDeleteShortcut.onSelectShortcut.onShortcutClose.onShortcutSubmit.onStopStreaming.onUpdate:modelValue".split("."))], 6));
|
|
4938
4942
|
}
|
|
4939
|
-
}),
|
|
4943
|
+
}), hr = /* @__PURE__ */ function(e) {
|
|
4940
4944
|
return e.ERROR = "error", e.IDLE = "idle", e.LOADING_AGENT = "loading_agent", e.READY = "ready", e;
|
|
4941
4945
|
}({});
|
|
4942
|
-
function
|
|
4946
|
+
function gr(e) {
|
|
4943
4947
|
let { url: t, requestOptions: n, autoInit: i = !0, protocolCallbacks: a, enableModelSelect: o = !0 } = e, s = j(t);
|
|
4944
4948
|
if (!s) throw Error("[useChatBootstrap] url is required");
|
|
4945
|
-
let c = T(
|
|
4949
|
+
let c = T(hr.IDLE), l = T(null), u = T(!1), d = /* @__PURE__ */ new Map(), f = new Z({
|
|
4946
4950
|
onStart: () => {
|
|
4947
4951
|
a?.onStart?.();
|
|
4948
4952
|
},
|
|
@@ -4960,14 +4964,14 @@ function hr(e) {
|
|
|
4960
4964
|
protocol: f
|
|
4961
4965
|
});
|
|
4962
4966
|
f.injectMessageModule(p.message);
|
|
4963
|
-
let m = r(() => c.value ===
|
|
4967
|
+
let m = r(() => c.value === hr.LOADING_AGENT), h = r(() => c.value === hr.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) => {
|
|
4964
4968
|
l.value = null;
|
|
4965
4969
|
try {
|
|
4966
|
-
if (c.value =
|
|
4967
|
-
c.value =
|
|
4970
|
+
if (c.value = hr.LOADING_AGENT, await Fn(p, { enableModelSelect: o }), e !== x) return;
|
|
4971
|
+
c.value = hr.READY, u.value = !0;
|
|
4968
4972
|
} catch (t) {
|
|
4969
4973
|
if (e !== x) return;
|
|
4970
|
-
throw console.error("[useChatBootstrap] Initialization failed:", t), l.value = t, c.value =
|
|
4974
|
+
throw console.error("[useChatBootstrap] Initialization failed:", t), l.value = t, c.value = hr.ERROR, t;
|
|
4971
4975
|
}
|
|
4972
4976
|
}, C = async () => {
|
|
4973
4977
|
if (u.value) return;
|
|
@@ -4977,7 +4981,7 @@ function hr(e) {
|
|
|
4977
4981
|
e === x && (b = null);
|
|
4978
4982
|
}), b;
|
|
4979
4983
|
}, w = () => {
|
|
4980
|
-
x += 1, c.value =
|
|
4984
|
+
x += 1, c.value = hr.IDLE, l.value = null, u.value = !1, b = null;
|
|
4981
4985
|
}, E = async () => {
|
|
4982
4986
|
w(), await C();
|
|
4983
4987
|
}, D = async (e) => {
|
|
@@ -5011,7 +5015,7 @@ function hr(e) {
|
|
|
5011
5015
|
}
|
|
5012
5016
|
//#endregion
|
|
5013
5017
|
//#region src/composables/use-event-bridge.ts
|
|
5014
|
-
function
|
|
5018
|
+
function _r(e) {
|
|
5015
5019
|
return {
|
|
5016
5020
|
sendMessage: (t) => e("send-message", { content: t }),
|
|
5017
5021
|
receiveStart: () => e("receive-start", {}),
|
|
@@ -5032,12 +5036,12 @@ function gr(e) {
|
|
|
5032
5036
|
shareMessages: (t) => e("share-messages", { messageIds: t })
|
|
5033
5037
|
};
|
|
5034
5038
|
}
|
|
5035
|
-
function
|
|
5039
|
+
function vr(e) {
|
|
5036
5040
|
let { componentManager: t, emit: n, debug: r = !1 } = e, i = [], a = () => {
|
|
5037
|
-
for (let [e, a] of Object.entries(
|
|
5041
|
+
for (let [e, a] of Object.entries(Wn)) {
|
|
5038
5042
|
if (a === null) continue;
|
|
5039
5043
|
let o = t.on(e, (t) => {
|
|
5040
|
-
let i =
|
|
5044
|
+
let i = Gn(e, t);
|
|
5041
5045
|
r && console.debug(`[useEventBridge] ${e} -> ${a}`, i), n(a, ...i);
|
|
5042
5046
|
});
|
|
5043
5047
|
i.push(o);
|
|
@@ -5059,17 +5063,17 @@ function _r(e) {
|
|
|
5059
5063
|
}
|
|
5060
5064
|
//#endregion
|
|
5061
5065
|
//#region src/composables/use-ai-blueking-init.ts
|
|
5062
|
-
function
|
|
5063
|
-
let { props: t, emit: n } = e, i = T(), a = T(), o = r(() => qt(t.url ?? "")), s =
|
|
5066
|
+
function yr(e) {
|
|
5067
|
+
let { props: t, emit: n } = e, i = T(), a = T(), o = r(() => qt(t.url ?? "")), s = Un({
|
|
5064
5068
|
initialPanelVisible: !1,
|
|
5065
5069
|
initialNimbusMinimized: t.defaultMinimize,
|
|
5066
5070
|
enablePopup: t.enablePopup,
|
|
5067
5071
|
enableNimbus: !t.hideNimbus,
|
|
5068
5072
|
enableDraggable: t.draggable
|
|
5069
|
-
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } =
|
|
5073
|
+
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } = vr({
|
|
5070
5074
|
componentManager: s,
|
|
5071
5075
|
emit: n
|
|
5072
|
-
}), d =
|
|
5076
|
+
}), d = _r(u), f = /* @__PURE__ */ new WeakSet(), p = null, m = null, h = () => {
|
|
5073
5077
|
p &&= (clearTimeout(p.timer), null);
|
|
5074
5078
|
}, g = (e) => {
|
|
5075
5079
|
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;
|
|
@@ -5111,7 +5115,7 @@ function vr(e) {
|
|
|
5111
5115
|
error: e,
|
|
5112
5116
|
source: "business"
|
|
5113
5117
|
});
|
|
5114
|
-
}, { chatHelper: S, isReady: C, error: w, agentInfo: E, agentName: D, currentSession: O, initialize: k } =
|
|
5118
|
+
}, { chatHelper: S, isReady: C, error: w, agentInfo: E, agentName: D, currentSession: O, initialize: k } = gr({
|
|
5115
5119
|
url: o,
|
|
5116
5120
|
requestOptions: () => j(t.requestOptions),
|
|
5117
5121
|
autoInit: !0,
|
|
@@ -5138,7 +5142,7 @@ function vr(e) {
|
|
|
5138
5142
|
A.onError?.((e) => {
|
|
5139
5143
|
_(e);
|
|
5140
5144
|
}, { ignoreErrors: t.ignoreErrors });
|
|
5141
|
-
let M = new
|
|
5145
|
+
let M = new Ln(A.agent, A.session, { enabled: t.enableModelSelect !== !1 }), N = async () => {
|
|
5142
5146
|
if (t.enableModelSelect !== !1) {
|
|
5143
5147
|
if (t.models?.length) {
|
|
5144
5148
|
M.setModels(t.models);
|
|
@@ -5146,11 +5150,11 @@ function vr(e) {
|
|
|
5146
5150
|
}
|
|
5147
5151
|
await M.ensureLoaded();
|
|
5148
5152
|
}
|
|
5149
|
-
}, P = new
|
|
5153
|
+
}, P = new zn(A.session, A.agent, null, {
|
|
5150
5154
|
enableChatSession: t.enableChatSession,
|
|
5151
5155
|
initialSessionCode: t.initialSessionCode,
|
|
5152
5156
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
5153
|
-
}, A.message, M), ee = new
|
|
5157
|
+
}, A.message, M), ee = new Bn(A.message, A.session), F = new Vn(null, t.shortcuts || []), I = null, R = () => t.loadRecentSessionOnMount ? (I ||= N().then(() => P.loadRecentSession({ skipLoadSessions: !0 })).finally(() => {
|
|
5154
5158
|
I = null;
|
|
5155
5159
|
}), I) : Promise.resolve(), z = async () => {
|
|
5156
5160
|
await v("init", async () => {
|
|
@@ -5238,7 +5242,7 @@ function vr(e) {
|
|
|
5238
5242
|
}
|
|
5239
5243
|
//#endregion
|
|
5240
5244
|
//#region src/composables/use-ai-selection.ts
|
|
5241
|
-
function
|
|
5245
|
+
function br(e) {
|
|
5242
5246
|
let { shortcutManager: t, chatBotRef: n, forwardToManager: i, show: a, props: o } = e, s = T(!1), c = T("");
|
|
5243
5247
|
return {
|
|
5244
5248
|
aiSelectionVisible: s,
|
|
@@ -5260,7 +5264,7 @@ function yr(e) {
|
|
|
5260
5264
|
}
|
|
5261
5265
|
//#endregion
|
|
5262
5266
|
//#region src/composables/use-nimbus.ts
|
|
5263
|
-
function
|
|
5267
|
+
function xr(e, t = !1) {
|
|
5264
5268
|
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) => {
|
|
5265
5269
|
e ? i.value = window.innerWidth - 12 : i.value = r;
|
|
5266
5270
|
}, f = (e, t) => {
|
|
@@ -5313,9 +5317,9 @@ function br(e, t = !1) {
|
|
|
5313
5317
|
}
|
|
5314
5318
|
//#endregion
|
|
5315
5319
|
//#region src/composables/use-panel-container.ts
|
|
5316
|
-
var
|
|
5317
|
-
function
|
|
5318
|
-
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = T(!0), c =
|
|
5320
|
+
var Sr = 560;
|
|
5321
|
+
function Cr(e) {
|
|
5322
|
+
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = T(!0), c = Sr, l = async (e) => {
|
|
5319
5323
|
t.showPanel(e), o && await o(), e && n.value && await n.value.switchSession(e);
|
|
5320
5324
|
}, u = async (e) => {
|
|
5321
5325
|
await l(e);
|
|
@@ -5342,7 +5346,7 @@ function Sr(e) {
|
|
|
5342
5346
|
}, y = (e) => {
|
|
5343
5347
|
t.setCompressed(e);
|
|
5344
5348
|
}, b = (e, t) => {
|
|
5345
|
-
c = Math.max(
|
|
5349
|
+
c = Math.max(Sr, t ?? c);
|
|
5346
5350
|
}, x = async () => {
|
|
5347
5351
|
s.value &&= (await t.expandForSidePanel(c, { onBeforeSizeChange: () => {
|
|
5348
5352
|
s.value = !1;
|
|
@@ -5417,7 +5421,7 @@ function Sr(e) {
|
|
|
5417
5421
|
}
|
|
5418
5422
|
//#endregion
|
|
5419
5423
|
//#region src/composables/use-session-handlers.ts
|
|
5420
|
-
function
|
|
5424
|
+
function wr(e) {
|
|
5421
5425
|
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 = () => Bt(t.message.list.value);
|
|
5422
5426
|
return L(() => o.value, (e) => {
|
|
5423
5427
|
e && (s.value = e.sessionName || "", l.value = (e.sessionContentCount ?? 0) > 0 || d());
|
|
@@ -5548,7 +5552,7 @@ function Cr(e) {
|
|
|
5548
5552
|
}
|
|
5549
5553
|
//#endregion
|
|
5550
5554
|
//#region src/composables/use-share-handlers.ts
|
|
5551
|
-
function
|
|
5555
|
+
function Tr(e) {
|
|
5552
5556
|
let { shareBusinessManager: t, chatBotRef: n, emit: r, forwarders: i, reportSdkError: a } = e, o = T(!1);
|
|
5553
5557
|
return {
|
|
5554
5558
|
isShareLoading: o,
|
|
@@ -5559,7 +5563,7 @@ function wr(e) {
|
|
|
5559
5563
|
n.value?.exitShareMode();
|
|
5560
5564
|
},
|
|
5561
5565
|
handleConfirmShare: async (e, s) => {
|
|
5562
|
-
if (!
|
|
5566
|
+
if (!ur(s)) {
|
|
5563
5567
|
n.value?.exitShareMode(), r("confirm-share", e, s);
|
|
5564
5568
|
return;
|
|
5565
5569
|
}
|
|
@@ -5585,7 +5589,7 @@ function wr(e) {
|
|
|
5585
5589
|
}
|
|
5586
5590
|
//#endregion
|
|
5587
5591
|
//#region src/composables/use-tippy.ts
|
|
5588
|
-
function
|
|
5592
|
+
function Er(e = {}) {
|
|
5589
5593
|
let t = T([]), n = (n, r, i = {}) => {
|
|
5590
5594
|
try {
|
|
5591
5595
|
let a = typeof n == "string" ? document.querySelector(n) : n;
|
|
@@ -5638,7 +5642,7 @@ function Tr(e = {}) {
|
|
|
5638
5642
|
}
|
|
5639
5643
|
//#endregion
|
|
5640
5644
|
//#region src/config/prop-defaults.ts
|
|
5641
|
-
var
|
|
5645
|
+
var Dr = {
|
|
5642
5646
|
url: "",
|
|
5643
5647
|
title: "",
|
|
5644
5648
|
extCls: "",
|
|
@@ -5685,7 +5689,7 @@ var Er = {
|
|
|
5685
5689
|
defaultChatInputPosition: void 0,
|
|
5686
5690
|
errorToast: !0,
|
|
5687
5691
|
ignoreErrors: () => []
|
|
5688
|
-
},
|
|
5692
|
+
}, Or = class extends Z {
|
|
5689
5693
|
eventEmitter;
|
|
5690
5694
|
constructor(e = {}) {
|
|
5691
5695
|
super({
|
|
@@ -5714,7 +5718,7 @@ var Er = {
|
|
|
5714
5718
|
super.handleToolCallStartEvent(e), this.eventEmitter?.emit("tool-call-start", { event: e });
|
|
5715
5719
|
}
|
|
5716
5720
|
};
|
|
5717
|
-
function
|
|
5721
|
+
function kr(e = {}) {
|
|
5718
5722
|
let { eventEmitter: t, onStart: n, onMessage: r, onDone: i, onError: a, onTextChunk: o } = e;
|
|
5719
5723
|
return new Z({
|
|
5720
5724
|
onStart: () => {
|
|
@@ -5733,8 +5737,8 @@ function Or(e = {}) {
|
|
|
5733
5737
|
}
|
|
5734
5738
|
//#endregion
|
|
5735
5739
|
//#region src/containers/use-draggable.ts
|
|
5736
|
-
var
|
|
5737
|
-
function
|
|
5740
|
+
var Ar = 3;
|
|
5741
|
+
function jr(e = {}, t) {
|
|
5738
5742
|
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 = !1, O = null, k = T(!1), A = (e) => {
|
|
5739
5743
|
let t = window.innerWidth, n = { ...e };
|
|
5740
5744
|
return n.width > t && (n.width = t), n.x + n.width > t && (n.x = t - n.width), n.x < 0 && (n.x = 0), n;
|
|
@@ -5744,7 +5748,7 @@ function Ar(e = {}, t) {
|
|
|
5744
5748
|
width: m.value,
|
|
5745
5749
|
height: h.value
|
|
5746
5750
|
}), M = (e, t) => {
|
|
5747
|
-
k.value && (O !== null && Math.abs(e - O.x) <=
|
|
5751
|
+
k.value && (O !== null && Math.abs(e - O.x) <= Ar && Math.abs(t - O.width) <= Ar || (S = null, D = !1));
|
|
5748
5752
|
}, N = (e, n) => {
|
|
5749
5753
|
p.value = e, f.value = n, y.value = e - (window.innerWidth - m.value), M(e, m.value), t?.onDragging?.(j());
|
|
5750
5754
|
}, P = (e, n, r, i) => {
|
|
@@ -5856,7 +5860,7 @@ function Ar(e = {}, t) {
|
|
|
5856
5860
|
}
|
|
5857
5861
|
//#endregion
|
|
5858
5862
|
//#region src/containers/draggable-container.vue?vue&type=script&setup=true&lang.ts
|
|
5859
|
-
var
|
|
5863
|
+
var Mr = { class: "draggable-container-content" }, Nr = /* @__PURE__ */ cn(/* @__PURE__ */ d({
|
|
5860
5864
|
__name: "draggable-container",
|
|
5861
5865
|
props: {
|
|
5862
5866
|
className: { default: "" },
|
|
@@ -5893,7 +5897,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
5893
5897
|
"compression-change"
|
|
5894
5898
|
],
|
|
5895
5899
|
setup(e, { expose: t, emit: n }) {
|
|
5896
|
-
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 } =
|
|
5900
|
+
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 } = jr({
|
|
5897
5901
|
initWidth: a.defaultWidth,
|
|
5898
5902
|
minWidth: a.minWidth,
|
|
5899
5903
|
minHeight: a.minHeight,
|
|
@@ -5970,7 +5974,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
5970
5974
|
onResizeStop: U,
|
|
5971
5975
|
onResizing: te
|
|
5972
5976
|
}, {
|
|
5973
|
-
default: R(() => [s("div",
|
|
5977
|
+
default: R(() => [s("div", Mr, [O(e.$slots, "default", {}, void 0, !0)])]),
|
|
5974
5978
|
_: 3
|
|
5975
5979
|
}, 8, [
|
|
5976
5980
|
"active",
|
|
@@ -5988,11 +5992,11 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
5988
5992
|
"y"
|
|
5989
5993
|
])), [[I, a.visible]]);
|
|
5990
5994
|
}
|
|
5991
|
-
}), [["__scopeId", "data-v-7417a71b"]]),
|
|
5995
|
+
}), [["__scopeId", "data-v-7417a71b"]]), Pr = { class: "nimbus-bkai-wrapper" }, Fr = [
|
|
5992
5996
|
"width",
|
|
5993
5997
|
"height",
|
|
5994
5998
|
"src"
|
|
5995
|
-
],
|
|
5999
|
+
], Ir = /* @__PURE__ */ cn(/* @__PURE__ */ d({
|
|
5996
6000
|
name: "NimbusButton",
|
|
5997
6001
|
__name: "nimbus",
|
|
5998
6002
|
props: {
|
|
@@ -6044,11 +6048,11 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6044
6048
|
right: -6
|
|
6045
6049
|
}
|
|
6046
6050
|
}
|
|
6047
|
-
}, 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 } =
|
|
6051
|
+
}, 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 } = xr(a, n.isMinimize);
|
|
6048
6052
|
L(p, (e) => {
|
|
6049
6053
|
a("update:isMinimize", e);
|
|
6050
6054
|
});
|
|
6051
|
-
let D = r(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } =
|
|
6055
|
+
let D = r(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } = Er({
|
|
6052
6056
|
theme: "ai-blueking",
|
|
6053
6057
|
delay: [0, 0]
|
|
6054
6058
|
}), A = () => {
|
|
@@ -6090,12 +6094,12 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6090
6094
|
onMouseenter: n[3] ||= (...e) => M(y) && M(y)(...e),
|
|
6091
6095
|
onMouseleave: n[4] ||= (...e) => M(S) && M(S)(...e),
|
|
6092
6096
|
onMouseup: n[5] ||= (...e) => M(E) && M(E)(...e)
|
|
6093
|
-
}, [s("div",
|
|
6097
|
+
}, [s("div", Pr, [s("img", {
|
|
6094
6098
|
width: c.value.img,
|
|
6095
6099
|
height: c.value.img,
|
|
6096
6100
|
src: M(be),
|
|
6097
6101
|
alt: "nimbus"
|
|
6098
|
-
}, null, 8,
|
|
6102
|
+
}, null, 8, Fr)]), s("i", {
|
|
6099
6103
|
ref_key: "minimizeButtonRef",
|
|
6100
6104
|
ref: u,
|
|
6101
6105
|
class: _(["nimbus-mini bkai-icon", M(p) ? "bkai-yinyong" : "bkai-minus-line"]),
|
|
@@ -6111,7 +6115,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6111
6115
|
"onDragging"
|
|
6112
6116
|
]));
|
|
6113
6117
|
}
|
|
6114
|
-
}), [["__scopeId", "data-v-26b6f3ea"]]),
|
|
6118
|
+
}), [["__scopeId", "data-v-26b6f3ea"]]), Lr = /* @__PURE__ */ cn(/* @__PURE__ */ d({
|
|
6115
6119
|
inheritAttrs: !1,
|
|
6116
6120
|
__name: "ai-blueking",
|
|
6117
6121
|
props: /* @__PURE__ */ h({
|
|
@@ -6168,7 +6172,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6168
6172
|
resizeProps: {},
|
|
6169
6173
|
size: {},
|
|
6170
6174
|
timezone: {}
|
|
6171
|
-
},
|
|
6175
|
+
}, Dr),
|
|
6172
6176
|
emits: [
|
|
6173
6177
|
"show",
|
|
6174
6178
|
"close",
|
|
@@ -6197,30 +6201,30 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6197
6201
|
"share"
|
|
6198
6202
|
],
|
|
6199
6203
|
setup(e, { expose: n, emit: o }) {
|
|
6200
|
-
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, agentResources: z, agentPrompts: B, agentSkills: H, handleError: te, reportSdkError: ne, ensureSessionReady: U, updateAgentInfo: W } =
|
|
6204
|
+
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, agentResources: z, agentPrompts: B, agentSkills: H, handleError: te, reportSdkError: ne, ensureSessionReady: U, updateAgentInfo: W } = yr({
|
|
6201
6205
|
props: l,
|
|
6202
6206
|
emit: d
|
|
6203
|
-
}), re = r(() => b.selectedLlmCode.value), { show: G, hide: ie, handleShow: ae, handleClose: oe, handleNimbusClick: se, handleDragging: ce, handleResizing: le, handleDragStop: ue, handleResizeStop: de, handleToggleCompression: fe, handleCompressionChange: pe, handleExecutionPanelChange: me, handleToggleAside: he, handleAsideCollapsedUpdate: ge, asideCollapsed: _e, sendMessage: ve, handleReceiveStart: ye, handleReceiveText: be, handleReceiveEnd: K, handleStop: q, stopGeneration: J, setCiteText: xe, focusInput: Se, selectShortcut: Ce, sendShortcut: we, getChatHelper: Te, updatePosition: Ee, updateSize: Y, updatePositionAndSize: X, handleShortcutClick: De } =
|
|
6207
|
+
}), re = r(() => b.selectedLlmCode.value), { show: G, hide: ie, handleShow: ae, handleClose: oe, handleNimbusClick: se, handleDragging: ce, handleResizing: le, handleDragStop: ue, handleResizeStop: de, handleToggleCompression: fe, handleCompressionChange: pe, handleExecutionPanelChange: me, handleToggleAside: he, handleAsideCollapsedUpdate: ge, asideCollapsed: _e, sendMessage: ve, handleReceiveStart: ye, handleReceiveText: be, handleReceiveEnd: K, handleStop: q, stopGeneration: J, setCiteText: xe, focusInput: Se, selectShortcut: Ce, sendShortcut: we, getChatHelper: Te, updatePosition: Ee, updateSize: Y, updatePositionAndSize: X, handleShortcutClick: De } = Cr({
|
|
6204
6208
|
componentManager: g,
|
|
6205
6209
|
chatBotRef: D,
|
|
6206
6210
|
forwarders: T,
|
|
6207
6211
|
forwardToManager: E,
|
|
6208
6212
|
beforeNimbusClick: l.beforeNimbusClick,
|
|
6209
6213
|
ensureSessionReady: U
|
|
6210
|
-
}), { sessionName: Oe, hasPermission: ke, hasSessionContents: Ae, autoGenerateLoading: Z, handleNewChat: je, handleNewChatCreated: Me, handleHistoryClick: Ne, handleHistorySessionSwitch: Pe, handleHistorySessionDelete: Fe, handleHistorySessionRename: Ie, handleAutoGenerateName: Le, handleHelpClick: Re, handleRename: ze, handleSessionRenamed: Be, handleSessionSwitched: Ve, addNewSession: Q, switchToSession: He, updateSessionName: Ue } =
|
|
6214
|
+
}), { sessionName: Oe, hasPermission: ke, hasSessionContents: Ae, autoGenerateLoading: Z, handleNewChat: je, handleNewChatCreated: Me, handleHistoryClick: Ne, handleHistorySessionSwitch: Pe, handleHistorySessionDelete: Fe, handleHistorySessionRename: Ie, handleAutoGenerateName: Le, handleHelpClick: Re, handleRename: ze, handleSessionRenamed: Be, handleSessionSwitched: Ve, addNewSession: Q, switchToSession: He, updateSessionName: Ue } = wr({
|
|
6211
6215
|
chatHelper: h,
|
|
6212
6216
|
sessionBusinessManager: x,
|
|
6213
6217
|
chatBotRef: D,
|
|
6214
6218
|
forwarders: T,
|
|
6215
6219
|
reportSdkError: ne,
|
|
6216
6220
|
currentSession: F
|
|
6217
|
-
}), { isShareLoading: We, handleShare: Ge, handleCancelShare: Ke, handleConfirmShare: qe } =
|
|
6221
|
+
}), { isShareLoading: We, handleShare: Ge, handleCancelShare: Ke, handleConfirmShare: qe } = Tr({
|
|
6218
6222
|
shareBusinessManager: S,
|
|
6219
6223
|
chatBotRef: D,
|
|
6220
6224
|
emit: (e, t, n) => d(e, t, n),
|
|
6221
6225
|
forwarders: T,
|
|
6222
6226
|
reportSdkError: ne
|
|
6223
|
-
}), { aiSelectionVisible: Je, filteredPopupShortcuts: Ye, handleSelectionChange: Xe, handleAiSelectionShortcut: Ze } =
|
|
6227
|
+
}), { aiSelectionVisible: Je, filteredPopupShortcuts: Ye, handleSelectionChange: Xe, handleAiSelectionShortcut: Ze } = br({
|
|
6224
6228
|
shortcutManager: w,
|
|
6225
6229
|
chatBotRef: D,
|
|
6226
6230
|
forwardToManager: E,
|
|
@@ -6254,7 +6258,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6254
6258
|
M(p).class
|
|
6255
6259
|
]) }, [
|
|
6256
6260
|
a(" 可拖拽容器 "),
|
|
6257
|
-
u(M(
|
|
6261
|
+
u(M(Nr), {
|
|
6258
6262
|
ref_key: "draggableContainerRef",
|
|
6259
6263
|
ref: k,
|
|
6260
6264
|
"compressed-padding": l.miniPadding,
|
|
@@ -6275,7 +6279,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6275
6279
|
}, {
|
|
6276
6280
|
default: R(() => [s("div", { class: _(["ai-blueking-panel", { "has-messages": !M(L) }]) }, [
|
|
6277
6281
|
a(" 独立的 Header 组件 "),
|
|
6278
|
-
l.hideHeader ? a("v-if", !0) : (C(), i(
|
|
6282
|
+
l.hideHeader ? a("v-if", !0) : (C(), i(Nn, {
|
|
6279
6283
|
key: 0,
|
|
6280
6284
|
"agent-name": M(ee),
|
|
6281
6285
|
"aside-collapsed": M(_e),
|
|
@@ -6313,9 +6317,13 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6313
6317
|
name: "headerLeft",
|
|
6314
6318
|
fn: R(() => [O(e.$slots, "headerLeft", {}, void 0, !0)]),
|
|
6315
6319
|
key: "0"
|
|
6320
|
+
} : void 0, e.$slots.headerActions ? {
|
|
6321
|
+
name: "headerActions",
|
|
6322
|
+
fn: R(() => [O(e.$slots, "headerActions", {}, void 0, !0)]),
|
|
6323
|
+
key: "1"
|
|
6316
6324
|
} : 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("."))),
|
|
6317
6325
|
a(" ChatBot 核心组件(仅聊天区域) "),
|
|
6318
|
-
u(
|
|
6326
|
+
u(mr, {
|
|
6319
6327
|
ref_key: "chatBotRef",
|
|
6320
6328
|
ref: D,
|
|
6321
6329
|
"always-create-new-session": l.alwaysCreateNewSession,
|
|
@@ -6402,7 +6410,7 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6402
6410
|
"onResizing"
|
|
6403
6411
|
]),
|
|
6404
6412
|
a(" Nimbus 悬浮球 "),
|
|
6405
|
-
l.hideNimbus ? a("v-if", !0) : (C(), i(
|
|
6413
|
+
l.hideNimbus ? a("v-if", !0) : (C(), i(Ir, {
|
|
6406
6414
|
key: 0,
|
|
6407
6415
|
"is-minimize": M(j),
|
|
6408
6416
|
"onUpdate:isMinimize": n[5] ||= (e) => m(j) ? j.value = e : null,
|
|
@@ -6437,6 +6445,6 @@ var jr = { class: "draggable-container-content" }, Mr = /* @__PURE__ */ cn(/* @_
|
|
|
6437
6445
|
])) : a("v-if", !0)
|
|
6438
6446
|
], 2)], 8, ["to"]));
|
|
6439
6447
|
}
|
|
6440
|
-
}), [["__scopeId", "data-v-
|
|
6448
|
+
}), [["__scopeId", "data-v-349f1f25"]]);
|
|
6441
6449
|
//#endregion
|
|
6442
|
-
export { Z as AGUIProtocol,
|
|
6450
|
+
export { Z as AGUIProtocol, Lr as AIBlueking, Lr as default, Or as BluekingProtocol, hr as BootstrapPhase, mr as ChatBot, Rn as ChatBusinessManager, Hn as ComponentManager, Nr as DraggableContainer, W as MessageContentType, oe as RenderMode, zn as SessionBusinessManager, Vn as ShortcutManager, Kn as UIStateManager, kr as createBluekingProtocol, Un as createComponentManager, Dr as defaultProps, Ut as parseCustomBlocks, gr as useChatBootstrap, Pt as useChatHelper, jr as useDraggable };
|