@8wave/ai-elements 0.86.0 → 0.88.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/_chunks/{PkToolShowForm-Cn-H4cT2.js → PkToolShowForm-DxInI-SU.js} +2 -2
- package/dist/_chunks/PkToolShowForm-DxInI-SU.js.map +1 -0
- package/dist/ai-elements.es.js +3111 -3088
- 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/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-BIMT0wBz.js → PkChatbot-obI_7VAa.js} +5 -5
- package/dist-vue/_chunks/{PkChatbot-BIMT0wBz.js.map → PkChatbot-obI_7VAa.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-Dc480HRd.js → PkChatbotMessages-BTVFyrnS.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotMessages-Dc480HRd.js.map → PkChatbotMessages-BTVFyrnS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-5XcFKLsL.js → PkChatbotViewChat-DdY7Xuqa.js} +4 -4
- package/dist-vue/_chunks/{PkChatbotViewChat-5XcFKLsL.js.map → PkChatbotViewChat-DdY7Xuqa.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-DtMC16ye.js → PkChatbotViewConversations-C8hV9Mwm.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-DtMC16ye.js.map → PkChatbotViewConversations-C8hV9Mwm.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-rwxE8oAz.js → PkChatbotViewProfile-Dk02VeJS.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-rwxE8oAz.js.map → PkChatbotViewProfile-Dk02VeJS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CO29-4g-.js → PkToolShowArtifact-LA-xP42x.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CO29-4g-.js.map → PkToolShowArtifact-LA-xP42x.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowCalendarEvent-D6pBcKlC.js → PkToolShowCalendarEvent-B0fvvNqq.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowCalendarEvent-D6pBcKlC.js.map → PkToolShowCalendarEvent-B0fvvNqq.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowComparison-9sZ-wZur.js → PkToolShowComparison-CkxbcdHx.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowComparison-9sZ-wZur.js.map → PkToolShowComparison-CkxbcdHx.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-Dpqd5tro.js → PkToolShowContactForm-Q-zWz2QT.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-Dpqd5tro.js.map → PkToolShowContactForm-Q-zWz2QT.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-BzMs4yST.js → PkToolShowEmail-DcV3KIBI.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-BzMs4yST.js.map → PkToolShowEmail-DcV3KIBI.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-BwHOBNU6.js → PkToolShowForm-YwhD8noA.js} +3 -3
- package/dist-vue/_chunks/PkToolShowForm-YwhD8noA.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowImageGallery-AY3RDKm1.js → PkToolShowImageGallery-C1r8jvlG.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-AY3RDKm1.js.map → PkToolShowImageGallery-C1r8jvlG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowLocation-BNSkfQzK.js → PkToolShowLocation-BvKZaaJS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowLocation-BNSkfQzK.js.map → PkToolShowLocation-BvKZaaJS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-BkeZrC7V.js → PkToolShowMessage-J5IWwUjF.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-BkeZrC7V.js.map → PkToolShowMessage-J5IWwUjF.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-DSKpE_xV.js → PkToolShowProductList-D4Fap8dC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-DSKpE_xV.js.map → PkToolShowProductList-D4Fap8dC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowQrCode-4VvbbzaY.js → PkToolShowQrCode-BUH5vIS8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowQrCode-4VvbbzaY.js.map → PkToolShowQrCode-BUH5vIS8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-OrX42JvT.js → PkToolShowSources-ChkWKhFd.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-OrX42JvT.js.map → PkToolShowSources-ChkWKhFd.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DwuQo5jJ.js → PkToolShowSuggestedReply-VVg-OVtH.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-DwuQo5jJ.js.map → PkToolShowSuggestedReply-VVg-OVtH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-DB2ZAV_5.js → PkToolShowWebPages-CbdH6FZQ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-DB2ZAV_5.js.map → PkToolShowWebPages-CbdH6FZQ.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-nfzYJAR8.js → createChatbotApiClient-DWRtOu7t.js} +386 -383
- package/dist-vue/_chunks/createChatbotApiClient-DWRtOu7t.js.map +1 -0
- package/dist-vue/_chunks/{dist-cI6n0Ysp.js → dist-BN5P-Pmm.js} +2 -2
- package/dist-vue/_chunks/{dist-cI6n0Ysp.js.map → dist-BN5P-Pmm.js.map} +1 -1
- package/dist-vue/_chunks/{dist-CsJGDQx2.js → dist-Bv_EQP56.js} +2 -2
- package/dist-vue/_chunks/{dist-CsJGDQx2.js.map → dist-Bv_EQP56.js.map} +1 -1
- package/dist-vue/_chunks/{dist-DSYfmLHg.js → dist-C2-7Fze7.js} +2 -2
- package/dist-vue/_chunks/{dist-DSYfmLHg.js.map → dist-C2-7Fze7.js.map} +1 -1
- package/dist-vue/_chunks/{dist-CR5js-m0.js → dist-CYAK1sKO.js} +2 -2
- package/dist-vue/_chunks/{dist-CR5js-m0.js.map → dist-CYAK1sKO.js.map} +1 -1
- package/dist-vue/_chunks/{dist-CmgWe1rp.js → dist-Cact3-tk.js} +2 -2
- package/dist-vue/_chunks/{dist-CmgWe1rp.js.map → dist-Cact3-tk.js.map} +1 -1
- package/dist-vue/_chunks/{dist-mzC92jO7.js → dist-D7NafeHu.js} +4 -4
- package/dist-vue/_chunks/{dist-mzC92jO7.js.map → dist-D7NafeHu.js.map} +1 -1
- package/dist-vue/_chunks/{dist-DFanv2QX.js → dist-DHQ8itnF.js} +2 -2
- package/dist-vue/_chunks/{dist-DFanv2QX.js.map → dist-DHQ8itnF.js.map} +1 -1
- package/dist-vue/_chunks/{dist-BNvqaw4Y.js → dist-DTPBebYZ.js} +3 -3
- package/dist-vue/_chunks/{dist-BNvqaw4Y.js.map → dist-DTPBebYZ.js.map} +1 -1
- package/dist-vue/_chunks/{dist-DW3ekwuQ.js → dist-DlXJzThT.js} +2 -2
- package/dist-vue/_chunks/{dist-DW3ekwuQ.js.map → dist-DlXJzThT.js.map} +1 -1
- package/dist-vue/_chunks/{dist-CiIh8vh_.js → dist-_Aw9VPtK.js} +3 -3
- package/dist-vue/_chunks/{dist-CiIh8vh_.js.map → dist-_Aw9VPtK.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-Or_R6a3R.js → useChatbotStore-VxGMdCch.js} +1079 -1082
- package/dist-vue/_chunks/{useChatbotStore-Or_R6a3R.js.map → useChatbotStore-VxGMdCch.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +3 -0
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +4 -4
- package/dist-vue/apps/web-component/src/lib.d.ts +1 -0
- package/dist-vue/composables.js +2 -2
- package/dist-vue/index.js +4644 -8185
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +4 -0
- package/dist-vue/packages/ability/src/index.d.ts +1 -2
- package/dist-vue/packages/ability/src/types.d.ts +10 -1
- package/dist-vue/packages/auth/src/index.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkChatSidebarConversationItem.d.ts +2 -2
- package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +10 -10
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +1 -1
- package/dist-vue/packages/composable/src/useJsonSchemaEditor.d.ts +3 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +14 -0
- package/dist-vue/style.css +1 -1
- package/package.json +4 -5
- package/dist/_chunks/PkToolShowForm-Cn-H4cT2.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-BwHOBNU6.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-nfzYJAR8.js.map +0 -1
package/dist-vue/_chunks/{createChatbotApiClient-nfzYJAR8.js → createChatbotApiClient-DWRtOu7t.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import { a as
|
|
4
|
-
import { r as g, t as
|
|
5
|
-
import { Ability as
|
|
6
|
-
import { createAccessControl as
|
|
7
|
-
import { adminAc as
|
|
1
|
+
import { S as e, a as t, b as n, c as r, d as i, g as a, h as o, i as s, m as c, n as l, o as u, p as d, u as ee, v as f, x as p } from "./schemas-B9AZeRC2.js";
|
|
2
|
+
import { i as m, n as te, t as ne } from "./Media-CWZEQLgV.js";
|
|
3
|
+
import { a as re, o as h, r as ie } from "./constants-DpYDYnZU.js";
|
|
4
|
+
import { r as g, t as ae } from "./src-eflR9S8N.js";
|
|
5
|
+
import { Ability as oe, buildMongoQueryMatcher as se, createAliasResolver as ce } from "@casl/ability";
|
|
6
|
+
import { createAccessControl as le } from "better-auth/plugins";
|
|
7
|
+
import { adminAc as ue, defaultStatements as de, memberAc as _, ownerAc as fe } from "better-auth/plugins/organization/access";
|
|
8
8
|
//#region ../../packages/models/src/schema/Agent.ts
|
|
9
9
|
var v = /* @__PURE__ */ function(e) {
|
|
10
10
|
return e.Draft = "draft", e.Active = "active", e.Inactive = "inactive", e;
|
|
@@ -14,45 +14,45 @@ var v = /* @__PURE__ */ function(e) {
|
|
|
14
14
|
return e.Chat = "chat", e.Reasoning = "reasoning", e;
|
|
15
15
|
}({}), x = /* @__PURE__ */ function(e) {
|
|
16
16
|
return e.Semantic = "semantic", e.Balanced = "balanced", e.Keyword = "keyword", e;
|
|
17
|
-
}({}),
|
|
18
|
-
reasoningEffort:
|
|
17
|
+
}({}), pe = c({
|
|
18
|
+
reasoningEffort: l([
|
|
19
19
|
"none",
|
|
20
20
|
"low",
|
|
21
21
|
"medium",
|
|
22
22
|
"high",
|
|
23
23
|
"xhigh"
|
|
24
24
|
]).optional(),
|
|
25
|
-
reasoningSummary:
|
|
25
|
+
reasoningSummary: l([
|
|
26
26
|
"auto",
|
|
27
27
|
"detailed",
|
|
28
28
|
"concise"
|
|
29
29
|
]).optional()
|
|
30
|
-
}),
|
|
31
|
-
type:
|
|
30
|
+
}), me = c({
|
|
31
|
+
type: l([
|
|
32
32
|
"adaptive",
|
|
33
33
|
"enabled",
|
|
34
34
|
"disabled"
|
|
35
35
|
]).optional(),
|
|
36
|
-
effort:
|
|
36
|
+
effort: l([
|
|
37
37
|
"low",
|
|
38
38
|
"medium",
|
|
39
39
|
"high",
|
|
40
40
|
"xhigh",
|
|
41
41
|
"max"
|
|
42
42
|
]).optional(),
|
|
43
|
-
display:
|
|
44
|
-
budgetTokens:
|
|
45
|
-
}),
|
|
46
|
-
thinkingLevel:
|
|
43
|
+
display: l(["summarized", "omitted"]).optional(),
|
|
44
|
+
budgetTokens: d().int().positive().optional()
|
|
45
|
+
}), he = c({
|
|
46
|
+
thinkingLevel: l([
|
|
47
47
|
"minimal",
|
|
48
48
|
"low",
|
|
49
49
|
"medium",
|
|
50
50
|
"high"
|
|
51
51
|
]).optional(),
|
|
52
|
-
thinkingBudget:
|
|
53
|
-
includeThoughts:
|
|
54
|
-
}),
|
|
55
|
-
function
|
|
52
|
+
thinkingBudget: d().int().optional(),
|
|
53
|
+
includeThoughts: u().optional()
|
|
54
|
+
}), ge = c({ type: l(["enabled", "disabled"]).optional() });
|
|
55
|
+
function _e(e) {
|
|
56
56
|
if (!e || typeof e != "object") return e;
|
|
57
57
|
let t = e;
|
|
58
58
|
if ("effort" in t && !("openai" in t || "anthropic" in t || "google" in t || "deepseek" in t)) {
|
|
@@ -67,13 +67,13 @@ function ge(e) {
|
|
|
67
67
|
}
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
|
-
var S =
|
|
71
|
-
openai:
|
|
72
|
-
anthropic:
|
|
73
|
-
google:
|
|
74
|
-
deepseek:
|
|
70
|
+
var S = o(_e, c({
|
|
71
|
+
openai: pe.optional(),
|
|
72
|
+
anthropic: me.optional(),
|
|
73
|
+
google: he.optional(),
|
|
74
|
+
deepseek: ge.optional()
|
|
75
75
|
}).optional());
|
|
76
|
-
function
|
|
76
|
+
function ve(e, t) {
|
|
77
77
|
if (!t) return !1;
|
|
78
78
|
let [n = ""] = e.split("/");
|
|
79
79
|
if (n === "openai") {
|
|
@@ -93,126 +93,126 @@ function _e(e, t) {
|
|
|
93
93
|
var C = /* @__PURE__ */ function(e) {
|
|
94
94
|
return e.Geocode = "geocode", e.GetWeather = "getWeather", e.ReadDocumentFile = "readDocumentFile", e.RequestConfirm = "requestConfirm", e.RequestGeolocation = "requestGeolocation", e.RetrieveRevisedAnswers = "retrieveRevisedAnswers", e.SearchInKnowledgeBase = "searchInKnowledgeBase", e.ShowArtifact = "showArtifact", e.ShowCalendarEvent = "showCalendarEvent", e.ShowComparison = "showComparison", e.ShowContactForm = "showContactForm", e.ShowDiagram = "showDiagram", e.ShowEmail = "showEmail", e.ShowImageGallery = "showImageGallery", e.ShowLocation = "showLocation", e.ShowMessage = "showMessage", e.ShowForm = "showForm", e.ShowProductList = "showProductList", e.ShowQrCode = "showQrCode", e.ShowSources = "showSources", e.ShowSuggestedReply = "showSuggestedReply", e.ShowWeather = "showWeather", e.ShowWebPages = "showWebPages", e.ShowMultipleChoice = "showMultipleChoice", e;
|
|
95
95
|
}({});
|
|
96
|
-
function
|
|
96
|
+
function ye(e) {
|
|
97
97
|
return e === C.RequestConfirm || e === C.ShowArtifact || e === C.ShowCalendarEvent || e === C.ShowComparison || e === C.ShowContactForm || e === C.ShowDiagram || e === C.ShowEmail || e === C.ShowImageGallery || e === C.ShowLocation || e === C.ShowMessage || e === C.ShowForm || e === C.ShowMultipleChoice || e === C.ShowProductList || e === C.ShowQrCode || e === C.ShowSources || e === C.ShowSuggestedReply || e === C.ShowWeather || e === C.ShowWebPages;
|
|
98
98
|
}
|
|
99
|
-
var w =
|
|
100
|
-
maxSteps:
|
|
101
|
-
maxOptionsPerStep:
|
|
99
|
+
var w = c({
|
|
100
|
+
maxSteps: d().int().min(1).max(10).optional().default(5),
|
|
101
|
+
maxOptionsPerStep: d().int().min(2).max(10).optional().default(5)
|
|
102
102
|
}), T = /* @__PURE__ */ function(e) {
|
|
103
103
|
return e.Perplexity = "perplexity", e.Parallel = "parallel", e.Native = "native", e;
|
|
104
|
-
}({}),
|
|
105
|
-
maxResults:
|
|
106
|
-
maxTokens:
|
|
107
|
-
maxTokensPerPage:
|
|
108
|
-
country:
|
|
109
|
-
searchLanguageFilter:
|
|
110
|
-
searchDomainFilter:
|
|
111
|
-
searchRecencyFilter:
|
|
104
|
+
}({}), be = c({
|
|
105
|
+
maxResults: d().int().min(1).max(20).optional(),
|
|
106
|
+
maxTokens: d().int().positive().max(1e6).optional(),
|
|
107
|
+
maxTokensPerPage: d().int().positive().optional(),
|
|
108
|
+
country: f().max(2).optional(),
|
|
109
|
+
searchLanguageFilter: t(f().max(5)).max(10).optional(),
|
|
110
|
+
searchDomainFilter: t(f()).max(20).optional(),
|
|
111
|
+
searchRecencyFilter: l([
|
|
112
112
|
"day",
|
|
113
113
|
"week",
|
|
114
114
|
"month",
|
|
115
115
|
"year"
|
|
116
116
|
]).optional()
|
|
117
|
-
}),
|
|
118
|
-
mode:
|
|
119
|
-
maxResults:
|
|
120
|
-
sourcePolicy:
|
|
121
|
-
includeDomains:
|
|
122
|
-
excludeDomains:
|
|
123
|
-
afterDate:
|
|
117
|
+
}), xe = c({
|
|
118
|
+
mode: l(["one-shot", "agentic"]).optional(),
|
|
119
|
+
maxResults: d().int().min(1).max(20).optional(),
|
|
120
|
+
sourcePolicy: c({
|
|
121
|
+
includeDomains: t(f()).optional(),
|
|
122
|
+
excludeDomains: t(f()).optional(),
|
|
123
|
+
afterDate: f().optional()
|
|
124
124
|
}).optional(),
|
|
125
|
-
excerpts:
|
|
126
|
-
maxCharsPerResult:
|
|
127
|
-
maxCharsTotal:
|
|
125
|
+
excerpts: c({
|
|
126
|
+
maxCharsPerResult: d().int().positive().optional(),
|
|
127
|
+
maxCharsTotal: d().int().positive().optional()
|
|
128
128
|
}).optional(),
|
|
129
|
-
fetchPolicy:
|
|
130
|
-
}),
|
|
131
|
-
openai:
|
|
132
|
-
anthropic:
|
|
133
|
-
maxUses:
|
|
134
|
-
allowedDomains:
|
|
135
|
-
blockedDomains:
|
|
136
|
-
userLocation:
|
|
137
|
-
type:
|
|
138
|
-
country:
|
|
139
|
-
region:
|
|
140
|
-
city:
|
|
141
|
-
timezone:
|
|
129
|
+
fetchPolicy: c({ maxAgeSeconds: d().int().positive().optional() }).optional()
|
|
130
|
+
}), Se = c({
|
|
131
|
+
openai: c({}).optional(),
|
|
132
|
+
anthropic: c({
|
|
133
|
+
maxUses: d().int().positive().optional(),
|
|
134
|
+
allowedDomains: t(f()).optional(),
|
|
135
|
+
blockedDomains: t(f()).optional(),
|
|
136
|
+
userLocation: c({
|
|
137
|
+
type: i("approximate").optional(),
|
|
138
|
+
country: f().optional(),
|
|
139
|
+
region: f().optional(),
|
|
140
|
+
city: f().optional(),
|
|
141
|
+
timezone: f().optional()
|
|
142
142
|
}).optional()
|
|
143
143
|
}).optional(),
|
|
144
|
-
google:
|
|
145
|
-
}), E =
|
|
146
|
-
enabled:
|
|
147
|
-
provider:
|
|
148
|
-
perplexity:
|
|
149
|
-
parallel:
|
|
150
|
-
native:
|
|
151
|
-
}), D =
|
|
152
|
-
disabled:
|
|
144
|
+
google: c({}).optional()
|
|
145
|
+
}), E = c({
|
|
146
|
+
enabled: u().default(!1),
|
|
147
|
+
provider: l(T).optional().default(T.Native),
|
|
148
|
+
perplexity: be.optional(),
|
|
149
|
+
parallel: xe.optional(),
|
|
150
|
+
native: Se.optional()
|
|
151
|
+
}), D = c({
|
|
152
|
+
disabled: t(l(C)).default([]),
|
|
153
153
|
showForm: w.optional().default(() => w.parse({})),
|
|
154
154
|
webSearch: E.optional().default(() => E.parse({}))
|
|
155
|
-
}), O =
|
|
156
|
-
freshness:
|
|
157
|
-
enabled:
|
|
158
|
-
scale:
|
|
159
|
-
weight:
|
|
155
|
+
}), O = c({
|
|
156
|
+
freshness: c({
|
|
157
|
+
enabled: u().default(!1),
|
|
158
|
+
scale: d().int().min(86400).max(31536e3).default(7776e3),
|
|
159
|
+
weight: d().min(.05).max(.5).default(.1)
|
|
160
160
|
}).prefault({}),
|
|
161
|
-
priority:
|
|
162
|
-
mmr:
|
|
163
|
-
enabled:
|
|
164
|
-
diversity:
|
|
165
|
-
candidatesLimit:
|
|
161
|
+
priority: c({ enabled: u().default(!0) }).prefault({}),
|
|
162
|
+
mmr: c({
|
|
163
|
+
enabled: u().default(!1),
|
|
164
|
+
diversity: d().min(0).max(1).default(.3),
|
|
165
|
+
candidatesLimit: d().int().min(50).max(200).default(100)
|
|
166
166
|
}).prefault({})
|
|
167
|
-
}).prefault({}),
|
|
168
|
-
prompt:
|
|
169
|
-
temperature:
|
|
170
|
-
maxOutputTokens:
|
|
171
|
-
presencePenalty:
|
|
172
|
-
frequencyPenalty:
|
|
173
|
-
searchMode:
|
|
174
|
-
limit:
|
|
175
|
-
maxStepCount:
|
|
167
|
+
}).prefault({}), Ce = c({
|
|
168
|
+
prompt: f().optional(),
|
|
169
|
+
temperature: d().min(0).max(2).optional().default(.6),
|
|
170
|
+
maxOutputTokens: d().positive().optional(),
|
|
171
|
+
presencePenalty: d().min(-2).max(2).optional(),
|
|
172
|
+
frequencyPenalty: d().min(-2).max(2).optional(),
|
|
173
|
+
searchMode: l(x).optional().default(x.Balanced),
|
|
174
|
+
limit: d().positive().max(100).optional().default(10),
|
|
175
|
+
maxStepCount: d().int().min(1).max(40).optional().default(10),
|
|
176
176
|
reasoning: S,
|
|
177
177
|
ranking: O.optional().default(() => O.parse({}))
|
|
178
|
-
}), k =
|
|
178
|
+
}), k = o((e) => typeof e == "string" ? { it: e } : e, a(f(), f())), A = "https://cdn.jsdelivr.net/npm/@8wave/ai-elements/dist/ai-elements.es.js", j = /* @__PURE__ */ function(e) {
|
|
179
179
|
return e.InlineModule = "inline-module", e.ScriptSrc = "script-src", e.DynamicImport = "dynamic-import", e;
|
|
180
180
|
}({}), M = /* @__PURE__ */ function(e) {
|
|
181
181
|
return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
|
|
182
|
-
}({}), N = Object.values(M), P =
|
|
182
|
+
}({}), N = Object.values(M), P = c({
|
|
183
183
|
media: te.optional(),
|
|
184
|
-
logo:
|
|
185
|
-
theme:
|
|
184
|
+
logo: f().optional(),
|
|
185
|
+
theme: l([
|
|
186
186
|
"light",
|
|
187
187
|
"dark",
|
|
188
188
|
"auto"
|
|
189
189
|
]).optional().default("auto"),
|
|
190
|
-
mainColor:
|
|
191
|
-
textColor:
|
|
190
|
+
mainColor: f().regex(/^#[0-9A-Fa-f]{6}$/).optional().default("#000000"),
|
|
191
|
+
textColor: l([
|
|
192
192
|
"auto",
|
|
193
193
|
"white",
|
|
194
194
|
"black"
|
|
195
195
|
]).optional().default("auto"),
|
|
196
|
-
useColorsForAgentHeader:
|
|
196
|
+
useColorsForAgentHeader: u().optional().default(!1),
|
|
197
197
|
initialMessage: k.optional(),
|
|
198
|
-
greeting:
|
|
198
|
+
greeting: t(k).min(1).max(10).optional(),
|
|
199
199
|
messagePlaceholder: k.optional(),
|
|
200
200
|
dismissableNotice: k.optional(),
|
|
201
201
|
footerMessage: k.optional(),
|
|
202
202
|
privacyPolicyNotice: k.optional(),
|
|
203
|
-
welcomePopup:
|
|
204
|
-
floatingButtonPosition:
|
|
205
|
-
maxMessageLength:
|
|
206
|
-
widgetUrl:
|
|
207
|
-
loadDelay:
|
|
208
|
-
loaderStrategy:
|
|
209
|
-
customCss:
|
|
210
|
-
smoothStream:
|
|
211
|
-
showExtendedSteps:
|
|
212
|
-
}), F =
|
|
213
|
-
enabled:
|
|
214
|
-
maxFileSizeBytes:
|
|
215
|
-
allowedMimeTypes:
|
|
203
|
+
welcomePopup: u().optional().default(!1),
|
|
204
|
+
floatingButtonPosition: l(["left", "right"]).optional().default("right"),
|
|
205
|
+
maxMessageLength: d().int().positive().optional(),
|
|
206
|
+
widgetUrl: p().default(A),
|
|
207
|
+
loadDelay: d().int().min(0).max(3e4).optional().default(0),
|
|
208
|
+
loaderStrategy: l(j).optional().default(j.InlineModule),
|
|
209
|
+
customCss: f().optional(),
|
|
210
|
+
smoothStream: u().optional().default(!1),
|
|
211
|
+
showExtendedSteps: u().optional().default(!1)
|
|
212
|
+
}), F = c({
|
|
213
|
+
enabled: u().default(!1),
|
|
214
|
+
maxFileSizeBytes: d().int().positive().max(104857600).optional().default(20971520),
|
|
215
|
+
allowedMimeTypes: t(f().regex(ne)).optional().default([
|
|
216
216
|
"image/jpeg",
|
|
217
217
|
"image/png",
|
|
218
218
|
"image/gif",
|
|
@@ -222,99 +222,102 @@ var w = s({
|
|
|
222
222
|
"text/markdown",
|
|
223
223
|
"text/csv"
|
|
224
224
|
]),
|
|
225
|
-
maxFilesPerMessage:
|
|
226
|
-
maxFilesPerChat:
|
|
227
|
-
}), I =
|
|
228
|
-
zeroDataRetention:
|
|
229
|
-
disallowPromptTraining:
|
|
230
|
-
providerTimeoutMs:
|
|
231
|
-
}), L =
|
|
232
|
-
model:
|
|
225
|
+
maxFilesPerMessage: d().int().positive().max(10).optional().default(5),
|
|
226
|
+
maxFilesPerChat: d().int().positive().max(50).optional().default(20)
|
|
227
|
+
}), I = c({
|
|
228
|
+
zeroDataRetention: u().default(!0),
|
|
229
|
+
disallowPromptTraining: u().default(!0),
|
|
230
|
+
providerTimeoutMs: d().int().min(1e3).max(789e3).optional()
|
|
231
|
+
}), L = c({
|
|
232
|
+
model: Ce,
|
|
233
233
|
interface: P,
|
|
234
234
|
tools: D.optional().default(() => D.parse({})),
|
|
235
235
|
fileUpload: F.optional().default(() => F.parse({})),
|
|
236
236
|
gatewayOptions: I.optional().default(() => I.parse({})),
|
|
237
|
-
channels:
|
|
238
|
-
externalContextSchema:
|
|
239
|
-
}), R =
|
|
240
|
-
rateLimits:
|
|
241
|
-
minuteRateLimit:
|
|
242
|
-
hourRateLimit:
|
|
243
|
-
dayRateLimit:
|
|
244
|
-
monthRateLimit:
|
|
237
|
+
channels: t(l(M)).optional().default(() => [...N]),
|
|
238
|
+
externalContextSchema: re.optional()
|
|
239
|
+
}), R = c({
|
|
240
|
+
rateLimits: c({
|
|
241
|
+
minuteRateLimit: d().int().min(0).optional(),
|
|
242
|
+
hourRateLimit: d().int().min(0).optional(),
|
|
243
|
+
dayRateLimit: d().int().min(0).optional(),
|
|
244
|
+
monthRateLimit: d().int().min(0).optional()
|
|
245
245
|
}),
|
|
246
|
-
trustedOrigins:
|
|
246
|
+
trustedOrigins: c({ origins: t(p().or(i(""))).transform((e) => e?.filter((e) => e?.trim())).default([]) }).default({ origins: [] })
|
|
247
247
|
});
|
|
248
|
-
|
|
249
|
-
id:
|
|
250
|
-
name:
|
|
251
|
-
prompt:
|
|
252
|
-
model:
|
|
253
|
-
fallbackModels:
|
|
254
|
-
status:
|
|
255
|
-
visibility:
|
|
248
|
+
c({
|
|
249
|
+
id: f().optional(),
|
|
250
|
+
name: f(),
|
|
251
|
+
prompt: f().optional(),
|
|
252
|
+
model: f().default(ie.gpt52Chat),
|
|
253
|
+
fallbackModels: t(f()).default([]),
|
|
254
|
+
status: l(v).default(v.Draft),
|
|
255
|
+
visibility: l(y).default(y.Organization),
|
|
256
256
|
settings: L,
|
|
257
257
|
security: R.nullish(),
|
|
258
|
-
type:
|
|
259
|
-
organizationId:
|
|
260
|
-
}), ee(() =>
|
|
261
|
-
id:
|
|
262
|
-
name:
|
|
263
|
-
prompt:
|
|
264
|
-
model:
|
|
265
|
-
fallbackModels:
|
|
266
|
-
status:
|
|
267
|
-
visibility:
|
|
258
|
+
type: l(b).default(b.Chat),
|
|
259
|
+
organizationId: f()
|
|
260
|
+
}), ee(() => c({
|
|
261
|
+
id: f(),
|
|
262
|
+
name: f(),
|
|
263
|
+
prompt: f(),
|
|
264
|
+
model: f(),
|
|
265
|
+
fallbackModels: t(f()).nullable().default([]),
|
|
266
|
+
status: l(v).default(v.Draft),
|
|
267
|
+
visibility: l(y).default(y.Organization),
|
|
268
268
|
settings: L,
|
|
269
269
|
security: R.nullable(),
|
|
270
|
-
type:
|
|
271
|
-
organizationId:
|
|
272
|
-
createdAt:
|
|
273
|
-
createdBy:
|
|
274
|
-
updatedAt:
|
|
275
|
-
updatedBy:
|
|
276
|
-
deleted:
|
|
277
|
-
deletedAt:
|
|
278
|
-
deletedBy:
|
|
279
|
-
outOfBudget:
|
|
280
|
-
outOfBudgetReason:
|
|
270
|
+
type: l(b).default(b.Chat),
|
|
271
|
+
organizationId: f(),
|
|
272
|
+
createdAt: m(),
|
|
273
|
+
createdBy: f(),
|
|
274
|
+
updatedAt: m(),
|
|
275
|
+
updatedBy: f(),
|
|
276
|
+
deleted: u(),
|
|
277
|
+
deletedAt: m().nullable(),
|
|
278
|
+
deletedBy: f().nullable(),
|
|
279
|
+
outOfBudget: u().optional().default(!1),
|
|
280
|
+
outOfBudgetReason: f().optional().default("")
|
|
281
281
|
}));
|
|
282
|
-
var z =
|
|
283
|
-
id:
|
|
284
|
-
name:
|
|
285
|
-
status:
|
|
286
|
-
visibility:
|
|
287
|
-
organizationId:
|
|
282
|
+
var z = c({
|
|
283
|
+
id: f(),
|
|
284
|
+
name: f(),
|
|
285
|
+
status: l(v),
|
|
286
|
+
visibility: l(y),
|
|
287
|
+
organizationId: f(),
|
|
288
288
|
interface: P,
|
|
289
|
-
createdAt:
|
|
290
|
-
updatedAt:
|
|
291
|
-
capabilities:
|
|
292
|
-
channels:
|
|
293
|
-
}),
|
|
289
|
+
createdAt: m(),
|
|
290
|
+
updatedAt: m(),
|
|
291
|
+
capabilities: c({ fileUpload: F }),
|
|
292
|
+
channels: t(l(M)).default(() => [...N])
|
|
293
|
+
}), we = P.pick({
|
|
294
294
|
logo: !0,
|
|
295
295
|
mainColor: !0,
|
|
296
296
|
textColor: !0,
|
|
297
297
|
theme: !0,
|
|
298
298
|
floatingButtonPosition: !0,
|
|
299
299
|
customCss: !0
|
|
300
|
-
}),
|
|
300
|
+
}), Te = z.pick({
|
|
301
301
|
id: !0,
|
|
302
302
|
name: !0,
|
|
303
303
|
organizationId: !0
|
|
304
|
-
}).extend({ interface:
|
|
305
|
-
emailPassword:
|
|
306
|
-
google:
|
|
307
|
-
microsoft:
|
|
308
|
-
}), V =
|
|
309
|
-
requiresAuth:
|
|
304
|
+
}).extend({ interface: we }), B = c({
|
|
305
|
+
emailPassword: u(),
|
|
306
|
+
google: u(),
|
|
307
|
+
microsoft: u()
|
|
308
|
+
}), V = c({
|
|
309
|
+
requiresAuth: i(!1),
|
|
310
310
|
agent: z,
|
|
311
|
-
branding:
|
|
312
|
-
}), H =
|
|
313
|
-
requiresAuth:
|
|
314
|
-
agent:
|
|
315
|
-
branding:
|
|
311
|
+
branding: s()
|
|
312
|
+
}), H = c({
|
|
313
|
+
requiresAuth: i(!0),
|
|
314
|
+
agent: s(),
|
|
315
|
+
branding: Te
|
|
316
316
|
});
|
|
317
|
-
|
|
317
|
+
r("requiresAuth", [V, H]), r("requiresAuth", [V.extend({ authMethods: B }), H.extend({ authMethods: B })]), c({
|
|
318
|
+
id: e(),
|
|
319
|
+
agentIds: t(e())
|
|
320
|
+
}), c({
|
|
318
321
|
...h.pagination(),
|
|
319
322
|
...h.sort([
|
|
320
323
|
"id",
|
|
@@ -333,136 +336,136 @@ n("requiresAuth", [V, H]), n("requiresAuth", [V.extend({ authMethods: B }), H.ex
|
|
|
333
336
|
});
|
|
334
337
|
//#endregion
|
|
335
338
|
//#region ../../packages/models/src/schema/ConversationAnalysis.ts
|
|
336
|
-
var
|
|
339
|
+
var Ee = /* @__PURE__ */ function(e) {
|
|
337
340
|
return e.Harassment = "harassment", e.HateSpeech = "hate_speech", e.SexualContent = "sexual_content", e.SelfHarm = "self_harm", e.Violence = "violence", e.PromptInjection = "prompt_injection", e.DataExtraction = "data_extraction", e.Spam = "spam", e.OffTopicPersistent = "off_topic_persistent", e.Impersonation = "impersonation", e;
|
|
338
|
-
}({}), Ee = /* @__PURE__ */ function(e) {
|
|
339
|
-
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
340
341
|
}({}), De = /* @__PURE__ */ function(e) {
|
|
341
|
-
return e.
|
|
342
|
+
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
342
343
|
}({}), Oe = /* @__PURE__ */ function(e) {
|
|
343
|
-
return e.
|
|
344
|
+
return e.Hallucination = "hallucination", e.OffBrand = "off_brand", e.DataLeak = "data_leak", e.InappropriateTone = "inappropriate_tone", e.RefusalLoop = "refusal_loop", e.Repetition = "repetition", e;
|
|
344
345
|
}({}), ke = /* @__PURE__ */ function(e) {
|
|
345
|
-
return e.
|
|
346
|
+
return e.SummaryCycle = "summary_cycle", e.AgentRequest = "agent_request", e.Manual = "manual", e;
|
|
346
347
|
}({}), Ae = /* @__PURE__ */ function(e) {
|
|
347
|
-
return e.
|
|
348
|
+
return e.High = "high", e.Medium = "medium", e.Low = "low", e.Disengaged = "disengaged", e;
|
|
348
349
|
}({}), je = /* @__PURE__ */ function(e) {
|
|
349
|
-
return e.
|
|
350
|
+
return e.Polite = "polite", e.Neutral = "neutral", e.Impatient = "impatient", e.Aggressive = "aggressive", e.Abusive = "abusive", e;
|
|
350
351
|
}({}), Me = /* @__PURE__ */ function(e) {
|
|
352
|
+
return e.Positive = "positive", e.Neutral = "neutral", e.Negative = "negative", e.Frustrated = "frustrated", e.Excited = "excited", e;
|
|
353
|
+
}({}), Ne = /* @__PURE__ */ function(e) {
|
|
351
354
|
return e.Improving = "improving", e.Stable = "stable", e.Degrading = "degrading", e;
|
|
352
|
-
}({}),
|
|
353
|
-
analyzedAt:
|
|
354
|
-
analysisTrigger:
|
|
355
|
-
sentiment:
|
|
356
|
-
sentimentTrend:
|
|
357
|
-
userTone:
|
|
358
|
-
language:
|
|
359
|
-
topics:
|
|
360
|
-
userAbuseDetected:
|
|
361
|
-
userAbuseCategories:
|
|
362
|
-
userAbuseConfidence:
|
|
363
|
-
userAbuseSummary:
|
|
364
|
-
llmIssueDetected:
|
|
365
|
-
llmIssueCategories:
|
|
366
|
-
llmIssueSummary:
|
|
367
|
-
userEngagement:
|
|
368
|
-
conversationGoalMet:
|
|
369
|
-
riskScore:
|
|
370
|
-
}),
|
|
371
|
-
dateTime:
|
|
372
|
-
timezone:
|
|
373
|
-
language:
|
|
374
|
-
languages:
|
|
375
|
-
url:
|
|
376
|
-
pathname:
|
|
377
|
-
pageTitle:
|
|
378
|
-
referrer:
|
|
379
|
-
screenWidth:
|
|
380
|
-
screenHeight:
|
|
381
|
-
viewportWidth:
|
|
382
|
-
viewportHeight:
|
|
383
|
-
devicePixelRatio:
|
|
384
|
-
maxTouchPoints:
|
|
385
|
-
hardwareConcurrency:
|
|
386
|
-
deviceMemory:
|
|
387
|
-
platform:
|
|
388
|
-
connectionType:
|
|
389
|
-
connectionEffectiveType:
|
|
390
|
-
connectionDownlink:
|
|
391
|
-
connectionRtt:
|
|
392
|
-
saveData:
|
|
393
|
-
darkMode:
|
|
394
|
-
reducedMotion:
|
|
395
|
-
historyLength:
|
|
396
|
-
geolocationLatitude:
|
|
397
|
-
geolocationLongitude:
|
|
398
|
-
geolocationAccuracy:
|
|
399
|
-
geolocationCity:
|
|
400
|
-
}),
|
|
401
|
-
type:
|
|
402
|
-
text:
|
|
403
|
-
}),
|
|
404
|
-
type:
|
|
405
|
-
mediaType:
|
|
406
|
-
url:
|
|
407
|
-
filename:
|
|
408
|
-
providerMetadata:
|
|
355
|
+
}({}), Pe = c({
|
|
356
|
+
analyzedAt: m().describe("When the analysis was generated."),
|
|
357
|
+
analysisTrigger: l(ke).describe("What triggered this analysis run."),
|
|
358
|
+
sentiment: l(Me).describe("Overall user sentiment in the conversation."),
|
|
359
|
+
sentimentTrend: l(Ne).describe("How the user sentiment evolved during the conversation."),
|
|
360
|
+
userTone: l(je).describe("Predominant tone of the user messages."),
|
|
361
|
+
language: f().max(10).describe("ISO 639-1 language code of the conversation (e.g. \"en\", \"it\")."),
|
|
362
|
+
topics: t(f().max(100)).max(10).describe("Main topics discussed, as short lowercase labels."),
|
|
363
|
+
userAbuseDetected: u().describe("Whether user abuse was detected. If false, userAbuseCategories MUST be empty."),
|
|
364
|
+
userAbuseCategories: t(l(Ee)).default([]).describe("Abuse categories detected. Non-empty only if userAbuseDetected is true."),
|
|
365
|
+
userAbuseConfidence: l(De).optional().describe("Confidence level of the abuse detection. Set only if userAbuseDetected is true."),
|
|
366
|
+
userAbuseSummary: f().max(500).optional().describe("Brief description of the abusive behavior detected. Always write in English. Set only if userAbuseDetected is true."),
|
|
367
|
+
llmIssueDetected: u().describe("Whether an LLM quality issue was detected. If false, llmIssueCategories MUST be empty."),
|
|
368
|
+
llmIssueCategories: t(l(Oe)).default([]).describe("LLM issue categories detected. Non-empty only if llmIssueDetected is true."),
|
|
369
|
+
llmIssueSummary: f().max(500).optional().describe("Brief description of the LLM quality issue detected. Always write in English. Set only if llmIssueDetected is true."),
|
|
370
|
+
userEngagement: l(Ae).describe("Level of user engagement in the conversation."),
|
|
371
|
+
conversationGoalMet: u().optional().describe("Whether the user seems to have achieved what they came for. Leave undefined if unclear."),
|
|
372
|
+
riskScore: d().int().min(0).max(100).describe("Overall risk score (0 = safe, 100 = critical). Combination of abuse severity, persistence and escalation.")
|
|
373
|
+
}), Fe = c({
|
|
374
|
+
dateTime: f().optional(),
|
|
375
|
+
timezone: f().optional(),
|
|
376
|
+
language: f().optional(),
|
|
377
|
+
languages: t(f()).optional(),
|
|
378
|
+
url: f().optional(),
|
|
379
|
+
pathname: f().optional(),
|
|
380
|
+
pageTitle: f().optional(),
|
|
381
|
+
referrer: f().optional(),
|
|
382
|
+
screenWidth: d().optional(),
|
|
383
|
+
screenHeight: d().optional(),
|
|
384
|
+
viewportWidth: d().optional(),
|
|
385
|
+
viewportHeight: d().optional(),
|
|
386
|
+
devicePixelRatio: d().optional(),
|
|
387
|
+
maxTouchPoints: d().optional(),
|
|
388
|
+
hardwareConcurrency: d().optional(),
|
|
389
|
+
deviceMemory: d().optional(),
|
|
390
|
+
platform: f().optional(),
|
|
391
|
+
connectionType: f().optional(),
|
|
392
|
+
connectionEffectiveType: f().optional(),
|
|
393
|
+
connectionDownlink: d().optional(),
|
|
394
|
+
connectionRtt: d().optional(),
|
|
395
|
+
saveData: u().optional(),
|
|
396
|
+
darkMode: u().optional(),
|
|
397
|
+
reducedMotion: u().optional(),
|
|
398
|
+
historyLength: d().optional(),
|
|
399
|
+
geolocationLatitude: d().optional(),
|
|
400
|
+
geolocationLongitude: d().optional(),
|
|
401
|
+
geolocationAccuracy: d().optional(),
|
|
402
|
+
geolocationCity: f().optional()
|
|
403
|
+
}), Ie = r("type", [c({
|
|
404
|
+
type: i("text"),
|
|
405
|
+
text: f()
|
|
406
|
+
}), c({
|
|
407
|
+
type: i("file"),
|
|
408
|
+
mediaType: f().regex(ne),
|
|
409
|
+
url: p(),
|
|
410
|
+
filename: f().optional(),
|
|
411
|
+
providerMetadata: a(f(), a(f(), n())).optional()
|
|
409
412
|
})]);
|
|
410
|
-
|
|
411
|
-
id:
|
|
412
|
-
messages:
|
|
413
|
-
id:
|
|
414
|
-
role:
|
|
415
|
-
content:
|
|
416
|
-
parts:
|
|
417
|
-
createdAt:
|
|
413
|
+
c({
|
|
414
|
+
id: f(),
|
|
415
|
+
messages: t(c({
|
|
416
|
+
id: f().optional(),
|
|
417
|
+
role: l(["assistant", "user"]),
|
|
418
|
+
content: f(),
|
|
419
|
+
parts: t(Ie),
|
|
420
|
+
createdAt: f().optional()
|
|
418
421
|
})),
|
|
419
|
-
model:
|
|
420
|
-
temperature:
|
|
421
|
-
prompt:
|
|
422
|
-
maxOutputTokens:
|
|
423
|
-
presencePenalty:
|
|
424
|
-
frequencyPenalty:
|
|
425
|
-
searchMode:
|
|
426
|
-
limit:
|
|
422
|
+
model: f().optional(),
|
|
423
|
+
temperature: d().optional(),
|
|
424
|
+
prompt: f().optional(),
|
|
425
|
+
maxOutputTokens: d().positive().optional(),
|
|
426
|
+
presencePenalty: d().min(-2).max(2).optional(),
|
|
427
|
+
frequencyPenalty: d().min(-2).max(2).optional(),
|
|
428
|
+
searchMode: l(x).optional(),
|
|
429
|
+
limit: d().optional(),
|
|
427
430
|
ranking: O.optional(),
|
|
428
431
|
reasoning: S,
|
|
429
432
|
webSearch: E.optional(),
|
|
430
|
-
maxStepCount:
|
|
431
|
-
disabledTools:
|
|
432
|
-
fallbackModels:
|
|
433
|
+
maxStepCount: d().int().min(1).max(40).optional(),
|
|
434
|
+
disabledTools: t(l(C)).optional(),
|
|
435
|
+
fallbackModels: t(f()).optional(),
|
|
433
436
|
gatewayOptions: I.partial().optional(),
|
|
434
|
-
deviceContext:
|
|
435
|
-
externalContext:
|
|
436
|
-
smoothStream:
|
|
437
|
+
deviceContext: Fe.optional(),
|
|
438
|
+
externalContext: a(f(), n()).optional(),
|
|
439
|
+
smoothStream: u().optional()
|
|
437
440
|
});
|
|
438
|
-
var
|
|
441
|
+
var Le = /* @__PURE__ */ function(e) {
|
|
439
442
|
return e.SevereAbuse = "severe_abuse", e.HighRiskScore = "high_risk_score", e.RepeatedWarnings = "repeated_warnings", e;
|
|
440
|
-
}({}),
|
|
441
|
-
id:
|
|
442
|
-
messages:
|
|
443
|
-
title:
|
|
444
|
-
summary:
|
|
445
|
-
messageCountAtLastSummary:
|
|
446
|
-
createdAt:
|
|
447
|
-
updatedAt:
|
|
448
|
-
metadata:
|
|
449
|
-
totalCostInUSD:
|
|
450
|
-
usage:
|
|
451
|
-
agentId:
|
|
452
|
-
userId:
|
|
453
|
-
organizationId:
|
|
454
|
-
deleted:
|
|
455
|
-
deletedAt:
|
|
456
|
-
deletedBy:
|
|
457
|
-
conversationAnalysis:
|
|
458
|
-
blocked:
|
|
459
|
-
blockedAt:
|
|
460
|
-
blockedReasonCode:
|
|
461
|
-
blockedReason:
|
|
462
|
-
warningCount:
|
|
463
|
-
lastMessageAt:
|
|
443
|
+
}({}), Re = c({
|
|
444
|
+
id: f(),
|
|
445
|
+
messages: t(n()),
|
|
446
|
+
title: f().nullable(),
|
|
447
|
+
summary: f().nullable(),
|
|
448
|
+
messageCountAtLastSummary: f().nullable(),
|
|
449
|
+
createdAt: m(),
|
|
450
|
+
updatedAt: m(),
|
|
451
|
+
metadata: a(f(), n()),
|
|
452
|
+
totalCostInUSD: f(),
|
|
453
|
+
usage: n(),
|
|
454
|
+
agentId: f().nullable(),
|
|
455
|
+
userId: f(),
|
|
456
|
+
organizationId: f(),
|
|
457
|
+
deleted: u(),
|
|
458
|
+
deletedAt: m().nullable(),
|
|
459
|
+
deletedBy: f().nullable(),
|
|
460
|
+
conversationAnalysis: Pe.nullable().optional(),
|
|
461
|
+
blocked: u(),
|
|
462
|
+
blockedAt: m().nullable(),
|
|
463
|
+
blockedReasonCode: l(Le).nullable(),
|
|
464
|
+
blockedReason: f().nullable(),
|
|
465
|
+
warningCount: d(),
|
|
466
|
+
lastMessageAt: m()
|
|
464
467
|
});
|
|
465
|
-
|
|
468
|
+
c({
|
|
466
469
|
...h.pagination(),
|
|
467
470
|
...h.sort([
|
|
468
471
|
"updatedAt",
|
|
@@ -473,21 +476,21 @@ s({
|
|
|
473
476
|
...h.range("updatedAt"),
|
|
474
477
|
...h.range("lastMessageAt"),
|
|
475
478
|
...h.ids(),
|
|
476
|
-
startDate:
|
|
477
|
-
endDate:
|
|
479
|
+
startDate: f().optional(),
|
|
480
|
+
endDate: f().optional()
|
|
478
481
|
});
|
|
479
|
-
var
|
|
480
|
-
id:
|
|
481
|
-
agentId:
|
|
482
|
-
organizationId:
|
|
483
|
-
summary:
|
|
484
|
-
title:
|
|
485
|
-
userId:
|
|
486
|
-
createdAt:
|
|
487
|
-
updatedAt:
|
|
488
|
-
lastMessageAt:
|
|
489
|
-
messages:
|
|
490
|
-
blocked:
|
|
482
|
+
var ze = c({
|
|
483
|
+
id: f(),
|
|
484
|
+
agentId: f().optional(),
|
|
485
|
+
organizationId: f(),
|
|
486
|
+
summary: f().optional(),
|
|
487
|
+
title: f().optional(),
|
|
488
|
+
userId: f(),
|
|
489
|
+
createdAt: m(),
|
|
490
|
+
updatedAt: m(),
|
|
491
|
+
lastMessageAt: m(),
|
|
492
|
+
messages: t(n()),
|
|
493
|
+
blocked: u()
|
|
491
494
|
}), U = class {
|
|
492
495
|
constructor(e, t) {
|
|
493
496
|
this.operator = e, this.value = t, Object.defineProperty(this, "_notes", { writable: !0 });
|
|
@@ -503,13 +506,13 @@ var Re = s({
|
|
|
503
506
|
if (!Array.isArray(t)) throw Error(`"${e}" operator expects to receive an array of conditions`);
|
|
504
507
|
super(e, t);
|
|
505
508
|
}
|
|
506
|
-
},
|
|
509
|
+
}, Be = "__itself__", K = class extends U {
|
|
507
510
|
constructor(e, t, n) {
|
|
508
511
|
super(e, n), this.field = t;
|
|
509
512
|
}
|
|
510
|
-
},
|
|
513
|
+
}, Ve = new W("__null__", null);
|
|
511
514
|
Object.hasOwn;
|
|
512
|
-
function
|
|
515
|
+
function He(e, t) {
|
|
513
516
|
let n;
|
|
514
517
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
515
518
|
let i = t[r];
|
|
@@ -526,69 +529,69 @@ function Ve(e, t) {
|
|
|
526
529
|
}
|
|
527
530
|
return n || t;
|
|
528
531
|
}
|
|
529
|
-
function
|
|
532
|
+
function Ue(e, t) {
|
|
530
533
|
if (t.length === 1) return t[0];
|
|
531
534
|
if (t.length === 0) return new G(e, t);
|
|
532
|
-
let n =
|
|
535
|
+
let n = He(e, t);
|
|
533
536
|
return n.length === 1 ? n[0] : (n.length, new G(e, n));
|
|
534
537
|
}
|
|
535
538
|
Object.defineProperty(Object.create(null), "__@type@__", { value: "ignore value" });
|
|
536
539
|
//#endregion
|
|
537
540
|
//#region ../../node_modules/.pnpm/@ucast+mongo@3.0.0/node_modules/@ucast/mongo/dist/esm/index.mjs
|
|
538
|
-
var
|
|
541
|
+
var We = Object.defineProperty;
|
|
539
542
|
((e, t) => {
|
|
540
543
|
let n = {};
|
|
541
|
-
for (var r in e)
|
|
544
|
+
for (var r in e) We(n, r, {
|
|
542
545
|
get: e[r],
|
|
543
546
|
enumerable: !0
|
|
544
547
|
});
|
|
545
|
-
return t ||
|
|
548
|
+
return t || We(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
546
549
|
})({
|
|
547
|
-
$all: () =>
|
|
548
|
-
$and: () =>
|
|
549
|
-
$elemMatch: () =>
|
|
550
|
-
$eq: () =>
|
|
551
|
-
$exists: () =>
|
|
552
|
-
$gt: () =>
|
|
553
|
-
$gte: () =>
|
|
554
|
-
$in: () =>
|
|
555
|
-
$lt: () =>
|
|
556
|
-
$lte: () =>
|
|
557
|
-
$mod: () =>
|
|
558
|
-
$ne: () =>
|
|
559
|
-
$nin: () =>
|
|
560
|
-
$nor: () =>
|
|
561
|
-
$not: () =>
|
|
562
|
-
$options: () =>
|
|
563
|
-
$or: () =>
|
|
564
|
-
$regex: () =>
|
|
565
|
-
$size: () =>
|
|
566
|
-
$where: () =>
|
|
550
|
+
$all: () => $e,
|
|
551
|
+
$and: () => Ge,
|
|
552
|
+
$elemMatch: () => Xe,
|
|
553
|
+
$eq: () => at,
|
|
554
|
+
$exists: () => tt,
|
|
555
|
+
$gt: () => J,
|
|
556
|
+
$gte: () => nt,
|
|
557
|
+
$in: () => q,
|
|
558
|
+
$lt: () => rt,
|
|
559
|
+
$lte: () => it,
|
|
560
|
+
$mod: () => et,
|
|
561
|
+
$ne: () => ot,
|
|
562
|
+
$nin: () => Qe,
|
|
563
|
+
$nor: () => qe,
|
|
564
|
+
$not: () => Ye,
|
|
565
|
+
$options: () => ct,
|
|
566
|
+
$or: () => Ke,
|
|
567
|
+
$regex: () => st,
|
|
568
|
+
$size: () => Ze,
|
|
569
|
+
$where: () => lt
|
|
567
570
|
});
|
|
568
|
-
var
|
|
571
|
+
var Ge = {
|
|
569
572
|
type: "compound",
|
|
570
|
-
validate:
|
|
573
|
+
validate: dt,
|
|
571
574
|
parse(e, t, n) {
|
|
572
|
-
let r =
|
|
573
|
-
return
|
|
575
|
+
let r = Je(e, t, n);
|
|
576
|
+
return Ue(e.name, r);
|
|
574
577
|
}
|
|
575
|
-
},
|
|
578
|
+
}, Ke = Ge, qe = {
|
|
576
579
|
type: "compound",
|
|
577
|
-
validate:
|
|
580
|
+
validate: dt,
|
|
578
581
|
parse(e, t, n) {
|
|
579
|
-
let r =
|
|
582
|
+
let r = Je(e, t, n);
|
|
580
583
|
return new G(e.name, r);
|
|
581
584
|
}
|
|
582
585
|
};
|
|
583
|
-
function
|
|
586
|
+
function Je(e, t, n) {
|
|
584
587
|
let r = Array(t.length);
|
|
585
588
|
for (let i = 0; i < t.length; i++) {
|
|
586
589
|
let a = t[i];
|
|
587
|
-
|
|
590
|
+
pt(e, a, i), r[i] = n.parse(a);
|
|
588
591
|
}
|
|
589
592
|
return r;
|
|
590
593
|
}
|
|
591
|
-
var
|
|
594
|
+
var Ye = {
|
|
592
595
|
type: "field",
|
|
593
596
|
validate(e, t) {
|
|
594
597
|
if (!(t && (t instanceof RegExp || t.constructor === Object))) throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`);
|
|
@@ -597,33 +600,33 @@ var qe = {
|
|
|
597
600
|
let r = t instanceof RegExp ? new K("regex", n.field, t) : n.parse(t, n);
|
|
598
601
|
return new G(e.name, [r]);
|
|
599
602
|
}
|
|
600
|
-
},
|
|
603
|
+
}, Xe = {
|
|
601
604
|
type: "field",
|
|
602
605
|
validate(e, t) {
|
|
603
606
|
if (!t || t.constructor !== Object) throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`);
|
|
604
607
|
},
|
|
605
608
|
parse(e, t, { parse: n, field: r, hasOperators: i }) {
|
|
606
|
-
let a = i(t) ? n(t, { field:
|
|
609
|
+
let a = i(t) ? n(t, { field: Be }) : n(t);
|
|
607
610
|
return new K(e.name, r, a);
|
|
608
611
|
}
|
|
609
|
-
},
|
|
612
|
+
}, Ze = {
|
|
610
613
|
type: "field",
|
|
611
|
-
validate:
|
|
612
|
-
},
|
|
614
|
+
validate: Y("number")
|
|
615
|
+
}, q = {
|
|
613
616
|
type: "field",
|
|
614
|
-
validate:
|
|
615
|
-
},
|
|
617
|
+
validate: ut
|
|
618
|
+
}, Qe = q, $e = q, et = {
|
|
616
619
|
type: "field",
|
|
617
620
|
validate(e, t) {
|
|
618
621
|
if (!Array.isArray(t) || t.length !== 2) throw Error(`"${e.name}" expects an array with 2 numeric elements`);
|
|
619
622
|
}
|
|
620
|
-
},
|
|
623
|
+
}, tt = {
|
|
621
624
|
type: "field",
|
|
622
|
-
validate:
|
|
623
|
-
},
|
|
625
|
+
validate: Y("boolean")
|
|
626
|
+
}, nt = {
|
|
624
627
|
type: "field",
|
|
625
|
-
validate:
|
|
626
|
-
},
|
|
628
|
+
validate: ft
|
|
629
|
+
}, J = nt, rt = J, it = J, at = { type: "field" }, ot = at, st = {
|
|
627
630
|
type: "field",
|
|
628
631
|
validate(e, t) {
|
|
629
632
|
if (!(t instanceof RegExp) && typeof t != "string") throw Error(`"${e.name}" expects value to be a regular expression or a string that represents regular expression`);
|
|
@@ -632,38 +635,38 @@ var qe = {
|
|
|
632
635
|
let r = typeof t == "string" ? new RegExp(t, n.query.$options || "") : t;
|
|
633
636
|
return new K(e.name, n.field, r);
|
|
634
637
|
}
|
|
635
|
-
},
|
|
638
|
+
}, ct = {
|
|
636
639
|
type: "field",
|
|
637
|
-
parse: () =>
|
|
638
|
-
},
|
|
640
|
+
parse: () => Ve
|
|
641
|
+
}, lt = {
|
|
639
642
|
type: "document",
|
|
640
|
-
validate:
|
|
643
|
+
validate: Y("function")
|
|
641
644
|
};
|
|
642
|
-
function
|
|
645
|
+
function ut(e, t) {
|
|
643
646
|
if (!Array.isArray(t)) throw Error(`"${e.name}" expects value to be an array`);
|
|
644
647
|
}
|
|
645
|
-
function
|
|
646
|
-
if (
|
|
648
|
+
function dt(e, t) {
|
|
649
|
+
if (ut(e, t), !t.length) throw Error(`"${e.name}" expects to have at least one element in array`);
|
|
647
650
|
}
|
|
648
|
-
function
|
|
651
|
+
function ft(e, t) {
|
|
649
652
|
if (!(typeof t == "string" || typeof t == "number" || t instanceof Date)) throw Error(`"${e.name}" expects value to be comparable (i.e., string, number or date)`);
|
|
650
653
|
}
|
|
651
|
-
function
|
|
654
|
+
function Y(e) {
|
|
652
655
|
return (t, n) => {
|
|
653
656
|
if (typeof n !== e) throw Error(`"${t.name}" expects value to be a "${e}"`);
|
|
654
657
|
};
|
|
655
658
|
}
|
|
656
|
-
function
|
|
659
|
+
function pt(e, t, n) {
|
|
657
660
|
let r = t;
|
|
658
661
|
if (!r || r.constructor !== Object) throw Error(`"${e.name}" expects item at index ${n} to be an object`);
|
|
659
662
|
}
|
|
660
663
|
//#endregion
|
|
661
664
|
//#region ../../packages/ability/src/types.ts
|
|
662
|
-
var
|
|
665
|
+
var X = /* @__PURE__ */ function(e) {
|
|
663
666
|
return e.Backoffice = "backoffice", e.Frontoffice = "frontoffice", e.System = "system", e.Public = "public", e;
|
|
664
667
|
}({}), Z = /* @__PURE__ */ function(e) {
|
|
665
668
|
return e.All = "all", e.Todo = "todo", e.User = "user", e.Chat = "chat", e.Agent = "agent", e.SubAgent = "subAgent", e.Document = "document", e.AgentDocument = "agent_document", e.AgentAnalytic = "agent_analytic", e.McpServer = "mcp_server", e.Media = "media", e.RevisedAnswer = "revised_answer", e.Organization = "organization", e.Member = "member", e.Lead = "lead", e.MessageFeedback = "message_feedback", e.Backoffice = "backoffice", e.Frontoffice = "frontoffice", e.System = "system", e.Invitation = "invitation", e.Crawler = "crawler", e.ReasoningChat = "reasoning_chat", e.TimeTrackerChat = "time_tracker_chat", e.OrganizationExternalAuth = "organization_external_auth", e.AgentEndpoint = "agent_endpoint", e.AgentEndpointLog = "agent_endpoint_log", e.AgentApiTool = "agent_api_tool", e.DocumentFolder = "document_folder", e.Integration = "integration", e.Notification = "notification", e;
|
|
666
|
-
}({}),
|
|
669
|
+
}({}), mt = (e) => e ? [
|
|
667
670
|
{
|
|
668
671
|
subject: Z.Chat,
|
|
669
672
|
action: "create"
|
|
@@ -695,27 +698,27 @@ var ft = /* @__PURE__ */ function(e) {
|
|
|
695
698
|
action: "read",
|
|
696
699
|
condition: { createdBy: { $eq: e.user?.id } }
|
|
697
700
|
}
|
|
698
|
-
] : [],
|
|
701
|
+
] : [], ht = ce({ modify: [
|
|
699
702
|
"read",
|
|
700
703
|
"update",
|
|
701
704
|
"delete"
|
|
702
|
-
] }),
|
|
703
|
-
new
|
|
704
|
-
conditionsMatcher:
|
|
705
|
-
resolveAction:
|
|
705
|
+
] }), gt = se({ $or: Ke });
|
|
706
|
+
new oe(mt(), {
|
|
707
|
+
conditionsMatcher: gt,
|
|
708
|
+
resolveAction: ht,
|
|
706
709
|
fieldMatcher: (e) => (t) => e.includes(t)
|
|
707
710
|
});
|
|
708
|
-
var Q =
|
|
709
|
-
Q.newRole(
|
|
711
|
+
var Q = le(de);
|
|
712
|
+
Q.newRole(ue.statements), Q.newRole(fe.statements), Q.newRole(_.statements), Q.newRole(_.statements);
|
|
710
713
|
//#endregion
|
|
711
714
|
//#region ../../packages/composable/src/chatbot/api/createChatbotApiClient.ts
|
|
712
|
-
var
|
|
715
|
+
var _t = Re.or(ze);
|
|
713
716
|
function $(e) {
|
|
714
|
-
let t =
|
|
717
|
+
let t = _t.safeParse(e);
|
|
715
718
|
return t.success ? t.data : e;
|
|
716
719
|
}
|
|
717
|
-
function
|
|
718
|
-
let t = e.basePath ?
|
|
720
|
+
function vt(e) {
|
|
721
|
+
let t = e.basePath ? ae(e.basePath) : `/api/v1/${X.Public}`, n = `${g(e.baseUrl)}${t}`;
|
|
719
722
|
async function r(t, r, i = "json") {
|
|
720
723
|
let a = await fetch(`${n}${t}`, {
|
|
721
724
|
credentials: e.credentials ?? "include",
|
|
@@ -853,6 +856,6 @@ function _t(e) {
|
|
|
853
856
|
};
|
|
854
857
|
}
|
|
855
858
|
//#endregion
|
|
856
|
-
export { F as a, A as c,
|
|
859
|
+
export { F as a, A as c, ve as d, M as i, T as l, X as n, j as o, C as r, b as s, vt as t, ye as u };
|
|
857
860
|
|
|
858
|
-
//# sourceMappingURL=createChatbotApiClient-
|
|
861
|
+
//# sourceMappingURL=createChatbotApiClient-DWRtOu7t.js.map
|