@blueking/ai-blueking 2.2.1-beta.5 → 2.2.1-beta.6
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/standalone/index.es.min.js +297 -288
- package/dist/standalone/index.iife.min.js +2 -2
- package/dist/standalone/index.umd.min.js +2 -2
- package/dist/vue2/index.es.min.js +2622 -2613
- package/dist/vue2/index.iife.min.js +238 -238
- package/dist/vue2/index.umd.min.js +258 -258
- package/dist/vue3/index.es.min.js +209 -200
- package/dist/vue3/index.iife.min.js +282 -282
- package/dist/vue3/index.umd.min.js +3 -3
- package/package.json +3 -3
|
@@ -1694,21 +1694,30 @@ var $e = (e) => {
|
|
|
1694
1694
|
payload: r
|
|
1695
1695
|
}, i)
|
|
1696
1696
|
}), nt = "upload_file", rt = 20, it = (e) => {
|
|
1697
|
+
if (Array.isArray(e)) return {
|
|
1698
|
+
page: 1,
|
|
1699
|
+
numPages: 1,
|
|
1700
|
+
count: e.length,
|
|
1701
|
+
results: e.map(we)
|
|
1702
|
+
};
|
|
1703
|
+
let t = Array.isArray(e?.results) ? e.results : [];
|
|
1704
|
+
return {
|
|
1705
|
+
page: e?.page ?? 1,
|
|
1706
|
+
numPages: e?.num_pages ?? 1,
|
|
1707
|
+
count: e?.count ?? t.length,
|
|
1708
|
+
results: t.map(we)
|
|
1709
|
+
};
|
|
1710
|
+
}, at = (e) => {
|
|
1697
1711
|
let t = e.split(".").pop();
|
|
1698
1712
|
if (!t || t === e) return "";
|
|
1699
1713
|
let n = t.replace(/[^A-Za-z0-9]/g, "").slice(0, 20).toLowerCase();
|
|
1700
1714
|
return n ? `.${n}` : "";
|
|
1701
|
-
},
|
|
1715
|
+
}, ot = (e) => `${nt}_${`${Date.now()}_${Math.random().toString(36).slice(2, 8)}`}${at(e.name)}`, st = (e) => `attachment; filename="${e}"`, ct = (e) => ({
|
|
1702
1716
|
clearSession: (t, n) => e.post(`chat_completion/${t}/clear/`, void 0, n),
|
|
1703
1717
|
getSessions: (t, n) => e.get("session/", {
|
|
1704
1718
|
page: t?.page ?? 1,
|
|
1705
1719
|
page_size: t?.page_size ?? rt
|
|
1706
|
-
}, n).then(
|
|
1707
|
-
page: e.page,
|
|
1708
|
-
numPages: e.num_pages,
|
|
1709
|
-
count: e.count,
|
|
1710
|
-
results: e.results.map(we)
|
|
1711
|
-
})),
|
|
1720
|
+
}, n).then(it),
|
|
1712
1721
|
plusSession: (t, n) => e.post("session/", Te(t), n).then((e) => we(e)),
|
|
1713
1722
|
modifySession: (t, n) => e.put(`session/${t.sessionCode}/`, Te(t), n).then((e) => we(e)),
|
|
1714
1723
|
deleteSession: (t, n) => e.delete(`session/${t}/`, void 0, n),
|
|
@@ -1718,29 +1727,29 @@ var $e = (e) => {
|
|
|
1718
1727
|
getSessionFeedbackReasons: (t, n) => e.get("session_feedback/reasons/", { rate: t }, n),
|
|
1719
1728
|
renameSession: (t, n) => e.post(`session/${t}/ai_rename/`, void 0, n).then((e) => we(e)),
|
|
1720
1729
|
uploadFile: (t, n, r) => {
|
|
1721
|
-
let i =
|
|
1730
|
+
let i = ot(n), a = encodeURIComponent(i), o = Q(r?.headers) ?? {};
|
|
1722
1731
|
return n.arrayBuffer().then((n) => e.post(`session/${t}/upload/${a}/`, n, {
|
|
1723
1732
|
...r,
|
|
1724
1733
|
headers: {
|
|
1725
1734
|
...o,
|
|
1726
|
-
"Content-Disposition":
|
|
1735
|
+
"Content-Disposition": st(i)
|
|
1727
1736
|
}
|
|
1728
1737
|
}));
|
|
1729
1738
|
},
|
|
1730
1739
|
isResumeSession: (t, n) => e.get(`session/${t}/is_resume/`, void 0, n)
|
|
1731
|
-
}),
|
|
1740
|
+
}), lt = (e) => ({
|
|
1732
1741
|
agent: et(e),
|
|
1733
|
-
session:
|
|
1742
|
+
session: ct(e),
|
|
1734
1743
|
message: tt(e),
|
|
1735
1744
|
fetchClient: e
|
|
1736
|
-
}),
|
|
1745
|
+
}), ut = (e) => {
|
|
1737
1746
|
let { fetchClient: t, reset: n } = $e(e);
|
|
1738
1747
|
return {
|
|
1739
|
-
...
|
|
1748
|
+
...lt(t),
|
|
1740
1749
|
reset: n,
|
|
1741
1750
|
onError: t.onError.bind(t)
|
|
1742
1751
|
};
|
|
1743
|
-
},
|
|
1752
|
+
}, dt = () => ({
|
|
1744
1753
|
agent: null,
|
|
1745
1754
|
http: null,
|
|
1746
1755
|
message: null,
|
|
@@ -1757,7 +1766,7 @@ var $e = (e) => {
|
|
|
1757
1766
|
registerSession(e) {
|
|
1758
1767
|
this.session = e;
|
|
1759
1768
|
}
|
|
1760
|
-
}),
|
|
1769
|
+
}), ft = 20, pt = (e) => {
|
|
1761
1770
|
let t = w([]), r = w(null), i = w(0), a = w(0), o = w(0), s = w(!1), c = w(!1), l = w(!1), u = w(!1), d = w(!1), f = w(!1), p = w(!1), m = w(!1), h = n(() => i.value > 0 && i.value < a.value), g = (e) => {
|
|
1762
1771
|
t.value = t.value.map((t) => t.sessionCode === e.sessionCode ? {
|
|
1763
1772
|
...t,
|
|
@@ -1767,14 +1776,14 @@ var $e = (e) => {
|
|
|
1767
1776
|
c.value = !0;
|
|
1768
1777
|
let r = {
|
|
1769
1778
|
page: n?.page ?? 1,
|
|
1770
|
-
page_size: n?.page_size ??
|
|
1779
|
+
page_size: n?.page_size ?? ft
|
|
1771
1780
|
};
|
|
1772
1781
|
return e.http?.session.getSessions(r).then((e) => {
|
|
1773
1782
|
t.value = e.results, i.value = e.page, a.value = e.numPages, o.value = e.count;
|
|
1774
1783
|
}).finally(() => {
|
|
1775
1784
|
c.value = !1;
|
|
1776
1785
|
});
|
|
1777
|
-
}, v = async (n =
|
|
1786
|
+
}, v = async (n = ft) => {
|
|
1778
1787
|
if (!(!h.value || c.value || l.value)) {
|
|
1779
1788
|
l.value = !0;
|
|
1780
1789
|
try {
|
|
@@ -1867,8 +1876,8 @@ var $e = (e) => {
|
|
|
1867
1876
|
t.value = [], r.value = null, i.value = 0, a.value = 0, o.value = 0, s.value = !1, c.value = !1, l.value = !1, u.value = !1, d.value = !1, f.value = !1, p.value = !1, m.value = !1;
|
|
1868
1877
|
}
|
|
1869
1878
|
};
|
|
1870
|
-
},
|
|
1871
|
-
let t =
|
|
1879
|
+
}, mt = (e) => {
|
|
1880
|
+
let t = dt(), n = ut(e), r = Be(t, e.protocol), i = ke(t), a = pt(t);
|
|
1872
1881
|
return t.registerHttp(n), t.registerMessage(i), t.registerAgent(r), t.registerSession(a), {
|
|
1873
1882
|
agent: r,
|
|
1874
1883
|
session: a,
|
|
@@ -1879,23 +1888,23 @@ var $e = (e) => {
|
|
|
1879
1888
|
},
|
|
1880
1889
|
onError: n.onError
|
|
1881
1890
|
};
|
|
1882
|
-
},
|
|
1891
|
+
}, ht = new Set([
|
|
1883
1892
|
"context_type",
|
|
1884
1893
|
"__label",
|
|
1885
1894
|
"__key",
|
|
1886
1895
|
"__value"
|
|
1887
1896
|
]);
|
|
1888
|
-
function
|
|
1897
|
+
function gt(e, t) {
|
|
1889
1898
|
return {
|
|
1890
1899
|
urlPrefix: e,
|
|
1891
1900
|
headers: () => Q(A(t)?.headers),
|
|
1892
1901
|
data: () => Q(A(t)?.data)
|
|
1893
1902
|
};
|
|
1894
1903
|
}
|
|
1895
|
-
function
|
|
1904
|
+
function _t(e) {
|
|
1896
1905
|
return e ? Array.isArray(e) ? e.map((e) => {
|
|
1897
1906
|
if (e.__key) return e;
|
|
1898
|
-
let t = Object.entries(e).filter(([e]) => !
|
|
1907
|
+
let t = Object.entries(e).filter(([e]) => !ht.has(e));
|
|
1899
1908
|
if (t.length === 0) return e;
|
|
1900
1909
|
let [n, r] = t[0];
|
|
1901
1910
|
return {
|
|
@@ -1914,14 +1923,14 @@ function gt(e) {
|
|
|
1914
1923
|
__value: t
|
|
1915
1924
|
})) : [];
|
|
1916
1925
|
}
|
|
1917
|
-
function
|
|
1926
|
+
function vt(e, t) {
|
|
1918
1927
|
if (!t) return e;
|
|
1919
1928
|
let n = t()?.context;
|
|
1920
1929
|
if (!n) return e;
|
|
1921
|
-
let r =
|
|
1922
|
-
return r.length === 0 ? e :
|
|
1930
|
+
let r = _t(n);
|
|
1931
|
+
return r.length === 0 ? e : yt(e, r);
|
|
1923
1932
|
}
|
|
1924
|
-
function
|
|
1933
|
+
function yt(e, t) {
|
|
1925
1934
|
if (t.length === 0) return e ?? {};
|
|
1926
1935
|
let n = e ?? {}, r = n.extra ?? {}, i = r.context ?? [], a = new Set(t.map((e) => e.__key).filter(Boolean)), o = i.filter((e) => {
|
|
1927
1936
|
let t = e.__key;
|
|
@@ -1937,25 +1946,25 @@ function vt(e, t) {
|
|
|
1937
1946
|
}
|
|
1938
1947
|
//#endregion
|
|
1939
1948
|
//#region src/utils/message-utils.ts
|
|
1940
|
-
function
|
|
1949
|
+
function bt(e) {
|
|
1941
1950
|
return e.some((e) => {
|
|
1942
1951
|
if (!("property" in e)) return !0;
|
|
1943
1952
|
let { property: t } = e;
|
|
1944
1953
|
return !t?.extra?.pause;
|
|
1945
1954
|
});
|
|
1946
1955
|
}
|
|
1947
|
-
function
|
|
1956
|
+
function xt(e, t) {
|
|
1948
1957
|
let n = null;
|
|
1949
1958
|
for (let r of e) if (r.role === "user" && r.id !== void 0 && (n = r), r === t) break;
|
|
1950
1959
|
return n;
|
|
1951
1960
|
}
|
|
1952
|
-
function
|
|
1953
|
-
let n =
|
|
1961
|
+
function St(e, t) {
|
|
1962
|
+
let n = xt(e, t);
|
|
1954
1963
|
if (n?.id !== void 0) return typeof n.id == "number" ? n.id : Number(n.id);
|
|
1955
1964
|
}
|
|
1956
1965
|
//#endregion
|
|
1957
1966
|
//#region src/utils/parse-custom-blocks.ts
|
|
1958
|
-
function
|
|
1967
|
+
function Ct(e) {
|
|
1959
1968
|
if (!e) return [];
|
|
1960
1969
|
if (typeof e != "string") return [{
|
|
1961
1970
|
type: "text",
|
|
@@ -1996,19 +2005,19 @@ function St(e) {
|
|
|
1996
2005
|
}
|
|
1997
2006
|
//#endregion
|
|
1998
2007
|
//#region src/utils/index.ts
|
|
1999
|
-
var
|
|
2008
|
+
var wt = (e) => {
|
|
2000
2009
|
let t = document.cookie.match(RegExp(`(^| )${e}=([^;]*)(;|$)`));
|
|
2001
2010
|
return t ? t[2] : "";
|
|
2002
|
-
},
|
|
2011
|
+
}, Tt = (e) => e.endsWith("/") ? e : `${e}/`, Et = (e) => {
|
|
2003
2012
|
if (!e) return e;
|
|
2004
2013
|
try {
|
|
2005
2014
|
let t = new URL(e, window.location.origin);
|
|
2006
|
-
return t.protocol = window.location.protocol,
|
|
2015
|
+
return t.protocol = window.location.protocol, Tt(t.toString());
|
|
2007
2016
|
} catch (t) {
|
|
2008
|
-
return console.warn("Failed to normalize URL:", t),
|
|
2017
|
+
return console.warn("Failed to normalize URL:", t), Tt(e);
|
|
2009
2018
|
}
|
|
2010
2019
|
};
|
|
2011
|
-
async function
|
|
2020
|
+
async function Dt(e) {
|
|
2012
2021
|
if (typeof navigator < "u" && "clipboard" in navigator) try {
|
|
2013
2022
|
return await navigator.clipboard.writeText(e), !0;
|
|
2014
2023
|
} catch {}
|
|
@@ -2022,23 +2031,23 @@ async function Et(e) {
|
|
|
2022
2031
|
document.body.removeChild(t);
|
|
2023
2032
|
}
|
|
2024
2033
|
}
|
|
2025
|
-
function
|
|
2034
|
+
function Ot() {
|
|
2026
2035
|
let e = window.navigator.userAgent.toLowerCase(), t = window.navigator.platform.toLowerCase();
|
|
2027
2036
|
return t.includes("mac") || e.includes("mac") ? "mac" : t.includes("win") || e.includes("win") ? "windows" : t.includes("linux") || e.includes("linux") ? "linux" : "unknown";
|
|
2028
2037
|
}
|
|
2029
|
-
function Ot() {
|
|
2030
|
-
return kt() ? "Cmd + I" : "Ctrl + I";
|
|
2031
|
-
}
|
|
2032
2038
|
function kt() {
|
|
2033
|
-
return
|
|
2039
|
+
return At() ? "Cmd + I" : "Ctrl + I";
|
|
2040
|
+
}
|
|
2041
|
+
function At() {
|
|
2042
|
+
return Ot() === "mac";
|
|
2034
2043
|
}
|
|
2035
|
-
function
|
|
2036
|
-
let t =
|
|
2044
|
+
function jt(e) {
|
|
2045
|
+
let t = At() ? e.metaKey : e.ctrlKey, n = e.key.toLowerCase() === "i";
|
|
2037
2046
|
return t && n && !e.shiftKey && !e.altKey;
|
|
2038
2047
|
}
|
|
2039
2048
|
//#endregion
|
|
2040
2049
|
//#region src/lang/index.ts
|
|
2041
|
-
var
|
|
2050
|
+
var Mt = wt("blueking_language") || "zh-cn", Nt = {
|
|
2042
2051
|
小鲸: "BK GPT",
|
|
2043
2052
|
关闭: "close",
|
|
2044
2053
|
发送: "Send",
|
|
@@ -2077,7 +2086,7 @@ var jt = Ct("blueking_language") || "zh-cn", Mt = {
|
|
|
2077
2086
|
请求失败: "Request failed",
|
|
2078
2087
|
当前已是新会话: "Already in a new session",
|
|
2079
2088
|
"正在创建会话...": "Creating session..."
|
|
2080
|
-
},
|
|
2089
|
+
}, Pt = {
|
|
2081
2090
|
重命名: "重命名",
|
|
2082
2091
|
自动生成命名: "自动生成命名",
|
|
2083
2092
|
分享会话: "分享会话",
|
|
@@ -2086,10 +2095,10 @@ var jt = Ct("blueking_language") || "zh-cn", Mt = {
|
|
|
2086
2095
|
确定: "确定",
|
|
2087
2096
|
分享链接已复制到剪贴板: "分享链接已复制到剪贴板",
|
|
2088
2097
|
请求失败: "请求失败"
|
|
2089
|
-
}, $ = (e) =>
|
|
2098
|
+
}, $ = (e) => Mt === "en" ? Nt[e] || e : Pt[e] || e;
|
|
2090
2099
|
//#endregion
|
|
2091
2100
|
//#region src/composables/use-history-panel.ts
|
|
2092
|
-
function
|
|
2101
|
+
function Ft(e) {
|
|
2093
2102
|
let { triggerRef: t, panelComponent: n, panelProps: r = {}, tippyOptions: i = {} } = e, a = w(null), o = null, s = () => (o ||= document.createElement("div"), T(f(n, {
|
|
2094
2103
|
...r,
|
|
2095
2104
|
onClose: d
|
|
@@ -2152,7 +2161,7 @@ function Pt(e) {
|
|
|
2152
2161
|
}
|
|
2153
2162
|
//#endregion
|
|
2154
2163
|
//#region src/components/ai-header/history-dropdown/history-group.vue?vue&type=script&setup=true&lang.ts
|
|
2155
|
-
var
|
|
2164
|
+
var It = { class: "history-group" }, Lt = { class: "history-group-title" }, Rt = { class: "history-group-list" }, zt = /* @__PURE__ */ u({
|
|
2156
2165
|
__name: "history-group",
|
|
2157
2166
|
props: {
|
|
2158
2167
|
currentSessionCode: {},
|
|
@@ -2161,13 +2170,13 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2161
2170
|
},
|
|
2162
2171
|
setup(e) {
|
|
2163
2172
|
let t = e;
|
|
2164
|
-
return (e, n) => (S(), a("div",
|
|
2173
|
+
return (e, n) => (S(), a("div", It, [o("div", Lt, [o("span", null, k(t.title), 1)]), o("div", Rt, [D(e.$slots, "default", {}, void 0, !0)])]));
|
|
2165
2174
|
}
|
|
2166
|
-
}),
|
|
2175
|
+
}), Bt = (e, t) => {
|
|
2167
2176
|
let n = e.__vccOpts || e;
|
|
2168
2177
|
for (let [e, r] of t) n[e] = r;
|
|
2169
2178
|
return n;
|
|
2170
|
-
},
|
|
2179
|
+
}, Vt = /* @__PURE__ */ Bt(zt, [["__scopeId", "data-v-3b603cb6"]]), Ht = { class: "history-item-actions" }, Ut = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
2171
2180
|
__name: "history-item",
|
|
2172
2181
|
props: {
|
|
2173
2182
|
isActive: { type: Boolean },
|
|
@@ -2228,7 +2237,7 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2228
2237
|
}, null, 8, ["modelValue"])) : (S(), a(e, { key: 0 }, [l(j(G), { style: { width: "calc(100% - 42px)" } }, {
|
|
2229
2238
|
default: L(() => [c(k(i.session.sessionName), 1)]),
|
|
2230
2239
|
_: 1
|
|
2231
|
-
}), o("span",
|
|
2240
|
+
}), o("span", Ht, [R(o("i", {
|
|
2232
2241
|
class: "bkai-icon bkai-bianji",
|
|
2233
2242
|
onClick: z(m, ["stop"])
|
|
2234
2243
|
}, null, 512), [[j(u), {
|
|
@@ -2252,7 +2261,7 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2252
2261
|
_: 1
|
|
2253
2262
|
}, 8, ["title"])])], 64))], 2));
|
|
2254
2263
|
}
|
|
2255
|
-
}), [["__scopeId", "data-v-fea14d3a"]]),
|
|
2264
|
+
}), [["__scopeId", "data-v-fea14d3a"]]), Wt = { class: "history-search" }, Gt = { class: "input-icon" }, Kt = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
2256
2265
|
__name: "history-search",
|
|
2257
2266
|
props: {
|
|
2258
2267
|
modelValue: { default: "" },
|
|
@@ -2263,21 +2272,21 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2263
2272
|
let n = e, r = t, i = (e) => {
|
|
2264
2273
|
r("update:modelValue", e);
|
|
2265
2274
|
};
|
|
2266
|
-
return (e, t) => (S(), a("div",
|
|
2275
|
+
return (e, t) => (S(), a("div", Wt, [l(j(ce), {
|
|
2267
2276
|
"model-value": n.modelValue,
|
|
2268
2277
|
behavior: "simplicity",
|
|
2269
2278
|
placeholder: n.placeholder || j($)("搜索会话名称"),
|
|
2270
2279
|
style: { height: "22px" },
|
|
2271
2280
|
"onUpdate:modelValue": i
|
|
2272
2281
|
}, {
|
|
2273
|
-
suffix: L(() => [o("span",
|
|
2282
|
+
suffix: L(() => [o("span", Gt, [l(j(ge))])]),
|
|
2274
2283
|
_: 1
|
|
2275
2284
|
}, 8, ["model-value", "placeholder"])]));
|
|
2276
2285
|
}
|
|
2277
|
-
}), [["__scopeId", "data-v-e7ff40b2"]]),
|
|
2286
|
+
}), [["__scopeId", "data-v-e7ff40b2"]]), qt = { class: "history-dropdown-header" }, Jt = { class: "history-dropdown-header-title" }, Yt = { class: "history-dropdown-content" }, Xt = {
|
|
2278
2287
|
key: 0,
|
|
2279
2288
|
class: "history-dropdown-loading"
|
|
2280
|
-
},
|
|
2289
|
+
}, Zt = { class: "history-dropdown-loading-dots" }, Qt = 40, $t = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
2281
2290
|
__name: "index",
|
|
2282
2291
|
props: { sessionBusinessManager: {} },
|
|
2283
2292
|
emits: [
|
|
@@ -2289,7 +2298,7 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2289
2298
|
setup(t, { emit: s }) {
|
|
2290
2299
|
let c = t, u = s, d = w(""), f = w(null), p = n(() => c.sessionBusinessManager.currentSession.value?.sessionCode), m = n(() => c.sessionBusinessManager.isLoadingMore.value), h = (e) => {
|
|
2291
2300
|
let t = e.target;
|
|
2292
|
-
t.scrollHeight - t.scrollTop - t.clientHeight >
|
|
2301
|
+
t.scrollHeight - t.scrollTop - t.clientHeight > Qt || c.sessionBusinessManager.hasMoreSessions.value && (c.sessionBusinessManager.isLoadingMore.value || c.sessionBusinessManager.loadMoreSessions());
|
|
2293
2302
|
}, g = n(() => {
|
|
2294
2303
|
let e = {
|
|
2295
2304
|
today: {
|
|
@@ -2354,17 +2363,17 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2354
2363
|
return (t, n) => (S(), a("div", {
|
|
2355
2364
|
class: "bkai-history-dropdown",
|
|
2356
2365
|
onScroll: h
|
|
2357
|
-
}, [o("div",
|
|
2366
|
+
}, [o("div", qt, [o("h1", Jt, k(j($)("历史会话")), 1), l(Kt, {
|
|
2358
2367
|
modelValue: d.value,
|
|
2359
2368
|
"onUpdate:modelValue": n[0] ||= (e) => d.value = e,
|
|
2360
2369
|
placeholder: j($)("搜索会话名称")
|
|
2361
|
-
}, null, 8, ["modelValue", "placeholder"])]), o("div",
|
|
2370
|
+
}, null, 8, ["modelValue", "placeholder"])]), o("div", Yt, [g.value.length > 0 ? (S(), a(e, { key: 0 }, [(S(!0), a(e, null, E(g.value, (t) => (S(), r(Vt, {
|
|
2362
2371
|
key: t.key,
|
|
2363
2372
|
"current-session-code": p.value,
|
|
2364
2373
|
sessions: t.sessionList,
|
|
2365
2374
|
title: t.alias
|
|
2366
2375
|
}, {
|
|
2367
|
-
default: L(() => [(S(!0), a(e, null, E(t.sessionList, (e) => (S(), r(
|
|
2376
|
+
default: L(() => [(S(!0), a(e, null, E(t.sessionList, (e) => (S(), r(Ut, {
|
|
2368
2377
|
key: e.sessionCode,
|
|
2369
2378
|
"is-active": _(e.sessionCode),
|
|
2370
2379
|
"is-editing": f.value === e.sessionCode,
|
|
@@ -2384,7 +2393,7 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2384
2393
|
"current-session-code",
|
|
2385
2394
|
"sessions",
|
|
2386
2395
|
"title"
|
|
2387
|
-
]))), 128)), m.value ? (S(), a("div",
|
|
2396
|
+
]))), 128)), m.value ? (S(), a("div", Xt, [o("span", Zt, [(S(), a(e, null, E(3, (e) => o("i", {
|
|
2388
2397
|
key: e,
|
|
2389
2398
|
class: "history-dropdown-loading-dot",
|
|
2390
2399
|
style: v({ "--dot-index": e - 1 })
|
|
@@ -2399,10 +2408,10 @@ var Ft = { class: "history-group" }, It = { class: "history-group-title" }, Lt =
|
|
|
2399
2408
|
}), [["__scopeId", "data-v-bf2401b6"]]);
|
|
2400
2409
|
//#endregion
|
|
2401
2410
|
//#region src/components/ai-header/history-dropdown/use-history-dropdown.ts
|
|
2402
|
-
function
|
|
2403
|
-
return e.sessionBusinessManager ?
|
|
2411
|
+
function en(e) {
|
|
2412
|
+
return e.sessionBusinessManager ? Ft({
|
|
2404
2413
|
triggerRef: e.triggerRef,
|
|
2405
|
-
panelComponent:
|
|
2414
|
+
panelComponent: $t,
|
|
2406
2415
|
panelProps: {
|
|
2407
2416
|
sessionBusinessManager: e.sessionBusinessManager,
|
|
2408
2417
|
onSessionSwitch: e.onSessionSwitch,
|
|
@@ -2425,16 +2434,16 @@ function $t(e) {
|
|
|
2425
2434
|
}
|
|
2426
2435
|
//#endregion
|
|
2427
2436
|
//#region src/components/ai-header/index.vue?vue&type=script&setup=true&lang.ts
|
|
2428
|
-
var
|
|
2437
|
+
var tn = { class: "left-section" }, nn = { class: "logo" }, rn = ["src"], an = {
|
|
2429
2438
|
key: 0,
|
|
2430
2439
|
class: "rename-tooltip"
|
|
2431
|
-
},
|
|
2440
|
+
}, on = { class: "rename-content" }, sn = {
|
|
2432
2441
|
key: 0,
|
|
2433
2442
|
class: "tippy-dropdown-menu"
|
|
2434
|
-
},
|
|
2443
|
+
}, cn = {
|
|
2435
2444
|
key: 1,
|
|
2436
2445
|
class: "bkai-icon bkai-auto-refresh-line"
|
|
2437
|
-
},
|
|
2446
|
+
}, ln = { class: "right-section" }, un = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
2438
2447
|
__name: "index",
|
|
2439
2448
|
props: {
|
|
2440
2449
|
title: { default: "" },
|
|
@@ -2503,7 +2512,7 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2503
2512
|
],
|
|
2504
2513
|
setup(e, { expose: t, emit: s }) {
|
|
2505
2514
|
let u = e, d = s, f = fe, p = w(null), m = w(null), h = P("moreMenuTippyRef"), _ = w(!1), x = w(""), C = w(null), T = w(!1), E = () => document.querySelector(".ai-blueking-panel") || document.body, O = null, A = () => {
|
|
2506
|
-
!m.value || !u.sessionBusinessManager || (O =
|
|
2515
|
+
!m.value || !u.sessionBusinessManager || (O = en({
|
|
2507
2516
|
triggerRef: m,
|
|
2508
2517
|
sessionBusinessManager: u.sessionBusinessManager,
|
|
2509
2518
|
onSessionSwitch: (e) => d("history-session-switch", e),
|
|
@@ -2587,15 +2596,15 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2587
2596
|
ref: p,
|
|
2588
2597
|
class: g(["ai-header drag-handle", { draggable: u.draggable }])
|
|
2589
2598
|
}, [
|
|
2590
|
-
o("div",
|
|
2591
|
-
o("div",
|
|
2599
|
+
o("div", tn, [
|
|
2600
|
+
o("div", nn, [o("img", {
|
|
2592
2601
|
alt: "logo",
|
|
2593
2602
|
src: j(ve)
|
|
2594
|
-
}, null, 8,
|
|
2603
|
+
}, null, 8, rn)]),
|
|
2595
2604
|
o("div", { class: g(["title", { "title-with-tooltip": _.value }]) }, [
|
|
2596
2605
|
c(k(M.value) + " ", 1),
|
|
2597
2606
|
i(" 重命名 tooltip 直接绑定在 title 上 "),
|
|
2598
|
-
_.value ? (S(), a("div",
|
|
2607
|
+
_.value ? (S(), a("div", an, [o("div", on, [l(j(ce), {
|
|
2599
2608
|
ref_key: "renameInputRef",
|
|
2600
2609
|
ref: C,
|
|
2601
2610
|
modelValue: x.value,
|
|
@@ -2626,7 +2635,7 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2626
2635
|
onHidden: n[1] ||= (e) => T.value = !1,
|
|
2627
2636
|
onShown: n[2] ||= (e) => T.value = !0
|
|
2628
2637
|
}, {
|
|
2629
|
-
content: L(() => [T.value ? (S(), a("div",
|
|
2638
|
+
content: L(() => [T.value ? (S(), a("div", sn, [
|
|
2630
2639
|
u.dropdownMenuConfig?.showRename ? (S(), a("div", {
|
|
2631
2640
|
key: 0,
|
|
2632
2641
|
class: "tippy-menu-item",
|
|
@@ -2641,7 +2650,7 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2641
2650
|
mode: "spin",
|
|
2642
2651
|
size: "mini",
|
|
2643
2652
|
theme: "primary"
|
|
2644
|
-
})) : (S(), a("i",
|
|
2653
|
+
})) : (S(), a("i", cn)), o("span", null, k(j($)("自动生成命名")), 1)], 2)), [[j(me), {
|
|
2645
2654
|
content: u.hasSessionContents ? "" : j($)("请先发起会话"),
|
|
2646
2655
|
theme: "ai-blueking-tooltip",
|
|
2647
2656
|
arrow: !0,
|
|
@@ -2668,7 +2677,7 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2668
2677
|
}, 512)) : i("v-if", !0)
|
|
2669
2678
|
]),
|
|
2670
2679
|
D(t.$slots, "headerLeft", {}, void 0, !0),
|
|
2671
|
-
o("div",
|
|
2680
|
+
o("div", ln, [
|
|
2672
2681
|
i(" 新增会话按钮 "),
|
|
2673
2682
|
u.showNewChatIcon && e.enableChatSession !== !1 ? R((S(), a("i", {
|
|
2674
2683
|
key: 0,
|
|
@@ -2728,21 +2737,21 @@ var en = { class: "left-section" }, tn = { class: "logo" }, nn = ["src"], rn = {
|
|
|
2728
2737
|
}), [["__scopeId", "data-v-32672b9d"]]);
|
|
2729
2738
|
//#endregion
|
|
2730
2739
|
//#region src/bootstrap/agent-bootstrap.ts
|
|
2731
|
-
function
|
|
2732
|
-
let t =
|
|
2740
|
+
function dn(e) {
|
|
2741
|
+
let t = Et(e);
|
|
2733
2742
|
fetch(t, {
|
|
2734
2743
|
method: "GET",
|
|
2735
2744
|
credentials: "include"
|
|
2736
2745
|
}).catch(() => {});
|
|
2737
2746
|
}
|
|
2738
|
-
async function
|
|
2747
|
+
async function fn(e) {
|
|
2739
2748
|
await Promise.all([e.agent.getAgentInfo(), e.session.getSessions()]);
|
|
2740
2749
|
let t = e.agent.info.value?.saasUrl;
|
|
2741
|
-
t &&
|
|
2750
|
+
t && dn(t);
|
|
2742
2751
|
}
|
|
2743
2752
|
//#endregion
|
|
2744
2753
|
//#region src/manager/business/chat-business-manager.ts
|
|
2745
|
-
var
|
|
2754
|
+
var pn = class {
|
|
2746
2755
|
_isGenerating;
|
|
2747
2756
|
_isStopLoading;
|
|
2748
2757
|
agentModule;
|
|
@@ -2816,7 +2825,7 @@ var fn = class {
|
|
|
2816
2825
|
async regenerateFromAIMessages(e, t) {
|
|
2817
2826
|
try {
|
|
2818
2827
|
if (!e || e.length === 0) throw Error("No AI messages provided");
|
|
2819
|
-
let n = this.messages.value, r =
|
|
2828
|
+
let n = this.messages.value, r = xt(n, e[0]);
|
|
2820
2829
|
if (!r) throw Error("No user message found before AI messages");
|
|
2821
2830
|
let i = r.id;
|
|
2822
2831
|
if (i === void 0) throw Error("User message has no id");
|
|
@@ -2900,7 +2909,7 @@ var fn = class {
|
|
|
2900
2909
|
this._isStopLoading.value = !1;
|
|
2901
2910
|
}
|
|
2902
2911
|
}
|
|
2903
|
-
},
|
|
2912
|
+
}, mn = class {
|
|
2904
2913
|
agentModule;
|
|
2905
2914
|
config;
|
|
2906
2915
|
eventEmitter;
|
|
@@ -3003,7 +3012,7 @@ var fn = class {
|
|
|
3003
3012
|
return t == null ? !1 : t === 0;
|
|
3004
3013
|
}
|
|
3005
3014
|
isCurrentSessionEmpty(e) {
|
|
3006
|
-
return this.messageModule &&
|
|
3015
|
+
return this.messageModule && bt(this.messageModule.list.value) ? !1 : this.isSessionEmpty(e);
|
|
3007
3016
|
}
|
|
3008
3017
|
findSession(e) {
|
|
3009
3018
|
return this.sessionList.value.find((t) => t.sessionCode === e);
|
|
@@ -3079,7 +3088,7 @@ var fn = class {
|
|
|
3079
3088
|
}), e;
|
|
3080
3089
|
}
|
|
3081
3090
|
}
|
|
3082
|
-
},
|
|
3091
|
+
}, hn = class {
|
|
3083
3092
|
messageModule;
|
|
3084
3093
|
sessionModule;
|
|
3085
3094
|
constructor(e, t) {
|
|
@@ -3096,7 +3105,7 @@ var fn = class {
|
|
|
3096
3105
|
userMessageIds: e.map((e) => String(e.id))
|
|
3097
3106
|
};
|
|
3098
3107
|
}
|
|
3099
|
-
},
|
|
3108
|
+
}, gn = class {
|
|
3100
3109
|
_agentShortcuts;
|
|
3101
3110
|
_effectiveShortcuts;
|
|
3102
3111
|
_propsShortcuts;
|
|
@@ -3153,7 +3162,7 @@ var fn = class {
|
|
|
3153
3162
|
setShortcuts(e) {
|
|
3154
3163
|
this._propsShortcuts.value = e;
|
|
3155
3164
|
}
|
|
3156
|
-
},
|
|
3165
|
+
}, _n = class {
|
|
3157
3166
|
_isCompressed;
|
|
3158
3167
|
_isDraggingOrResizing;
|
|
3159
3168
|
_nimbusMinimized;
|
|
@@ -3368,12 +3377,12 @@ var fn = class {
|
|
|
3368
3377
|
};
|
|
3369
3378
|
}
|
|
3370
3379
|
};
|
|
3371
|
-
function
|
|
3372
|
-
return new
|
|
3380
|
+
function vn(e) {
|
|
3381
|
+
return new _n(e);
|
|
3373
3382
|
}
|
|
3374
3383
|
//#endregion
|
|
3375
3384
|
//#region src/manager/event-types.ts
|
|
3376
|
-
var
|
|
3385
|
+
var yn = {
|
|
3377
3386
|
"panel-show": "show",
|
|
3378
3387
|
"panel-hide": "close",
|
|
3379
3388
|
"panel-toggle": null,
|
|
@@ -3423,7 +3432,7 @@ var vn = {
|
|
|
3423
3432
|
"agent-info-loaded": null,
|
|
3424
3433
|
error: null
|
|
3425
3434
|
};
|
|
3426
|
-
function
|
|
3435
|
+
function bn(e, t) {
|
|
3427
3436
|
switch (e) {
|
|
3428
3437
|
case "send-message": return [t.content];
|
|
3429
3438
|
case "rename": return [t.newName];
|
|
@@ -3454,7 +3463,7 @@ function yn(e, t) {
|
|
|
3454
3463
|
}
|
|
3455
3464
|
//#endregion
|
|
3456
3465
|
//#region src/manager/ui/ui-state-manager.ts
|
|
3457
|
-
var
|
|
3466
|
+
var xn = class {
|
|
3458
3467
|
_selectedMessageIds;
|
|
3459
3468
|
_isSelectionMode;
|
|
3460
3469
|
_editingSessionCode;
|
|
@@ -3527,12 +3536,12 @@ var bn = class {
|
|
|
3527
3536
|
reset() {
|
|
3528
3537
|
this.clearSelection(), this.disableSelectionMode(), this.stopEditingSession(), this.clearLoadingStates();
|
|
3529
3538
|
}
|
|
3530
|
-
},
|
|
3539
|
+
}, Sn = class extends Error {
|
|
3531
3540
|
constructor() {
|
|
3532
3541
|
super("[ChatBot] Initialization was superseded by a newer init"), this.name = "ChatBotInitStaleError";
|
|
3533
3542
|
}
|
|
3534
3543
|
};
|
|
3535
|
-
function
|
|
3544
|
+
function Cn(e) {
|
|
3536
3545
|
let { props: t, emit: r, scrollToBottom: i } = e, a = O(null), o = O(null), s = O(null), c = O(null), l = w(!1), u = w(!t.chatHelper), d = w(null), f = n(() => l.value), p = () => t.chatHelper ? !t.chatHelper.agent || !t.chatHelper.session || !t.chatHelper.message ? {
|
|
3537
3546
|
valid: !1,
|
|
3538
3547
|
error: "[ChatBot] Invalid chatHelper: missing required modules (agent, session, message)"
|
|
@@ -3556,8 +3565,8 @@ function Sn(e) {
|
|
|
3556
3565
|
onError: (e) => {
|
|
3557
3566
|
r("error", e);
|
|
3558
3567
|
}
|
|
3559
|
-
}), a =
|
|
3560
|
-
requestData:
|
|
3568
|
+
}), a = mt({
|
|
3569
|
+
requestData: gt(Et(t.url), () => A(t.requestOptions)),
|
|
3561
3570
|
protocol: n
|
|
3562
3571
|
});
|
|
3563
3572
|
return n.injectMessageModule(a.message), a;
|
|
@@ -3569,31 +3578,31 @@ function Sn(e) {
|
|
|
3569
3578
|
}, g = 0, _ = null, v = null, b = null, x = (e) => {
|
|
3570
3579
|
b &&= (e ? b.reject(e) : b.resolve(), null), _ = null;
|
|
3571
3580
|
}, S = (e) => {
|
|
3572
|
-
if (e !== g) throw new
|
|
3581
|
+
if (e !== g) throw new Sn();
|
|
3573
3582
|
}, C = async (e) => {
|
|
3574
3583
|
let n = a.value, i = u.value;
|
|
3575
3584
|
l.value = !1, d.value = null, u.value = !t.chatHelper, await h(n, i), S(e), a.value = null, o.value = null, s.value = null, c.value = null;
|
|
3576
3585
|
let f = m();
|
|
3577
3586
|
if (!f) throw d.value ?? /* @__PURE__ */ Error("[ChatBot] Failed to create chatHelper");
|
|
3578
|
-
let p = new
|
|
3587
|
+
let p = new mn(f.session, f.agent, null, {
|
|
3579
3588
|
enableChatSession: !0,
|
|
3580
3589
|
autoSwitchToInitialSession: !!t.sessionCode,
|
|
3581
3590
|
loadRecentSessionOnMount: t.autoLoad,
|
|
3582
3591
|
initialSessionCode: t.sessionCode,
|
|
3583
3592
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
3584
|
-
}, f.message), g = new
|
|
3593
|
+
}, f.message), g = new pn(f.agent, f.message, f.session, null, {
|
|
3585
3594
|
openingRemark: t.helloText,
|
|
3586
3595
|
predefinedQuestions: t.prompts,
|
|
3587
3596
|
placeholder: t.placeholder
|
|
3588
|
-
}), _ = new
|
|
3597
|
+
}), _ = new gn(null, t.shortcuts || []);
|
|
3589
3598
|
a.value = f, o.value = p, s.value = g, c.value = _;
|
|
3590
3599
|
try {
|
|
3591
|
-
u.value && (await
|
|
3600
|
+
u.value && (await fn(f), S(e), await p.loadRecentSession({ skipLoadSessions: !0 }), S(e)), S(e), l.value = !0, r("agent-info-loaded", f);
|
|
3592
3601
|
} catch (t) {
|
|
3593
3602
|
throw S(e), console.error("Failed to initialize ChatBot:", t), d.value = t, r("error", t), t;
|
|
3594
3603
|
}
|
|
3595
3604
|
}, T = () => {
|
|
3596
|
-
x(new
|
|
3605
|
+
x(new Sn()), v = null;
|
|
3597
3606
|
let e = ++g;
|
|
3598
3607
|
_ = new Promise((t, n) => {
|
|
3599
3608
|
b = {
|
|
@@ -3627,7 +3636,7 @@ function Sn(e) {
|
|
|
3627
3636
|
}
|
|
3628
3637
|
//#endregion
|
|
3629
3638
|
//#region src/components/composables/use-chatbot-state.ts
|
|
3630
|
-
function
|
|
3639
|
+
function wn(e) {
|
|
3631
3640
|
let { props: t, chatHelper: r, chatBusinessManager: i, sessionBusinessManager: a, shortcutManager: o, isStandaloneMode: s, isInitialized: c, selectedShortcut: l } = e, u = n(() => i.value?.isStopLoading.value ? W.StopLoading : ((t.chatHelper || r.value)?.agent)?.isChatting?.value ? W.Streaming : W.Complete), d = n(() => u.value === W.Streaming ? ie.Disabled : void 0), f = n(() => i.value?.messages.value ?? []), p = n(() => i.value?.isMessagesLoading.value ?? !1);
|
|
3632
3641
|
return {
|
|
3633
3642
|
messageStatus: u,
|
|
@@ -3656,33 +3665,33 @@ function Cn(e) {
|
|
|
3656
3665
|
}
|
|
3657
3666
|
//#endregion
|
|
3658
3667
|
//#region src/components/composables/use-interrupt-resume.ts
|
|
3659
|
-
var
|
|
3668
|
+
var Tn = "others", En = {
|
|
3660
3669
|
[H.ApprovalCancel]: xe.ApprovalCancel,
|
|
3661
3670
|
[H.FlowNodeRetry]: xe.FlowNodeRetry,
|
|
3662
3671
|
[H.FlowNodeSkip]: xe.FlowNodeSkip
|
|
3663
3672
|
};
|
|
3664
|
-
function
|
|
3673
|
+
function Dn(e) {
|
|
3665
3674
|
return "operation" in e;
|
|
3666
3675
|
}
|
|
3667
|
-
function
|
|
3676
|
+
function On(e) {
|
|
3668
3677
|
return "interruptId" in e && "reason" in e && e.reason === te.UserQuestion;
|
|
3669
3678
|
}
|
|
3670
|
-
function
|
|
3679
|
+
function kn(e) {
|
|
3671
3680
|
return e === "cancelled" ? Ne.Cancelled : Ne.Resolved;
|
|
3672
3681
|
}
|
|
3673
|
-
function
|
|
3682
|
+
function An(e) {
|
|
3674
3683
|
let t = e?.session.current?.value?.sessionCode;
|
|
3675
3684
|
if (!t) throw Error("[ChatBot] Cannot resume interrupt: no active session");
|
|
3676
3685
|
return t;
|
|
3677
3686
|
}
|
|
3678
|
-
function
|
|
3687
|
+
function jn(e) {
|
|
3679
3688
|
return {
|
|
3680
3689
|
interruptId: e.interruptId,
|
|
3681
|
-
status:
|
|
3690
|
+
status: kn(e.status),
|
|
3682
3691
|
payload: e.payload
|
|
3683
3692
|
};
|
|
3684
3693
|
}
|
|
3685
|
-
function
|
|
3694
|
+
function Mn(e, t, n) {
|
|
3686
3695
|
let r = e?.metadata?.questions?.[0]?.question ?? "";
|
|
3687
3696
|
return {
|
|
3688
3697
|
interruptId: n.interruptId,
|
|
@@ -3692,23 +3701,23 @@ function jn(e, t, n) {
|
|
|
3692
3701
|
question: r,
|
|
3693
3702
|
multiSelect: !1,
|
|
3694
3703
|
answer: [{
|
|
3695
|
-
label:
|
|
3704
|
+
label: Tn,
|
|
3696
3705
|
description: t
|
|
3697
3706
|
}]
|
|
3698
3707
|
}] }
|
|
3699
3708
|
};
|
|
3700
3709
|
}
|
|
3701
|
-
function
|
|
3710
|
+
function Nn(e) {
|
|
3702
3711
|
let { chatHelper: t, emit: n } = e, r = async (e) => {
|
|
3703
3712
|
let n = t.value;
|
|
3704
3713
|
if (!n) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
3705
|
-
if (!
|
|
3706
|
-
let r =
|
|
3714
|
+
if (!Dn(e)) throw Error("[ChatBot] Unsupported interrupt resume payload");
|
|
3715
|
+
let r = An(n);
|
|
3707
3716
|
if (e.operation === H.ApprovalRefresh) {
|
|
3708
3717
|
n.agent.pollResumeSession(r);
|
|
3709
3718
|
return;
|
|
3710
3719
|
}
|
|
3711
|
-
let i =
|
|
3720
|
+
let i = En[e.operation];
|
|
3712
3721
|
if (!i) throw Error(`[ChatBot] Unsupported interrupt resume operation: ${e.operation}`);
|
|
3713
3722
|
let a = n.agent;
|
|
3714
3723
|
if (e.operation === H.ApprovalCancel) {
|
|
@@ -3722,21 +3731,21 @@ function Mn(e) {
|
|
|
3722
3731
|
}, i = async (e, n) => {
|
|
3723
3732
|
let r = t.value;
|
|
3724
3733
|
if (!r) throw Error("[ChatBot] Cannot resume interrupt: chatHelper not initialized");
|
|
3725
|
-
let i =
|
|
3734
|
+
let i = An(r);
|
|
3726
3735
|
await r.agent.streamRequest({
|
|
3727
3736
|
sessionCode: i,
|
|
3728
|
-
resume:
|
|
3737
|
+
resume: jn(e),
|
|
3729
3738
|
...n ? { input: n } : {}
|
|
3730
3739
|
});
|
|
3731
3740
|
};
|
|
3732
3741
|
return {
|
|
3733
3742
|
handleInterruptResume: async (e, t) => {
|
|
3734
3743
|
try {
|
|
3735
|
-
if (
|
|
3744
|
+
if (Dn(e)) {
|
|
3736
3745
|
await r(e);
|
|
3737
3746
|
return;
|
|
3738
3747
|
}
|
|
3739
|
-
if (
|
|
3748
|
+
if (On(e)) {
|
|
3740
3749
|
await i(e);
|
|
3741
3750
|
return;
|
|
3742
3751
|
}
|
|
@@ -3747,10 +3756,10 @@ function Mn(e) {
|
|
|
3747
3756
|
},
|
|
3748
3757
|
resumeUserQuestionWithInput: async (e, t) => {
|
|
3749
3758
|
try {
|
|
3750
|
-
if (!t.payload || !
|
|
3759
|
+
if (!t.payload || !On(t.payload)) throw Error("[ChatBot] Invalid user question resume options");
|
|
3751
3760
|
let n = typeof e == "string" ? e.trim() : "";
|
|
3752
3761
|
if (!n) throw Error("[ChatBot] User question free text input is empty");
|
|
3753
|
-
await i(
|
|
3762
|
+
await i(Mn(t.interrupt, n, t.payload), n);
|
|
3754
3763
|
} catch (e) {
|
|
3755
3764
|
console.error("[ChatBot] Failed to resume user question with input:", e), n("error", e instanceof Error ? e : Error(String(e)));
|
|
3756
3765
|
}
|
|
@@ -3759,7 +3768,7 @@ function Mn(e) {
|
|
|
3759
3768
|
}
|
|
3760
3769
|
//#endregion
|
|
3761
3770
|
//#region src/components/composables/use-message-sender.ts
|
|
3762
|
-
function
|
|
3771
|
+
function Pn(e) {
|
|
3763
3772
|
let { emit: t, chatHelper: n, chatBusinessManager: r, getRequestOptions: i, resumeUserQuestionWithInput: a, selectedShortcut: o, selectedResources: s } = e, c = O([[]]), l = O(""), u = (e, t) => {
|
|
3764
3773
|
c.value = e, s.value = t;
|
|
3765
3774
|
}, d = async (e, a = {}) => {
|
|
@@ -3767,7 +3776,7 @@ function Nn(e) {
|
|
|
3767
3776
|
let o = n.value.session.current?.value?.sessionCode;
|
|
3768
3777
|
if (!o) throw Error("[ChatBot] Cannot send message: no active session");
|
|
3769
3778
|
c.value = [[]], l.value = "", s.value = [], t("send-message", typeof e == "string" ? e : "");
|
|
3770
|
-
let u =
|
|
3779
|
+
let u = vt(a.property, i);
|
|
3771
3780
|
await r.value.sendMessage(e, o, {
|
|
3772
3781
|
...a,
|
|
3773
3782
|
...u ? { property: u } : {}
|
|
@@ -3811,10 +3820,10 @@ function Nn(e) {
|
|
|
3811
3820
|
}
|
|
3812
3821
|
//#endregion
|
|
3813
3822
|
//#region src/components/composables/use-share-selection.ts
|
|
3814
|
-
function
|
|
3823
|
+
function Fn(e) {
|
|
3815
3824
|
let { emit: t, chatHelper: n, isStandaloneMode: r } = e, i = async (e) => {
|
|
3816
3825
|
if (!(!n.value || e.length === 0)) try {
|
|
3817
|
-
await
|
|
3826
|
+
await Dt((await new hn(n.value.message, n.value.session).shareMessages(e)).shareUrl), ue({
|
|
3818
3827
|
message: "分享链接已复制到剪贴板",
|
|
3819
3828
|
theme: "success"
|
|
3820
3829
|
});
|
|
@@ -3831,7 +3840,7 @@ function Pn(e) {
|
|
|
3831
3840
|
}
|
|
3832
3841
|
//#endregion
|
|
3833
3842
|
//#region src/components/composables/use-shortcuts.ts
|
|
3834
|
-
function
|
|
3843
|
+
function In(e) {
|
|
3835
3844
|
let { props: t, emit: r, shortcutManager: i, doSendMessage: a, selectedShortcut: o } = e, s = n(() => i.value?.effectiveShortcuts.value ?? []), c = (e, t) => {
|
|
3836
3845
|
let n = e, r;
|
|
3837
3846
|
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) {
|
|
@@ -3925,14 +3934,14 @@ function Fn(e) {
|
|
|
3925
3934
|
}
|
|
3926
3935
|
//#endregion
|
|
3927
3936
|
//#region src/components/composables/use-tool-actions.ts
|
|
3928
|
-
function
|
|
3937
|
+
function Ln(e) {
|
|
3929
3938
|
let { emit: t, chatHelper: n, chatBusinessManager: r, cite: i, focusInput: a, scrollToBottom: o, getShortcutFromMessage: s, buildShortcutProperty: c, getRequestOptions: l } = e, u = async (e) => {
|
|
3930
3939
|
if (!r.value || !n.value) {
|
|
3931
3940
|
console.error("[ChatBot] Cannot delete messages: chatBusinessManager not initialized");
|
|
3932
3941
|
return;
|
|
3933
3942
|
}
|
|
3934
3943
|
try {
|
|
3935
|
-
let t = r.value.messages.value, i =
|
|
3944
|
+
let t = r.value.messages.value, i = xt(t, e[0]);
|
|
3936
3945
|
if (!i) {
|
|
3937
3946
|
console.error("[ChatBot] No user message found before AI messages");
|
|
3938
3947
|
return;
|
|
@@ -4014,7 +4023,7 @@ function In(e) {
|
|
|
4014
4023
|
console.error("[ChatBot] Cannot submit feedback: no active session");
|
|
4015
4024
|
return;
|
|
4016
4025
|
}
|
|
4017
|
-
let c =
|
|
4026
|
+
let c = St(r.value?.messages.value || [], i[0]);
|
|
4018
4027
|
if (c === void 0) {
|
|
4019
4028
|
console.error("[ChatBot] Cannot submit feedback: no user message found");
|
|
4020
4029
|
return;
|
|
@@ -4059,7 +4068,7 @@ function In(e) {
|
|
|
4059
4068
|
return;
|
|
4060
4069
|
}
|
|
4061
4070
|
try {
|
|
4062
|
-
let t = e.property, n =
|
|
4071
|
+
let t = e.property, n = vt(t, l);
|
|
4063
4072
|
await r.value?.resendMessageWithProperty(String(c), s, typeof i == "string" ? i : "", n), o();
|
|
4064
4073
|
} catch (e) {
|
|
4065
4074
|
console.error("[ChatBot] Failed to edit and resend message:", e), t("error", e);
|
|
@@ -4086,7 +4095,7 @@ function In(e) {
|
|
|
4086
4095
|
console.error("[ChatBot] Cannot edit shortcut message: shortcut not found");
|
|
4087
4096
|
return;
|
|
4088
4097
|
}
|
|
4089
|
-
let n =
|
|
4098
|
+
let n = vt(c(t, i), l), d = String(i.input ?? "");
|
|
4090
4099
|
await r.value.resendMessageWithProperty(String(u), a, d, n), o();
|
|
4091
4100
|
} catch (e) {
|
|
4092
4101
|
console.error("[ChatBot] Failed to edit shortcut message:", e), t("error", e);
|
|
@@ -4103,7 +4112,7 @@ function In(e) {
|
|
|
4103
4112
|
}
|
|
4104
4113
|
//#endregion
|
|
4105
4114
|
//#region src/components/chat-bot.vue
|
|
4106
|
-
var
|
|
4115
|
+
var Rn = /* @__PURE__ */ u({
|
|
4107
4116
|
__name: "chat-bot",
|
|
4108
4117
|
props: {
|
|
4109
4118
|
autoLoad: {
|
|
@@ -4169,14 +4178,14 @@ var Ln = /* @__PURE__ */ u({
|
|
|
4169
4178
|
await h(), m.value && (m.value.scrollTop = m.value.scrollHeight);
|
|
4170
4179
|
}, k = () => {
|
|
4171
4180
|
b.value?.focus?.();
|
|
4172
|
-
}, { chatHelper: A, isStandaloneMode: M, isInitialized: ee, isReady: P, initError: F, whenReady: I, chatBusinessManager: R, sessionBusinessManager: z, shortcutManager: B } =
|
|
4181
|
+
}, { chatHelper: A, isStandaloneMode: M, isInitialized: ee, isReady: P, initError: F, whenReady: I, chatBusinessManager: R, sessionBusinessManager: z, shortcutManager: B } = Cn({
|
|
4173
4182
|
props: c,
|
|
4174
4183
|
emit: u,
|
|
4175
4184
|
scrollToBottom: E
|
|
4176
|
-
}), { handleInterruptResume: te, resumeUserQuestionWithInput: H } =
|
|
4185
|
+
}), { handleInterruptResume: te, resumeUserQuestionWithInput: H } = Nn({
|
|
4177
4186
|
chatHelper: A,
|
|
4178
4187
|
emit: u
|
|
4179
|
-
}), { userInput: ne, cite: U, handleUpdateModelValue: W, doSendMessage: ie, handleSendMessage: ae, handleUpload: se, handleStopSending: ce, stopGeneration: le } =
|
|
4188
|
+
}), { userInput: ne, cite: U, handleUpdateModelValue: W, doSendMessage: ie, handleSendMessage: ae, handleUpload: se, handleStopSending: ce, stopGeneration: le } = Pn({
|
|
4180
4189
|
emit: u,
|
|
4181
4190
|
chatHelper: A,
|
|
4182
4191
|
chatBusinessManager: R,
|
|
@@ -4184,14 +4193,14 @@ var Ln = /* @__PURE__ */ u({
|
|
|
4184
4193
|
resumeUserQuestionWithInput: H,
|
|
4185
4194
|
selectedShortcut: C,
|
|
4186
4195
|
selectedResources: x
|
|
4187
|
-
}), { handleSelectShortcut: ue, handleCloseShortcut: G, handleShortcutSubmit: de, selectShortcutWithText: fe, getShortcutFromMessage: pe, buildShortcutProperty: me, sendShortcutDirectly: he } =
|
|
4196
|
+
}), { handleSelectShortcut: ue, handleCloseShortcut: G, handleShortcutSubmit: de, selectShortcutWithText: fe, getShortcutFromMessage: pe, buildShortcutProperty: me, sendShortcutDirectly: he } = In({
|
|
4188
4197
|
props: c,
|
|
4189
4198
|
emit: u,
|
|
4190
4199
|
chatHelper: A,
|
|
4191
4200
|
shortcutManager: B,
|
|
4192
4201
|
doSendMessage: ie,
|
|
4193
4202
|
selectedShortcut: C
|
|
4194
|
-
}), { messageStatus: ge, messageToolsStatus: _e, messages: ve, isMessagesLoading: ye, isGenerating: K, currentSession: q, isWelcomeState: J, openingRemark: be, effectiveResources: xe, effectivePrompts: Se, effectiveSkills: Ce, effectiveSupportUpload: we, chatbotStyle: Te, filteredShortcuts: Ee } =
|
|
4203
|
+
}), { messageStatus: ge, messageToolsStatus: _e, messages: ve, isMessagesLoading: ye, isGenerating: K, currentSession: q, isWelcomeState: J, openingRemark: be, effectiveResources: xe, effectivePrompts: Se, effectiveSkills: Ce, effectiveSupportUpload: we, chatbotStyle: Te, filteredShortcuts: Ee } = wn({
|
|
4195
4204
|
props: c,
|
|
4196
4205
|
chatHelper: A,
|
|
4197
4206
|
chatBusinessManager: R,
|
|
@@ -4200,7 +4209,7 @@ var Ln = /* @__PURE__ */ u({
|
|
|
4200
4209
|
isStandaloneMode: M,
|
|
4201
4210
|
isInitialized: ee,
|
|
4202
4211
|
selectedShortcut: C
|
|
4203
|
-
}), { handleAgentAction: De, handleAgentFeedback: Oe, handleUserAction: ke, handleUserInputConfirm: Y, handleUserShortcutConfirm: X, handleStopStreaming: Ae } =
|
|
4212
|
+
}), { handleAgentAction: De, handleAgentFeedback: Oe, handleUserAction: ke, handleUserInputConfirm: Y, handleUserShortcutConfirm: X, handleStopStreaming: Ae } = Ln({
|
|
4204
4213
|
emit: u,
|
|
4205
4214
|
chatHelper: A,
|
|
4206
4215
|
chatBusinessManager: R,
|
|
@@ -4212,7 +4221,7 @@ var Ln = /* @__PURE__ */ u({
|
|
|
4212
4221
|
getRequestOptions: () => c.requestOptions
|
|
4213
4222
|
}), je = n(() => !ee.value || ye.value), Me = n(() => {
|
|
4214
4223
|
if (c.useAgentName) return A.value?.agent.info.value?.agentName || void 0;
|
|
4215
|
-
}), { handleConfirmShare: Ne } =
|
|
4224
|
+
}), { handleConfirmShare: Ne } = Fn({
|
|
4216
4225
|
emit: u,
|
|
4217
4226
|
chatHelper: A,
|
|
4218
4227
|
isStandaloneMode: M
|
|
@@ -4350,13 +4359,13 @@ var Ln = /* @__PURE__ */ u({
|
|
|
4350
4359
|
_: 3
|
|
4351
4360
|
}, 8, /* @__PURE__ */ "cite.selected-shortcut.render-mode.chat-loading.common-tippy-options.execution-tab-visible.message-status.message-tools-status.messages.model-value.on-agent-action.on-agent-feedback.on-interrupt-resume.get-side-render-component.get-side-tab-render-component.on-send-message.on-stop-sending.on-upload.on-user-action.on-user-input-confirm.on-user-shortcut-confirm.opening-remark.placeholder.placement.welcome-title.prompts.resize-props.resources.shortcut-id.shortcuts.skills.support-upload.onConfirmShare.onDeleteShortcut.onSelectShortcut.onShortcutClose.onShortcutSubmit.onStopStreaming.onUpdate:modelValue".split("."))], 6));
|
|
4352
4361
|
}
|
|
4353
|
-
}),
|
|
4362
|
+
}), zn = /* @__PURE__ */ function(e) {
|
|
4354
4363
|
return e.ERROR = "error", e.IDLE = "idle", e.LOADING_AGENT = "loading_agent", e.READY = "ready", e;
|
|
4355
4364
|
}({});
|
|
4356
|
-
function
|
|
4365
|
+
function Bn(e) {
|
|
4357
4366
|
let { url: t, requestOptions: r, autoInit: i = !0, protocolCallbacks: a } = e, o = A(t);
|
|
4358
4367
|
if (!o) throw Error("[useChatBootstrap] url is required");
|
|
4359
|
-
let s = w(
|
|
4368
|
+
let s = w(zn.IDLE), c = w(null), l = w(!1), u = /* @__PURE__ */ new Map(), d = new Z({
|
|
4360
4369
|
onStart: () => {
|
|
4361
4370
|
a?.onStart?.();
|
|
4362
4371
|
},
|
|
@@ -4369,19 +4378,19 @@ function zn(e) {
|
|
|
4369
4378
|
onError: (e) => {
|
|
4370
4379
|
a?.onError?.(e);
|
|
4371
4380
|
}
|
|
4372
|
-
}), f =
|
|
4373
|
-
requestData:
|
|
4381
|
+
}), f = mt({
|
|
4382
|
+
requestData: gt(o, r),
|
|
4374
4383
|
protocol: d
|
|
4375
4384
|
});
|
|
4376
4385
|
d.injectMessageModule(f.message);
|
|
4377
|
-
let p = n(() => s.value ===
|
|
4386
|
+
let p = n(() => s.value === zn.LOADING_AGENT), m = n(() => s.value === zn.READY), h = n(() => f.agent.info.value ?? null), g = n(() => h.value?.agentName ?? ""), _ = n(() => f.session.current.value ?? null), v = n(() => f.session.list.value ?? []), y = null, b = 0, x = async (e) => {
|
|
4378
4387
|
c.value = null;
|
|
4379
4388
|
try {
|
|
4380
|
-
if (s.value =
|
|
4381
|
-
s.value =
|
|
4389
|
+
if (s.value = zn.LOADING_AGENT, await fn(f), e !== b) return;
|
|
4390
|
+
s.value = zn.READY, l.value = !0;
|
|
4382
4391
|
} catch (t) {
|
|
4383
4392
|
if (e !== b) return;
|
|
4384
|
-
throw console.error("[useChatBootstrap] Initialization failed:", t), c.value = t, s.value =
|
|
4393
|
+
throw console.error("[useChatBootstrap] Initialization failed:", t), c.value = t, s.value = zn.ERROR, t;
|
|
4385
4394
|
}
|
|
4386
4395
|
}, S = async () => {
|
|
4387
4396
|
if (l.value) return;
|
|
@@ -4391,7 +4400,7 @@ function zn(e) {
|
|
|
4391
4400
|
e === b && (y = null);
|
|
4392
4401
|
}), y;
|
|
4393
4402
|
}, C = () => {
|
|
4394
|
-
b += 1, s.value =
|
|
4403
|
+
b += 1, s.value = zn.IDLE, c.value = null, l.value = !1, y = null;
|
|
4395
4404
|
}, T = async () => {
|
|
4396
4405
|
C(), await S();
|
|
4397
4406
|
}, E = async (e) => {
|
|
@@ -4425,7 +4434,7 @@ function zn(e) {
|
|
|
4425
4434
|
}
|
|
4426
4435
|
//#endregion
|
|
4427
4436
|
//#region src/composables/use-event-bridge.ts
|
|
4428
|
-
function
|
|
4437
|
+
function Vn(e) {
|
|
4429
4438
|
return {
|
|
4430
4439
|
sendMessage: (t) => e("send-message", { content: t }),
|
|
4431
4440
|
receiveStart: () => e("receive-start", {}),
|
|
@@ -4443,12 +4452,12 @@ function Bn(e) {
|
|
|
4443
4452
|
shareMessages: (t) => e("share-messages", { messageIds: t })
|
|
4444
4453
|
};
|
|
4445
4454
|
}
|
|
4446
|
-
function
|
|
4455
|
+
function Hn(e) {
|
|
4447
4456
|
let { componentManager: t, emit: n, debug: r = !1 } = e, i = [], a = () => {
|
|
4448
|
-
for (let [e, a] of Object.entries(
|
|
4457
|
+
for (let [e, a] of Object.entries(yn)) {
|
|
4449
4458
|
if (a === null) continue;
|
|
4450
4459
|
let o = t.on(e, (t) => {
|
|
4451
|
-
let i =
|
|
4460
|
+
let i = bn(e, t);
|
|
4452
4461
|
r && console.debug(`[useEventBridge] ${e} -> ${a}`, i), n(a, ...i);
|
|
4453
4462
|
});
|
|
4454
4463
|
i.push(o);
|
|
@@ -4470,17 +4479,17 @@ function Vn(e) {
|
|
|
4470
4479
|
}
|
|
4471
4480
|
//#endregion
|
|
4472
4481
|
//#region src/composables/use-ai-blueking-init.ts
|
|
4473
|
-
function
|
|
4474
|
-
let { props: t, emit: r } = e, i = w(), a = w(), o = n(() =>
|
|
4482
|
+
function Un(e) {
|
|
4483
|
+
let { props: t, emit: r } = e, i = w(), a = w(), o = n(() => Et(t.url ?? "")), s = vn({
|
|
4475
4484
|
initialPanelVisible: !1,
|
|
4476
4485
|
initialNimbusMinimized: t.defaultMinimize,
|
|
4477
4486
|
enablePopup: t.enablePopup,
|
|
4478
4487
|
enableNimbus: !t.hideNimbus,
|
|
4479
4488
|
enableDraggable: t.draggable
|
|
4480
|
-
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } =
|
|
4489
|
+
}), c = s.panelVisible, l = s.nimbusMinimized, { forwardToManager: u } = Hn({
|
|
4481
4490
|
componentManager: s,
|
|
4482
4491
|
emit: r
|
|
4483
|
-
}), d =
|
|
4492
|
+
}), d = Vn(u), f = /* @__PURE__ */ new WeakSet(), p = null, m = null, h = () => {
|
|
4484
4493
|
p &&= (clearTimeout(p.timer), null);
|
|
4485
4494
|
}, g = (e) => {
|
|
4486
4495
|
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;
|
|
@@ -4522,7 +4531,7 @@ function Hn(e) {
|
|
|
4522
4531
|
error: e,
|
|
4523
4532
|
source: "business"
|
|
4524
4533
|
});
|
|
4525
|
-
}, { chatHelper: S, isReady: C, error: T, agentInfo: E, agentName: D, currentSession: O, initialize: k } =
|
|
4534
|
+
}, { chatHelper: S, isReady: C, error: T, agentInfo: E, agentName: D, currentSession: O, initialize: k } = Bn({
|
|
4526
4535
|
url: o,
|
|
4527
4536
|
requestOptions: () => A(t.requestOptions),
|
|
4528
4537
|
autoInit: !0,
|
|
@@ -4548,11 +4557,11 @@ function Hn(e) {
|
|
|
4548
4557
|
j.onError?.((e) => {
|
|
4549
4558
|
_(e);
|
|
4550
4559
|
}, { ignoreErrors: t.ignoreErrors });
|
|
4551
|
-
let M = new
|
|
4560
|
+
let M = new mn(j.session, j.agent, null, {
|
|
4552
4561
|
enableChatSession: t.enableChatSession,
|
|
4553
4562
|
initialSessionCode: t.initialSessionCode,
|
|
4554
4563
|
alwaysCreateNewSession: t.alwaysCreateNewSession
|
|
4555
|
-
}, j.message), ee = new
|
|
4564
|
+
}, j.message), ee = new hn(j.message, j.session), N = new gn(null, t.shortcuts || []), P = null, F = () => t.loadRecentSessionOnMount ? (P ||= M.loadRecentSession({ skipLoadSessions: !0 }).finally(() => {
|
|
4556
4565
|
P = null;
|
|
4557
4566
|
}), P) : Promise.resolve(), L = async () => {
|
|
4558
4567
|
await v("init", async () => {
|
|
@@ -4602,7 +4611,7 @@ function Hn(e) {
|
|
|
4602
4611
|
N.setShortcuts(e || []);
|
|
4603
4612
|
}, { immediate: !0 });
|
|
4604
4613
|
let W = (e) => {
|
|
4605
|
-
|
|
4614
|
+
jt(e) && (e.preventDefault(), c.value ? s.hidePanel() : s.showPanel());
|
|
4606
4615
|
};
|
|
4607
4616
|
return b(async () => {
|
|
4608
4617
|
i.value && s.setContainerRef(i.value), window.addEventListener("keydown", W);
|
|
@@ -4638,7 +4647,7 @@ function Hn(e) {
|
|
|
4638
4647
|
}
|
|
4639
4648
|
//#endregion
|
|
4640
4649
|
//#region src/composables/use-ai-selection.ts
|
|
4641
|
-
function
|
|
4650
|
+
function Wn(e) {
|
|
4642
4651
|
let { shortcutManager: t, chatBotRef: r, forwardToManager: i, show: a, props: o } = e, s = w(!1), c = w("");
|
|
4643
4652
|
return {
|
|
4644
4653
|
aiSelectionVisible: s,
|
|
@@ -4660,7 +4669,7 @@ function Un(e) {
|
|
|
4660
4669
|
}
|
|
4661
4670
|
//#endregion
|
|
4662
4671
|
//#region src/composables/use-nimbus.ts
|
|
4663
|
-
function
|
|
4672
|
+
function Gn(e, t = !1) {
|
|
4664
4673
|
let n = window.innerHeight - 48 - 40, r = window.innerWidth - 48 - 16, i = w(r), a = w(n), o = w(0), s = w(t), c = w(!1), l = w(!1), u = 0, d = (e) => {
|
|
4665
4674
|
e ? i.value = window.innerWidth - 12 : i.value = r;
|
|
4666
4675
|
}, f = (e, t) => {
|
|
@@ -4713,8 +4722,8 @@ function Wn(e, t = !1) {
|
|
|
4713
4722
|
}
|
|
4714
4723
|
//#endregion
|
|
4715
4724
|
//#region src/composables/use-panel-container.ts
|
|
4716
|
-
var
|
|
4717
|
-
function
|
|
4725
|
+
var Kn = 420;
|
|
4726
|
+
function qn(e) {
|
|
4718
4727
|
let { componentManager: t, chatBotRef: n, forwarders: r, forwardToManager: i, beforeNimbusClick: a, ensureSessionReady: o } = e, s = async (e) => {
|
|
4719
4728
|
t.showPanel(e), o && await o(), e && n.value && await n.value.switchSession(e);
|
|
4720
4729
|
}, c = async (e) => {
|
|
@@ -4755,7 +4764,7 @@ function Kn(e) {
|
|
|
4755
4764
|
t.setCompressed(e);
|
|
4756
4765
|
},
|
|
4757
4766
|
handleExecutionPanelChange: (e) => {
|
|
4758
|
-
e ? t.collapseSidePanel() : t.expandForSidePanel(
|
|
4767
|
+
e ? t.collapseSidePanel() : t.expandForSidePanel(Kn);
|
|
4759
4768
|
},
|
|
4760
4769
|
sendMessage: async (e) => {
|
|
4761
4770
|
n.value && await n.value.sendMessage(e);
|
|
@@ -4802,8 +4811,8 @@ function Kn(e) {
|
|
|
4802
4811
|
}
|
|
4803
4812
|
//#endregion
|
|
4804
4813
|
//#region src/composables/use-session-handlers.ts
|
|
4805
|
-
function
|
|
4806
|
-
let { chatHelper: t, sessionBusinessManager: n, chatBotRef: r, forwarders: i, reportSdkError: a, currentSession: o } = e, s = w(""), c = w(!0), l = w(!1), u = w(!1), d = () =>
|
|
4814
|
+
function Jn(e) {
|
|
4815
|
+
let { chatHelper: t, sessionBusinessManager: n, chatBotRef: r, forwarders: i, reportSdkError: a, currentSession: o } = e, s = w(""), c = w(!0), l = w(!1), u = w(!1), d = () => bt(t.message.list.value);
|
|
4807
4816
|
return I(() => o.value, (e) => {
|
|
4808
4817
|
e && (s.value = e.sessionName || "", l.value = (e.sessionContentCount ?? 0) > 0 || d());
|
|
4809
4818
|
}, { immediate: !0 }), I(() => t.message.list.value.length, () => {
|
|
@@ -4930,7 +4939,7 @@ function qn(e) {
|
|
|
4930
4939
|
}
|
|
4931
4940
|
//#endregion
|
|
4932
4941
|
//#region src/composables/use-share-handlers.ts
|
|
4933
|
-
function
|
|
4942
|
+
function Yn(e) {
|
|
4934
4943
|
let { shareBusinessManager: t, chatBotRef: n, forwarders: r, reportSdkError: i } = e, a = w(!1);
|
|
4935
4944
|
return {
|
|
4936
4945
|
isShareLoading: a,
|
|
@@ -4944,7 +4953,7 @@ function Jn(e) {
|
|
|
4944
4953
|
a.value = !0;
|
|
4945
4954
|
try {
|
|
4946
4955
|
let { shareUrl: i, userMessageIds: a } = await t.shareMessages(e);
|
|
4947
|
-
await
|
|
4956
|
+
await Dt(i), ue({
|
|
4948
4957
|
message: $("分享链接已复制到剪贴板"),
|
|
4949
4958
|
theme: "success"
|
|
4950
4959
|
}), n.value?.exitShareMode(), r.shareMessages(a);
|
|
@@ -4963,7 +4972,7 @@ function Jn(e) {
|
|
|
4963
4972
|
}
|
|
4964
4973
|
//#endregion
|
|
4965
4974
|
//#region src/composables/use-tippy.ts
|
|
4966
|
-
function
|
|
4975
|
+
function Xn(e = {}) {
|
|
4967
4976
|
let t = w([]), n = (n, r, i = {}) => {
|
|
4968
4977
|
try {
|
|
4969
4978
|
let a = typeof n == "string" ? document.querySelector(n) : n;
|
|
@@ -5016,7 +5025,7 @@ function Yn(e = {}) {
|
|
|
5016
5025
|
}
|
|
5017
5026
|
//#endregion
|
|
5018
5027
|
//#region src/config/prop-defaults.ts
|
|
5019
|
-
var
|
|
5028
|
+
var Zn = {
|
|
5020
5029
|
url: "",
|
|
5021
5030
|
title: "",
|
|
5022
5031
|
extCls: "",
|
|
@@ -5061,7 +5070,7 @@ var Xn = {
|
|
|
5061
5070
|
defaultChatInputPosition: void 0,
|
|
5062
5071
|
errorToast: !0,
|
|
5063
5072
|
ignoreErrors: () => []
|
|
5064
|
-
},
|
|
5073
|
+
}, Qn = class extends Z {
|
|
5065
5074
|
eventEmitter;
|
|
5066
5075
|
constructor(e = {}) {
|
|
5067
5076
|
super({
|
|
@@ -5090,7 +5099,7 @@ var Xn = {
|
|
|
5090
5099
|
super.handleToolCallStartEvent(e), this.eventEmitter?.emit("tool-call-start", { event: e });
|
|
5091
5100
|
}
|
|
5092
5101
|
};
|
|
5093
|
-
function
|
|
5102
|
+
function $n(e = {}) {
|
|
5094
5103
|
let { eventEmitter: t, onStart: n, onMessage: r, onDone: i, onError: a, onTextChunk: o } = e;
|
|
5095
5104
|
return new Z({
|
|
5096
5105
|
onStart: () => {
|
|
@@ -5109,7 +5118,7 @@ function Qn(e = {}) {
|
|
|
5109
5118
|
}
|
|
5110
5119
|
//#endregion
|
|
5111
5120
|
//#region src/containers/use-draggable.ts
|
|
5112
|
-
function
|
|
5121
|
+
function er(e = {}, t) {
|
|
5113
5122
|
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 = w(e.defaultLeft === void 0 ? window.innerWidth - n : e.defaultLeft), l = w(e.defaultTop === void 0 ? 0 : e.defaultTop), u = w(e.defaultHeight === void 0 ? window.innerHeight - (e.defaultTop === void 0 ? 0 : e.defaultTop) : e.defaultHeight), d = w(n), f = w(l.value), p = w(c.value), m = w(d.value), g = w(u.value), _ = w(Math.max(window.innerWidth * (a / 100), m.value)), v = w(!1), x = w(0), S = null, C = null, T = w(!1), E = (e) => {
|
|
5114
5123
|
let t = window.innerWidth, n = { ...e };
|
|
5115
5124
|
return n.width > t && (n.width = t), n.x + n.width > t && (n.x = t - n.width), n.x < 0 && (n.x = 0), n;
|
|
@@ -5202,7 +5211,7 @@ function $n(e = {}, t) {
|
|
|
5202
5211
|
}
|
|
5203
5212
|
//#endregion
|
|
5204
5213
|
//#region src/containers/draggable-container.vue?vue&type=script&setup=true&lang.ts
|
|
5205
|
-
var
|
|
5214
|
+
var tr = { class: "draggable-container-content" }, nr = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
5206
5215
|
__name: "draggable-container",
|
|
5207
5216
|
props: {
|
|
5208
5217
|
className: { default: "" },
|
|
@@ -5239,7 +5248,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5239
5248
|
"compression-change"
|
|
5240
5249
|
],
|
|
5241
5250
|
setup(e, { expose: t, emit: i }) {
|
|
5242
|
-
let a = e, s = i, c = w(!1), { minWidth: l, minHeight: u, maxWidth: d, top: f, left: p, width: m, height: h, isCompressed: _, isSidePanelExpanded: y, handleDragging: b, handleResizing: x, handleDragStop: C, handleResizeStop: T, toggleCompression: E, updatePosition: O, updateSize: k, updatePositionAndSize: A, expandForSidePanel: M, collapseSidePanel: ee } =
|
|
5251
|
+
let a = e, s = i, c = w(!1), { minWidth: l, minHeight: u, maxWidth: d, top: f, left: p, width: m, height: h, isCompressed: _, isSidePanelExpanded: y, handleDragging: b, handleResizing: x, handleDragStop: C, handleResizeStop: T, toggleCompression: E, updatePosition: O, updateSize: k, updatePositionAndSize: A, expandForSidePanel: M, collapseSidePanel: ee } = er({
|
|
5243
5252
|
initWidth: a.defaultWidth,
|
|
5244
5253
|
minWidth: a.minWidth,
|
|
5245
5254
|
minHeight: a.minHeight,
|
|
@@ -5311,7 +5320,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5311
5320
|
onResizeStop: ne,
|
|
5312
5321
|
onResizing: te
|
|
5313
5322
|
}, {
|
|
5314
|
-
default: L(() => [o("div",
|
|
5323
|
+
default: L(() => [o("div", tr, [D(e.$slots, "default", {}, void 0, !0)])]),
|
|
5315
5324
|
_: 3
|
|
5316
5325
|
}, 8, [
|
|
5317
5326
|
"active",
|
|
@@ -5329,11 +5338,11 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5329
5338
|
"y"
|
|
5330
5339
|
])), [[F, a.visible]]);
|
|
5331
5340
|
}
|
|
5332
|
-
}), [["__scopeId", "data-v-1118456b"]]),
|
|
5341
|
+
}), [["__scopeId", "data-v-1118456b"]]), rr = { class: "nimbus-bkai-wrapper" }, ir = [
|
|
5333
5342
|
"width",
|
|
5334
5343
|
"height",
|
|
5335
5344
|
"src"
|
|
5336
|
-
],
|
|
5345
|
+
], ar = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
5337
5346
|
name: "NimbusButton",
|
|
5338
5347
|
__name: "nimbus",
|
|
5339
5348
|
props: {
|
|
@@ -5385,11 +5394,11 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5385
5394
|
right: -6
|
|
5386
5395
|
}
|
|
5387
5396
|
}
|
|
5388
|
-
}, c = n(() => s[i.size]), l = w(null), u = w(null), { nimbusLeft: d, nimbusTop: f, isMinimize: p, handleClick: m, handleMinimize: _, handleDragging: v, handleMouseEnter: x, handleMouseLeave: C, handleMouseDown: T, handleMouseUp: E } =
|
|
5397
|
+
}, c = n(() => s[i.size]), l = w(null), u = w(null), { nimbusLeft: d, nimbusTop: f, isMinimize: p, handleClick: m, handleMinimize: _, handleDragging: v, handleMouseEnter: x, handleMouseLeave: C, handleMouseDown: T, handleMouseUp: E } = Gn(a, i.isMinimize);
|
|
5389
5398
|
I(p, (e) => {
|
|
5390
5399
|
a("update:isMinimize", e);
|
|
5391
5400
|
});
|
|
5392
|
-
let D = n(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } =
|
|
5401
|
+
let D = n(() => p.value ? $("恢复默认大小") : $("最小化,将缩成锚点")), { createTooltip: O, destroyAll: k } = Xn({
|
|
5393
5402
|
theme: "ai-blueking",
|
|
5394
5403
|
delay: [0, 0]
|
|
5395
5404
|
}), A = () => {
|
|
@@ -5397,7 +5406,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5397
5406
|
M();
|
|
5398
5407
|
});
|
|
5399
5408
|
}, M = () => {
|
|
5400
|
-
k(), l.value && !p.value && O(l.value,
|
|
5409
|
+
k(), l.value && !p.value && O(l.value, kt(), { placement: "left" }), u.value && O(u.value, D.value, { placement: "top" });
|
|
5401
5410
|
};
|
|
5402
5411
|
return I(() => p.value, () => {
|
|
5403
5412
|
h(() => {
|
|
@@ -5431,12 +5440,12 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5431
5440
|
onMouseenter: n[3] ||= (...e) => j(x) && j(x)(...e),
|
|
5432
5441
|
onMouseleave: n[4] ||= (...e) => j(C) && j(C)(...e),
|
|
5433
5442
|
onMouseup: n[5] ||= (...e) => j(E) && j(E)(...e)
|
|
5434
|
-
}, [o("div",
|
|
5443
|
+
}, [o("div", rr, [o("img", {
|
|
5435
5444
|
width: c.value.img,
|
|
5436
5445
|
height: c.value.img,
|
|
5437
5446
|
src: j(ve),
|
|
5438
5447
|
alt: "nimbus"
|
|
5439
|
-
}, null, 8,
|
|
5448
|
+
}, null, 8, ir)]), o("i", {
|
|
5440
5449
|
ref_key: "minimizeButtonRef",
|
|
5441
5450
|
ref: u,
|
|
5442
5451
|
class: g(["nimbus-mini bkai-icon", j(p) ? "bkai-yinyong" : "bkai-minus-line"]),
|
|
@@ -5452,7 +5461,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5452
5461
|
"onDragging"
|
|
5453
5462
|
]));
|
|
5454
5463
|
}
|
|
5455
|
-
}), [["__scopeId", "data-v-26b6f3ea"]]),
|
|
5464
|
+
}), [["__scopeId", "data-v-26b6f3ea"]]), or = /* @__PURE__ */ Bt(/* @__PURE__ */ u({
|
|
5456
5465
|
inheritAttrs: !1,
|
|
5457
5466
|
__name: "ai-blueking",
|
|
5458
5467
|
props: /* @__PURE__ */ m({
|
|
@@ -5503,7 +5512,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5503
5512
|
beforeNimbusClick: { type: Function },
|
|
5504
5513
|
shortcutFilter: { type: Function },
|
|
5505
5514
|
resizeProps: {}
|
|
5506
|
-
},
|
|
5515
|
+
}, Zn),
|
|
5507
5516
|
emits: [
|
|
5508
5517
|
"show",
|
|
5509
5518
|
"close",
|
|
@@ -5530,29 +5539,29 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5530
5539
|
"share"
|
|
5531
5540
|
],
|
|
5532
5541
|
setup(e, { expose: n, emit: a }) {
|
|
5533
|
-
let c = e, u = a, f = M(), { chatHelper: m, componentManager: h, sessionBusinessManager: y, shareBusinessManager: b, shortcutManager: x, forwarders: C, forwardToManager: w, chatBotRef: T, draggableContainerRef: E, panelVisible: O, nimbusMinimized: k, normalizedUrl: A, agentName: ee, currentSession: N, isCompressed: P, isWelcomeState: F, messageToolsTippyOptions: I, agentResources: R, agentPrompts: z, agentSkills: V, handleError: te, reportSdkError: H, ensureSessionReady: ne, updateAgentInfo: re } =
|
|
5542
|
+
let c = e, u = a, f = M(), { chatHelper: m, componentManager: h, sessionBusinessManager: y, shareBusinessManager: b, shortcutManager: x, forwarders: C, forwardToManager: w, chatBotRef: T, draggableContainerRef: E, panelVisible: O, nimbusMinimized: k, normalizedUrl: A, agentName: ee, currentSession: N, isCompressed: P, isWelcomeState: F, messageToolsTippyOptions: I, agentResources: R, agentPrompts: z, agentSkills: V, handleError: te, reportSdkError: H, ensureSessionReady: ne, updateAgentInfo: re } = Un({
|
|
5534
5543
|
props: c,
|
|
5535
5544
|
emit: u
|
|
5536
|
-
}), { show: U, hide: W, handleShow: ie, handleClose: ae, handleNimbusClick: oe, handleDragging: se, handleResizing: ce, handleDragStop: le, handleResizeStop: ue, handleToggleCompression: G, handleCompressionChange: de, handleExecutionPanelChange: fe, sendMessage: pe, handleReceiveStart: me, handleReceiveText: he, handleReceiveEnd: ge, handleStop: _e, stopGeneration: ve, setCiteText: ye, focusInput: K, selectShortcut: q, sendShortcut: J, getChatHelper: be, updatePosition: xe, updateSize: Se, updatePositionAndSize: Ce, handleShortcutClick: we } =
|
|
5545
|
+
}), { show: U, hide: W, handleShow: ie, handleClose: ae, handleNimbusClick: oe, handleDragging: se, handleResizing: ce, handleDragStop: le, handleResizeStop: ue, handleToggleCompression: G, handleCompressionChange: de, handleExecutionPanelChange: fe, sendMessage: pe, handleReceiveStart: me, handleReceiveText: he, handleReceiveEnd: ge, handleStop: _e, stopGeneration: ve, setCiteText: ye, focusInput: K, selectShortcut: q, sendShortcut: J, getChatHelper: be, updatePosition: xe, updateSize: Se, updatePositionAndSize: Ce, handleShortcutClick: we } = qn({
|
|
5537
5546
|
componentManager: h,
|
|
5538
5547
|
chatBotRef: T,
|
|
5539
5548
|
forwarders: C,
|
|
5540
5549
|
forwardToManager: w,
|
|
5541
5550
|
beforeNimbusClick: c.beforeNimbusClick,
|
|
5542
5551
|
ensureSessionReady: ne
|
|
5543
|
-
}), { sessionName: Te, hasPermission: Ee, hasSessionContents: De, autoGenerateLoading: Oe, handleNewChat: ke, handleNewChatCreated: Y, handleHistoryClick: X, handleHistorySessionSwitch: Ae, handleHistorySessionDelete: je, handleHistorySessionRename: Me, handleAutoGenerateName: Ne, handleHelpClick: Z, handleRename: Pe, handleSessionSwitched: Fe, addNewSession: Ie, switchToSession: Le, updateSessionName: Re } =
|
|
5552
|
+
}), { sessionName: Te, hasPermission: Ee, hasSessionContents: De, autoGenerateLoading: Oe, handleNewChat: ke, handleNewChatCreated: Y, handleHistoryClick: X, handleHistorySessionSwitch: Ae, handleHistorySessionDelete: je, handleHistorySessionRename: Me, handleAutoGenerateName: Ne, handleHelpClick: Z, handleRename: Pe, handleSessionSwitched: Fe, addNewSession: Ie, switchToSession: Le, updateSessionName: Re } = Jn({
|
|
5544
5553
|
chatHelper: m,
|
|
5545
5554
|
sessionBusinessManager: y,
|
|
5546
5555
|
chatBotRef: T,
|
|
5547
5556
|
forwarders: C,
|
|
5548
5557
|
reportSdkError: H,
|
|
5549
5558
|
currentSession: N
|
|
5550
|
-
}), { isShareLoading: ze, handleShare: Be, handleCancelShare: Ve, handleConfirmShare: Q } =
|
|
5559
|
+
}), { isShareLoading: ze, handleShare: Be, handleCancelShare: Ve, handleConfirmShare: Q } = Yn({
|
|
5551
5560
|
shareBusinessManager: b,
|
|
5552
5561
|
chatBotRef: T,
|
|
5553
5562
|
forwarders: C,
|
|
5554
5563
|
reportSdkError: H
|
|
5555
|
-
}), { aiSelectionVisible: He, filteredPopupShortcuts: Ue, handleSelectionChange: We, handleAiSelectionShortcut: Ge } =
|
|
5564
|
+
}), { aiSelectionVisible: He, filteredPopupShortcuts: Ue, handleSelectionChange: We, handleAiSelectionShortcut: Ge } = Wn({
|
|
5556
5565
|
shortcutManager: x,
|
|
5557
5566
|
chatBotRef: T,
|
|
5558
5567
|
forwardToManager: w,
|
|
@@ -5586,7 +5595,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5586
5595
|
j(f).class
|
|
5587
5596
|
]) }, [
|
|
5588
5597
|
i(" 可拖拽容器 "),
|
|
5589
|
-
l(j(
|
|
5598
|
+
l(j(nr), {
|
|
5590
5599
|
ref_key: "draggableContainerRef",
|
|
5591
5600
|
ref: E,
|
|
5592
5601
|
"compressed-padding": c.miniPadding,
|
|
@@ -5607,7 +5616,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5607
5616
|
}, {
|
|
5608
5617
|
default: L(() => [o("div", { class: g(["ai-blueking-panel", { "has-messages": !j(F) }]) }, [
|
|
5609
5618
|
i(" 独立的 Header 组件 "),
|
|
5610
|
-
c.hideHeader ? i("v-if", !0) : (S(), r(
|
|
5619
|
+
c.hideHeader ? i("v-if", !0) : (S(), r(un, {
|
|
5611
5620
|
key: 0,
|
|
5612
5621
|
"agent-name": j(ee),
|
|
5613
5622
|
"chat-helper": j(m),
|
|
@@ -5644,7 +5653,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5644
5653
|
key: "0"
|
|
5645
5654
|
} : void 0]), 1032, /* @__PURE__ */ "agent-name.chat-helper.draggable.dropdown-menu-config.enable-chat-session.has-permission.has-session-contents.auto-generate-loading.is-compression-height.render-mode.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.onToggleCompression".split("."))),
|
|
5646
5655
|
i(" ChatBot 核心组件(仅聊天区域) "),
|
|
5647
|
-
l(
|
|
5656
|
+
l(Rn, {
|
|
5648
5657
|
ref_key: "chatBotRef",
|
|
5649
5658
|
ref: T,
|
|
5650
5659
|
"always-create-new-session": c.alwaysCreateNewSession,
|
|
@@ -5712,7 +5721,7 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5712
5721
|
"onResizing"
|
|
5713
5722
|
]),
|
|
5714
5723
|
i(" Nimbus 悬浮球 "),
|
|
5715
|
-
c.hideNimbus ? i("v-if", !0) : (S(), r(
|
|
5724
|
+
c.hideNimbus ? i("v-if", !0) : (S(), r(ar, {
|
|
5716
5725
|
key: 0,
|
|
5717
5726
|
"is-minimize": j(k),
|
|
5718
5727
|
"onUpdate:isMinimize": n[4] ||= (e) => p(k) ? k.value = e : null,
|
|
@@ -5749,4 +5758,4 @@ var er = { class: "draggable-container-content" }, tr = /* @__PURE__ */ zt(/* @_
|
|
|
5749
5758
|
}
|
|
5750
5759
|
}), [["__scopeId", "data-v-b2022398"]]);
|
|
5751
5760
|
//#endregion
|
|
5752
|
-
export { Z as AGUIProtocol,
|
|
5761
|
+
export { Z as AGUIProtocol, or as AIBlueking, or as default, Qn as BluekingProtocol, zn as BootstrapPhase, Rn as ChatBot, pn as ChatBusinessManager, _n as ComponentManager, nr as DraggableContainer, ne as MessageContentType, ae as RenderMode, mn as SessionBusinessManager, gn as ShortcutManager, xn as UIStateManager, $n as createBluekingProtocol, vn as createComponentManager, Zn as defaultProps, Ct as parseCustomBlocks, Bn as useChatBootstrap, mt as useChatHelper, er as useDraggable };
|