@8wave/ai-elements 0.110.0-beta.1 → 0.110.0
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/ai-elements.es.js +678 -674
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-CDciy1W-.js → PkChatbot-o7k7d-fj.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-CDciy1W-.js.map → PkChatbot-o7k7d-fj.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-5dW-ElPy.js → PkChatbotMessages-BFlU046I.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotMessages-5dW-ElPy.js.map → PkChatbotMessages-BFlU046I.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotStepPayload-BH6piqOi.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotStepToolDetail-BJ7xUvgi.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-DtV1beDc.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C9PQWz8z.js → PkChatbotViewChat-CNH_glPI.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewChat-C9PQWz8z.js.map → PkChatbotViewChat-CNH_glPI.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-Duc-I3pp.js → PkChatbotViewConversations-BENvHLZt.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-Duc-I3pp.js.map → PkChatbotViewConversations-BENvHLZt.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-B7KaE7rU.js → PkChatbotViewFiles-qmLESi1V.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-B7KaE7rU.js.map → PkChatbotViewFiles-qmLESi1V.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-tKK5Yazl.js → PkChatbotViewProfile-DzfZnitQ.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-tKK5Yazl.js.map → PkChatbotViewProfile-DzfZnitQ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CNBaJZlp.js → PkToolShowDiagram-DuDp5EHd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CNBaJZlp.js.map → PkToolShowDiagram-DuDp5EHd.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-DufJlucU.js → useChatbotStore-CiRAuq7v.js} +82 -78
- package/dist-vue/_chunks/useChatbotStore-CiRAuq7v.js.map +1 -0
- package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +14 -14
- package/dist-vue/composables.js +1 -1
- package/dist-vue/index.js +7 -7
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/packages/components/src/PkEditorMedia.d.ts +42 -42
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +14 -14
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +42 -42
- package/dist-vue/packages/models/src/schema/Agent.d.ts +112 -112
- package/dist-vue/packages/models/src/schema/Document.d.ts +126 -126
- package/dist-vue/packages/models/src/schema/Member.d.ts +14 -14
- package/dist-vue/packages/models/src/schema/Organization.d.ts +28 -28
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +28 -28
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +28 -28
- package/dist-vue/packages/models/src/schema/User.d.ts +42 -42
- package/dist-vue/style.css +1 -1
- package/package.json +2 -2
- package/dist-vue/_chunks/useChatbotStore-DufJlucU.js.map +0 -1
|
@@ -2912,7 +2912,11 @@ async function Mr(e) {
|
|
|
2912
2912
|
};
|
|
2913
2913
|
}));
|
|
2914
2914
|
}
|
|
2915
|
-
|
|
2915
|
+
function Nr(e, t) {
|
|
2916
|
+
let n = e.search(/[?#]/);
|
|
2917
|
+
return n === -1 ? `${e}${t}` : `${e.slice(0, n)}${t}${e.slice(n)}`;
|
|
2918
|
+
}
|
|
2919
|
+
var Pr = class {
|
|
2916
2920
|
constructor({ api: e = "/api/chat", credentials: t, headers: n, body: r, fetch: i, prepareSendMessagesRequest: a, prepareReconnectToStreamRequest: o }) {
|
|
2917
2921
|
this.api = e, this.credentials = t, this.headers = n, this.body = r, this.fetch = i, this.prepareSendMessagesRequest = a, this.prepareReconnectToStreamRequest = o;
|
|
2918
2922
|
}
|
|
@@ -2943,7 +2947,7 @@ var Nr = class {
|
|
|
2943
2947
|
} : o.body, u = o?.credentials ?? i, d = await (this.fetch ?? globalThis.fetch)(s, {
|
|
2944
2948
|
method: "POST",
|
|
2945
2949
|
headers: {
|
|
2946
|
-
"
|
|
2950
|
+
"content-type": "application/json",
|
|
2947
2951
|
...c
|
|
2948
2952
|
},
|
|
2949
2953
|
body: JSON.stringify(l),
|
|
@@ -2972,7 +2976,7 @@ var Nr = class {
|
|
|
2972
2976
|
headers: i,
|
|
2973
2977
|
credentials: r,
|
|
2974
2978
|
requestMetadata: e.metadata
|
|
2975
|
-
}), o = a?.api ??
|
|
2979
|
+
}), o = a?.api ?? Nr(this.api, `/${e.chatId}/stream`), s = a?.headers === void 0 ? i : F(a.headers), c = a?.credentials ?? r, l = await (this.fetch ?? globalThis.fetch)(o, {
|
|
2976
2980
|
method: "GET",
|
|
2977
2981
|
headers: s,
|
|
2978
2982
|
credentials: c,
|
|
@@ -2987,7 +2991,7 @@ var Nr = class {
|
|
|
2987
2991
|
if (!l.body) throw new ke({ message: "The response body is empty." });
|
|
2988
2992
|
return this.processResponseStream(l.body);
|
|
2989
2993
|
}
|
|
2990
|
-
},
|
|
2994
|
+
}, Fr = class extends Pr {
|
|
2991
2995
|
constructor(e = {}) {
|
|
2992
2996
|
super(e);
|
|
2993
2997
|
}
|
|
@@ -3000,8 +3004,8 @@ var Nr = class {
|
|
|
3000
3004
|
t.enqueue(e.value);
|
|
3001
3005
|
} }));
|
|
3002
3006
|
}
|
|
3003
|
-
},
|
|
3004
|
-
constructor({ generateId: e = L, id: t = e(), transport: n = new
|
|
3007
|
+
}, Ir = class {
|
|
3008
|
+
constructor({ generateId: e = L, id: t = e(), transport: n = new Fr(), messageMetadataSchema: r, dataPartSchemas: i, state: a, onError: o, onToolCall: s, onFinish: c, onData: l, sendAutomaticallyWhen: u }) {
|
|
3005
3009
|
this.pendingMessagePreparations = /* @__PURE__ */ new Set(), this.activeResponse = void 0, this.activeResumeRequest = void 0, this.jobExecutor = new Ar(), this.sendMessage = async (e, t) => {
|
|
3006
3010
|
if (e == null) {
|
|
3007
3011
|
await this.makeRequest({
|
|
@@ -3257,39 +3261,39 @@ var Nr = class {
|
|
|
3257
3261
|
});
|
|
3258
3262
|
}
|
|
3259
3263
|
};
|
|
3260
|
-
function
|
|
3264
|
+
function Lr({ messages: e }) {
|
|
3261
3265
|
let t = e[e.length - 1];
|
|
3262
3266
|
if (!t || t.role !== "assistant") return !1;
|
|
3263
3267
|
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter(Q);
|
|
3264
|
-
return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
|
|
3268
|
+
return r.filter((e) => e.state === "approval-responded").length > 0 && r.every((e) => e.state === "output-available" && e.preliminary !== !0 || e.state === "output-error" || e.state === "output-denied" || e.state === "approval-responded");
|
|
3265
3269
|
}
|
|
3266
3270
|
//#endregion
|
|
3267
3271
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.43_typescript@6.0.3_/node_modules/swrv/esm/lib/hash.js
|
|
3268
|
-
var
|
|
3269
|
-
function
|
|
3272
|
+
var Rr = /* @__PURE__ */ new WeakMap(), zr = 0;
|
|
3273
|
+
function Br(e) {
|
|
3270
3274
|
if (!e.length) return "";
|
|
3271
3275
|
for (var t = "arg", n = 0; n < e.length; ++n) {
|
|
3272
3276
|
var r = void 0;
|
|
3273
|
-
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) :
|
|
3277
|
+
e[n] === null || typeof e[n] != "object" && typeof e[n] != "function" ? r = typeof e[n] == "string" ? "\"" + e[n] + "\"" : String(e[n]) : Rr.has(e[n]) ? r = Rr.get(e[n]) : (r = zr, Rr.set(e[n], zr++)), t += "@" + r;
|
|
3274
3278
|
}
|
|
3275
3279
|
return t;
|
|
3276
3280
|
}
|
|
3277
3281
|
//#endregion
|
|
3278
3282
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.43_typescript@6.0.3_/node_modules/swrv/esm/cache/index.js
|
|
3279
|
-
function
|
|
3283
|
+
function Vr(e) {
|
|
3280
3284
|
if (typeof e == "function") try {
|
|
3281
3285
|
e = e();
|
|
3282
3286
|
} catch {
|
|
3283
3287
|
e = "";
|
|
3284
3288
|
}
|
|
3285
|
-
return e = Array.isArray(e) ?
|
|
3289
|
+
return e = Array.isArray(e) ? Br(e) : String(e || ""), e;
|
|
3286
3290
|
}
|
|
3287
|
-
var
|
|
3291
|
+
var Hr = function() {
|
|
3288
3292
|
function e(e) {
|
|
3289
3293
|
e === void 0 && (e = 0), this.items = /* @__PURE__ */ new Map(), this.ttl = e;
|
|
3290
3294
|
}
|
|
3291
3295
|
return e.prototype.serializeKey = function(e) {
|
|
3292
|
-
return
|
|
3296
|
+
return Vr(e);
|
|
3293
3297
|
}, e.prototype.get = function(e) {
|
|
3294
3298
|
var t = this.serializeKey(e);
|
|
3295
3299
|
return this.items.get(t);
|
|
@@ -3311,15 +3315,15 @@ var Vr = function() {
|
|
|
3311
3315
|
}();
|
|
3312
3316
|
//#endregion
|
|
3313
3317
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.43_typescript@6.0.3_/node_modules/swrv/esm/lib/web-preset.js
|
|
3314
|
-
function
|
|
3318
|
+
function Ur() {
|
|
3315
3319
|
return navigator.onLine === void 0 || navigator.onLine;
|
|
3316
3320
|
}
|
|
3317
|
-
function
|
|
3321
|
+
function Wr() {
|
|
3318
3322
|
return typeof document < "u" && document.visibilityState !== void 0 ? document.visibilityState !== "hidden" : !0;
|
|
3319
3323
|
}
|
|
3320
|
-
var
|
|
3321
|
-
isOnline:
|
|
3322
|
-
isDocumentVisible:
|
|
3324
|
+
var Gr = {
|
|
3325
|
+
isOnline: Ur,
|
|
3326
|
+
isDocumentVisible: Wr,
|
|
3323
3327
|
fetcher: function(e) {
|
|
3324
3328
|
return fetch(e).then(function(e) {
|
|
3325
3329
|
return e.json();
|
|
@@ -3330,7 +3334,7 @@ var Wr = {
|
|
|
3330
3334
|
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
3331
3335
|
return e;
|
|
3332
3336
|
}, $.apply(this, arguments);
|
|
3333
|
-
},
|
|
3337
|
+
}, Kr = function(e, t, n, r) {
|
|
3334
3338
|
function i(e) {
|
|
3335
3339
|
return e instanceof n ? e : new n(function(t) {
|
|
3336
3340
|
t(e);
|
|
@@ -3356,7 +3360,7 @@ var Wr = {
|
|
|
3356
3360
|
}
|
|
3357
3361
|
c((r = r.apply(e, t || [])).next());
|
|
3358
3362
|
});
|
|
3359
|
-
},
|
|
3363
|
+
}, qr = function(e, t) {
|
|
3360
3364
|
var n = {
|
|
3361
3365
|
label: 0,
|
|
3362
3366
|
sent: function() {
|
|
@@ -3429,7 +3433,7 @@ var Wr = {
|
|
|
3429
3433
|
done: !0
|
|
3430
3434
|
};
|
|
3431
3435
|
}
|
|
3432
|
-
},
|
|
3436
|
+
}, Jr = function(e, t) {
|
|
3433
3437
|
var n = typeof Symbol == "function" && e[Symbol.iterator];
|
|
3434
3438
|
if (!n) return e;
|
|
3435
3439
|
var r = n.call(e), i, a = [], o;
|
|
@@ -3445,11 +3449,11 @@ var Wr = {
|
|
|
3445
3449
|
}
|
|
3446
3450
|
}
|
|
3447
3451
|
return a;
|
|
3448
|
-
},
|
|
3452
|
+
}, Yr = function(e, t, n) {
|
|
3449
3453
|
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
3450
3454
|
return e.concat(a || Array.prototype.slice.call(t));
|
|
3451
|
-
},
|
|
3452
|
-
cache:
|
|
3455
|
+
}, Xr = new Hr(), Zr = new Hr(), Qr = new Hr(), $r = {
|
|
3456
|
+
cache: Xr,
|
|
3453
3457
|
refreshInterval: 0,
|
|
3454
3458
|
ttl: 0,
|
|
3455
3459
|
serverTTL: 1e3,
|
|
@@ -3459,15 +3463,15 @@ var Wr = {
|
|
|
3459
3463
|
shouldRetryOnError: !0,
|
|
3460
3464
|
errorRetryInterval: 5e3,
|
|
3461
3465
|
errorRetryCount: 5,
|
|
3462
|
-
fetcher:
|
|
3463
|
-
isOnline:
|
|
3464
|
-
isDocumentVisible:
|
|
3466
|
+
fetcher: Gr.fetcher,
|
|
3467
|
+
isOnline: Gr.isOnline,
|
|
3468
|
+
isDocumentVisible: Gr.isDocumentVisible
|
|
3465
3469
|
};
|
|
3466
|
-
function $r(e, t, n) {
|
|
3467
|
-
var r = Xr.get(e);
|
|
3468
|
-
r ? r.data.push(t) : Xr.set(e, [t], n > 0 ? n + 5e3 : n);
|
|
3469
|
-
}
|
|
3470
3470
|
function ei(e, t, n) {
|
|
3471
|
+
var r = Zr.get(e);
|
|
3472
|
+
r ? r.data.push(t) : Zr.set(e, [t], n > 0 ? n + 5e3 : n);
|
|
3473
|
+
}
|
|
3474
|
+
function ti(e, t, n) {
|
|
3471
3475
|
if (n.isDocumentVisible() && !(n.errorRetryCount !== void 0 && t > n.errorRetryCount)) {
|
|
3472
3476
|
var r = Math.min(t || 0, n.errorRetryCount), i = r * n.errorRetryInterval;
|
|
3473
3477
|
setTimeout(function() {
|
|
@@ -3478,17 +3482,17 @@ function ei(e, t, n) {
|
|
|
3478
3482
|
}, i);
|
|
3479
3483
|
}
|
|
3480
3484
|
}
|
|
3481
|
-
function
|
|
3485
|
+
function ni(e) {
|
|
3482
3486
|
var t = e.shouldRetry, n = t === void 0 ? void 0 : t, r = e.error;
|
|
3483
|
-
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n :
|
|
3487
|
+
return typeof n == "function" ? n(r) : typeof n == "boolean" ? n : $r.shouldRetryOnError;
|
|
3484
3488
|
}
|
|
3485
|
-
var
|
|
3486
|
-
return n === void 0 && (n =
|
|
3489
|
+
var ri = function(e, t, n, r) {
|
|
3490
|
+
return n === void 0 && (n = Xr), r === void 0 && (r = $r.ttl), Kr(void 0, void 0, void 0, function() {
|
|
3487
3491
|
var i, a, o, s, c, l, u;
|
|
3488
|
-
return
|
|
3492
|
+
return qr(this, function(d) {
|
|
3489
3493
|
switch (d.label) {
|
|
3490
3494
|
case 0:
|
|
3491
|
-
if (!
|
|
3495
|
+
if (!ai(t)) return [3, 5];
|
|
3492
3496
|
d.label = 1;
|
|
3493
3497
|
case 1: return d.trys.push([
|
|
3494
3498
|
1,
|
|
@@ -3510,7 +3514,7 @@ var ni = function(e, t, n, r) {
|
|
|
3510
3514
|
} catch (e) {
|
|
3511
3515
|
console.error("swrv(mutate): failed to set cache", e);
|
|
3512
3516
|
}
|
|
3513
|
-
return l =
|
|
3517
|
+
return l = Zr.get(e), l && l.data.length && (u = l.data.filter(function(t) {
|
|
3514
3518
|
return t.key === e;
|
|
3515
3519
|
}), u.forEach(function(e, t) {
|
|
3516
3520
|
c.data !== void 0 && (e.data = c.data), e.error = c.error, e.isValidating = c.isValidating, e.isLoading = c.isValidating, t !== u.length - 1 && delete u[t];
|
|
@@ -3519,9 +3523,9 @@ var ni = function(e, t, n, r) {
|
|
|
3519
3523
|
});
|
|
3520
3524
|
});
|
|
3521
3525
|
};
|
|
3522
|
-
function
|
|
3526
|
+
function ii() {
|
|
3523
3527
|
for (var e = this, t = [], n = 0; n < arguments.length; n++) t[n] = arguments[n];
|
|
3524
|
-
var r, i, a = $({},
|
|
3528
|
+
var r, i, a = $({}, $r), o = !1, s = !1;
|
|
3525
3529
|
if (!se()) return console.error("useSWRV must be called inside setup() or an active effectScope()."), null;
|
|
3526
3530
|
var c = typeof window > "u" || typeof document > "u";
|
|
3527
3531
|
t.length >= 1 && (r = t[0]), t.length >= 2 && (i = t[1]), t.length > 2 && (a = $($({}, a), t[2]));
|
|
@@ -3536,32 +3540,32 @@ function ri() {
|
|
|
3536
3540
|
key: null
|
|
3537
3541
|
});
|
|
3538
3542
|
var f = function(t, n) {
|
|
3539
|
-
return
|
|
3543
|
+
return Kr(e, void 0, void 0, function() {
|
|
3540
3544
|
var e, r, s, c, p, m, h, g = this;
|
|
3541
|
-
return
|
|
3545
|
+
return qr(this, function(_) {
|
|
3542
3546
|
switch (_.label) {
|
|
3543
3547
|
case 0: return e = d.data === void 0, r = u.value, r ? (s = a.cache.get(r), c = s && s.data, d.isValidating = !0, d.isLoading = !c, c && (d.data = c.data, d.error = c.error), p = t || i, !p || !a.isDocumentVisible() && !e || n?.forceRevalidate !== void 0 && !n?.forceRevalidate || s && (m = !!(Date.now() - s.createdAt >= a.dedupingInterval || n?.forceRevalidate), !m) ? (d.isValidating = !1, d.isLoading = !1, [2]) : (h = function() {
|
|
3544
|
-
return
|
|
3548
|
+
return Kr(g, void 0, void 0, function() {
|
|
3545
3549
|
var e, t, i, s, c, u;
|
|
3546
|
-
return
|
|
3550
|
+
return qr(this, function(m) {
|
|
3547
3551
|
switch (m.label) {
|
|
3548
|
-
case 0: return e =
|
|
3552
|
+
case 0: return e = Qr.get(r), e ? [3, 2] : (t = Array.isArray(r) ? r : [r], i = p.apply(void 0, Yr([], Jr(t), !1)), Qr.set(r, i, a.dedupingInterval), [4, ri(r, i, a.cache, l)]);
|
|
3549
3553
|
case 1: return m.sent(), [3, 4];
|
|
3550
|
-
case 2: return [4,
|
|
3554
|
+
case 2: return [4, ri(r, e.data, a.cache, l)];
|
|
3551
3555
|
case 3: m.sent(), m.label = 4;
|
|
3552
|
-
case 4: return d.isValidating = !1, d.isLoading = !1,
|
|
3556
|
+
case 4: return d.isValidating = !1, d.isLoading = !1, Qr.delete(r), d.error !== void 0 && (s = ni({
|
|
3553
3557
|
shouldRetry: a.shouldRetryOnError,
|
|
3554
3558
|
error: d.error
|
|
3555
|
-
}), c =
|
|
3559
|
+
}), c = ni({
|
|
3556
3560
|
shouldRetry: !n || n.shouldRetryOnError,
|
|
3557
3561
|
error: d.error
|
|
3558
|
-
}), u = !o && s && c, u &&
|
|
3562
|
+
}), u = !o && s && c, u && ti(f, n ? n.errorRetryCount : 1, a)), [2];
|
|
3559
3563
|
}
|
|
3560
3564
|
});
|
|
3561
3565
|
});
|
|
3562
3566
|
}, c && a.revalidateDebounce ? (setTimeout(function() {
|
|
3563
|
-
return
|
|
3564
|
-
return
|
|
3567
|
+
return Kr(g, void 0, void 0, function() {
|
|
3568
|
+
return qr(this, function(e) {
|
|
3565
3569
|
switch (e.label) {
|
|
3566
3570
|
case 0: return o ? [3, 2] : [4, h()];
|
|
3567
3571
|
case 1: e.sent(), e.label = 2;
|
|
@@ -3577,16 +3581,16 @@ function ri() {
|
|
|
3577
3581
|
});
|
|
3578
3582
|
});
|
|
3579
3583
|
}, p = function() {
|
|
3580
|
-
return
|
|
3581
|
-
return
|
|
3584
|
+
return Kr(e, void 0, void 0, function() {
|
|
3585
|
+
return qr(this, function(e) {
|
|
3582
3586
|
return [2, f(null, { shouldRetryOnError: !1 })];
|
|
3583
3587
|
});
|
|
3584
3588
|
});
|
|
3585
3589
|
}, m = null;
|
|
3586
3590
|
if (!c) {
|
|
3587
3591
|
var h = function() {
|
|
3588
|
-
return
|
|
3589
|
-
return
|
|
3592
|
+
return Kr(e, void 0, void 0, function() {
|
|
3593
|
+
return qr(this, function(e) {
|
|
3590
3594
|
switch (e.label) {
|
|
3591
3595
|
case 0: return d.error || !a.isOnline() ? [3, 2] : [4, f()];
|
|
3592
3596
|
case 1: return e.sent(), [3, 3];
|
|
@@ -3600,28 +3604,28 @@ function ri() {
|
|
|
3600
3604
|
}
|
|
3601
3605
|
le(function() {
|
|
3602
3606
|
o = !0, m &&= (clearTimeout(m), null), !c && a.revalidateOnFocus && (document.removeEventListener("visibilitychange", p, !1), window.removeEventListener("focus", p, !1));
|
|
3603
|
-
var e =
|
|
3607
|
+
var e = Zr.get(u.value);
|
|
3604
3608
|
e && (e.data = e.data.filter(function(e) {
|
|
3605
3609
|
return e !== d;
|
|
3606
3610
|
}));
|
|
3607
3611
|
});
|
|
3608
3612
|
try {
|
|
3609
3613
|
fe(u, function(e) {
|
|
3610
|
-
ce(u) || (u.value = e), d.key = e, d.isValidating = !!e,
|
|
3614
|
+
ce(u) || (u.value = e), d.key = e, d.isValidating = !!e, ei(u.value, d, l), !c && !s && u.value && f(), s = !1;
|
|
3611
3615
|
}, { immediate: !0 });
|
|
3612
3616
|
} catch {}
|
|
3613
3617
|
return $($({}, de(d)), { mutate: function(e, t) {
|
|
3614
3618
|
return f(e, $($({}, t), { forceRevalidate: !0 }));
|
|
3615
3619
|
} });
|
|
3616
3620
|
}
|
|
3617
|
-
function
|
|
3621
|
+
function ai(e) {
|
|
3618
3622
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
3619
3623
|
}
|
|
3620
3624
|
//#endregion
|
|
3621
3625
|
//#region ../../node_modules/.pnpm/swrv@1.2.0_vue@3.5.43_typescript@6.0.3_/node_modules/swrv/esm/index.js
|
|
3622
|
-
var
|
|
3623
|
-
|
|
3624
|
-
var
|
|
3626
|
+
var oi = ii;
|
|
3627
|
+
oi.default, oi.default;
|
|
3628
|
+
var si = class {
|
|
3625
3629
|
constructor(e) {
|
|
3626
3630
|
this.statusRef = y("ready"), this.errorRef = y(void 0), this.pushMessage = (e) => {
|
|
3627
3631
|
this.messagesRef.value = [...this.messagesRef.value, e];
|
|
@@ -3649,33 +3653,33 @@ var oi = class {
|
|
|
3649
3653
|
set error(e) {
|
|
3650
3654
|
this.errorRef.value = e;
|
|
3651
3655
|
}
|
|
3652
|
-
},
|
|
3656
|
+
}, ci = class extends Ir {
|
|
3653
3657
|
constructor({ messages: e, ...t }) {
|
|
3654
3658
|
super({
|
|
3655
3659
|
...t,
|
|
3656
|
-
state: new
|
|
3660
|
+
state: new si(e)
|
|
3657
3661
|
});
|
|
3658
3662
|
}
|
|
3659
|
-
},
|
|
3663
|
+
}, li = "voice-", ui = (e) => e.replace(/\s+/g, " ").trim().toLowerCase(), di = (e) => ui(e.parts.filter((e) => e.type === "text").map((e) => "text" in e ? e.text : "").join(" ")), fi = 8, pi = (e, t) => {
|
|
3660
3664
|
let n = e.filter((e) => e.role === "user").map((e) => ({
|
|
3661
|
-
text:
|
|
3665
|
+
text: di(e),
|
|
3662
3666
|
taken: !1
|
|
3663
3667
|
}));
|
|
3664
3668
|
return t.filter((e) => {
|
|
3665
3669
|
if (!e.id.startsWith("voice-") || e.role !== "user") return !1;
|
|
3666
|
-
let t =
|
|
3670
|
+
let t = di(e), r = n.find((e) => !e.taken && e.text.length > 0 && (e.text === t || e.text.length >= fi && t.endsWith(e.text)));
|
|
3667
3671
|
return !r || (r.taken = !0, !1);
|
|
3668
3672
|
});
|
|
3669
|
-
},
|
|
3673
|
+
}, mi = (e) => {
|
|
3670
3674
|
let t = e.type ?? "";
|
|
3671
3675
|
return t === "dynamic-tool" ? e.toolName ?? "" : t.startsWith("tool-") ? t.slice(5) : "";
|
|
3672
|
-
},
|
|
3676
|
+
}, hi = ({ messages: e }) => {
|
|
3673
3677
|
let t = e[e.length - 1];
|
|
3674
3678
|
if (!t || t.role !== "assistant") return !1;
|
|
3675
|
-
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(
|
|
3679
|
+
let n = t.parts.reduce((e, t, n) => t.type === "step-start" ? n : e, -1), r = t.parts.slice(n + 1).filter((e) => !e.providerExecuted && te(mi(e)));
|
|
3676
3680
|
return r.length > 0 && r.every((e) => ne.has(e.state ?? ""));
|
|
3677
3681
|
};
|
|
3678
|
-
function
|
|
3682
|
+
function gi(e) {
|
|
3679
3683
|
return b(`chatbot-${e}`, () => {
|
|
3680
3684
|
let { t, te: n, locale: r } = me({ useScope: "global" }), i = y(""), a = y(), o = y(e), s = y(), c = y(), l = y(), u = y(), d = y(), f = y(), p = y(), m = y(), h = y(), g = y(), _ = y(), ee = y(), te = y(), ne = y(), se = y(), ce = y(), le = y(!1), ue = he(), de = v(() => {
|
|
3681
3685
|
let e = u.value?.theme;
|
|
@@ -3717,9 +3721,9 @@ function hi(e) {
|
|
|
3717
3721
|
})), Ce = y(null), we = () => ({
|
|
3718
3722
|
...ge(),
|
|
3719
3723
|
...Ce.value ?? {}
|
|
3720
|
-
}), T = v(() => new
|
|
3724
|
+
}), T = v(() => new ci({
|
|
3721
3725
|
id: x.value,
|
|
3722
|
-
transport: new
|
|
3726
|
+
transport: new Fr({
|
|
3723
3727
|
api: w.value.getChatEndpoint(o.value, b.value ? "reasoning" : "chat"),
|
|
3724
3728
|
prepareSendMessagesRequest: ({ messages: e, id: t }) => ({ body: {
|
|
3725
3729
|
id: t,
|
|
@@ -3744,7 +3748,7 @@ function hi(e) {
|
|
|
3744
3748
|
credentials: "include",
|
|
3745
3749
|
headers: () => p.value ?? {}
|
|
3746
3750
|
}),
|
|
3747
|
-
sendAutomaticallyWhen: (e) =>
|
|
3751
|
+
sendAutomaticallyWhen: (e) => hi(e) || Lr(e),
|
|
3748
3752
|
onError: Se,
|
|
3749
3753
|
onFinish: () => {
|
|
3750
3754
|
let e = x.value;
|
|
@@ -3840,7 +3844,7 @@ function hi(e) {
|
|
|
3840
3844
|
let n = await w.value.getChat(o.value, e);
|
|
3841
3845
|
if (!n || e !== x.value || Ge() || t <= qe) return "indeterminate";
|
|
3842
3846
|
qe = t;
|
|
3843
|
-
let r = n.messages, i =
|
|
3847
|
+
let r = n.messages, i = pi(r, T.value.messages);
|
|
3844
3848
|
return T.value.messages = [...r, ...i], C.value = n.blocked ?? !1, i.length > 0 ? "pending" : "caught-up";
|
|
3845
3849
|
} catch {}
|
|
3846
3850
|
return "indeterminate";
|
|
@@ -4131,6 +4135,6 @@ function hi(e) {
|
|
|
4131
4135
|
})();
|
|
4132
4136
|
}
|
|
4133
4137
|
//#endregion
|
|
4134
|
-
export { L as a,
|
|
4138
|
+
export { L as a, Fr as i, gi as n, ci as r, li as t };
|
|
4135
4139
|
|
|
4136
|
-
//# sourceMappingURL=useChatbotStore-
|
|
4140
|
+
//# sourceMappingURL=useChatbotStore-CiRAuq7v.js.map
|