@8wave/ai-elements 0.100.0 → 0.101.0-beta.2
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 +1590 -1556
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.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-OT6Vj9xn.js +264 -0
- package/dist-vue/_chunks/PkChatbot-OT6Vj9xn.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotMessages-Cj974POl.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-glcxrv5f.js → PkChatbotViewChat-BhwV8BzI.js} +2 -2
- package/dist-vue/_chunks/PkChatbotViewChat-BhwV8BzI.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-CNZuX3Rl.js → PkChatbotViewConversations-EuLSiakV.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-CNZuX3Rl.js.map → PkChatbotViewConversations-EuLSiakV.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-CyBqTzjY.js → PkChatbotViewFiles-CIr-0xpK.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-CyBqTzjY.js.map → PkChatbotViewFiles-CIr-0xpK.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-BCPCO6mp.js → PkChatbotViewProfile-CIO0mBFM.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-BCPCO6mp.js.map → PkChatbotViewProfile-CIO0mBFM.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BGkXm2NB.js → createChatbotApiClient-2iaBCziJ.js} +362 -346
- package/dist-vue/_chunks/createChatbotApiClient-2iaBCziJ.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-D9b5Fz-e.js → useChatbotStore-BK1xv_i6.js} +2 -2
- package/dist-vue/_chunks/{useChatbotStore-D9b5Fz-e.js.map → useChatbotStore-BK1xv_i6.js.map} +1 -1
- package/dist-vue/_chunks/{useDialogConfirm-DaoekZdk.js → useDialogConfirm-CMTIKoWn.js} +12 -11
- package/dist-vue/_chunks/useDialogConfirm-CMTIKoWn.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +3 -3
- package/dist-vue/apps/web-component/src/lib.d.ts +3 -1
- package/dist-vue/composables.js +2 -2
- package/dist-vue/index.js +2875 -2861
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +2 -0
- package/dist-vue/packages/auth/src/index.d.ts +4 -4
- package/dist-vue/packages/components/src/chat/PkChatbot.d.ts +9 -9
- package/dist-vue/packages/components/src/chat/PkChatbotViewChat.d.ts +2 -2
- package/dist-vue/packages/composable/src/useDialog.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/Agent.d.ts +114 -5
- package/dist-vue/packages/models/src/schema/Chat.d.ts +7 -0
- package/dist-vue/packages/models/src/schema/OpenAiCompat.d.ts +192 -0
- package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +7 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/TimingLog.d.ts +153 -0
- package/dist-vue/packages/models/src/schema/UserOverview.d.ts +1 -1
- package/dist-vue/packages/models/src/schema/index.d.ts +2 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist-vue/_chunks/PkChatbot-bWzP1psN.js +0 -236
- package/dist-vue/_chunks/PkChatbot-bWzP1psN.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-glcxrv5f.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BGkXm2NB.js.map +0 -1
- package/dist-vue/_chunks/useDialogConfirm-DaoekZdk.js.map +0 -1
package/dist-vue/_chunks/{createChatbotApiClient-BGkXm2NB.js → createChatbotApiClient-2iaBCziJ.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as e, _ as t, a as n, b as r, d as i, f as a, g as o, h as s, i as
|
|
2
|
-
import { i as
|
|
3
|
-
import { a as
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, d as i, f as a, g as o, h as s, i as ee, l as c, n as l, o as u, v as d, x as f } from "./schemas-pShs5g_i.js";
|
|
2
|
+
import { i as p, n as te, t as ne } from "./Media-DCJ2pi6q.js";
|
|
3
|
+
import { a as m, o as re, r as ie, s as h } from "./constants-h4s5C7jp.js";
|
|
4
4
|
import "./src-8QXYVWIx.js";
|
|
5
5
|
import { r as g, t as ae } from "./url-validation-uLMZ5-AU.js";
|
|
6
6
|
import { Ability as oe, buildMongoQueryMatcher as se, createAliasResolver as ce } from "@casl/ability";
|
|
@@ -16,43 +16,43 @@ var v = /* @__PURE__ */ function(e) {
|
|
|
16
16
|
}({}), x = /* @__PURE__ */ function(e) {
|
|
17
17
|
return e.Semantic = "semantic", e.Balanced = "balanced", e.Keyword = "keyword", e;
|
|
18
18
|
}({}), pe = o({
|
|
19
|
-
reasoningEffort:
|
|
19
|
+
reasoningEffort: l([
|
|
20
20
|
"none",
|
|
21
21
|
"low",
|
|
22
22
|
"medium",
|
|
23
23
|
"high",
|
|
24
24
|
"xhigh"
|
|
25
25
|
]).optional(),
|
|
26
|
-
reasoningSummary:
|
|
26
|
+
reasoningSummary: l([
|
|
27
27
|
"auto",
|
|
28
28
|
"detailed",
|
|
29
29
|
"concise"
|
|
30
30
|
]).optional()
|
|
31
31
|
}), me = o({
|
|
32
|
-
type:
|
|
32
|
+
type: l([
|
|
33
33
|
"adaptive",
|
|
34
34
|
"enabled",
|
|
35
35
|
"disabled"
|
|
36
36
|
]).optional(),
|
|
37
|
-
effort:
|
|
37
|
+
effort: l([
|
|
38
38
|
"low",
|
|
39
39
|
"medium",
|
|
40
40
|
"high",
|
|
41
41
|
"xhigh",
|
|
42
42
|
"max"
|
|
43
43
|
]).optional(),
|
|
44
|
-
display:
|
|
44
|
+
display: l(["summarized", "omitted"]).optional(),
|
|
45
45
|
budgetTokens: s().int().positive().optional()
|
|
46
46
|
}), he = o({
|
|
47
|
-
thinkingLevel:
|
|
47
|
+
thinkingLevel: l([
|
|
48
48
|
"minimal",
|
|
49
49
|
"low",
|
|
50
50
|
"medium",
|
|
51
51
|
"high"
|
|
52
52
|
]).optional(),
|
|
53
53
|
thinkingBudget: s().int().optional(),
|
|
54
|
-
includeThoughts:
|
|
55
|
-
}), ge = o({ type:
|
|
54
|
+
includeThoughts: u().optional()
|
|
55
|
+
}), ge = o({ type: l(["enabled", "disabled"]).optional() }), _e = o({
|
|
56
56
|
openai: pe.optional(),
|
|
57
57
|
anthropic: me.optional(),
|
|
58
58
|
google: he.optional(),
|
|
@@ -69,167 +69,182 @@ function ve(e) {
|
|
|
69
69
|
}, r.anthropic = {
|
|
70
70
|
type: "adaptive",
|
|
71
71
|
effort: e
|
|
72
|
-
}, r.google = { thinkingLevel: e }, r.deepseek = { type: "enabled" }) : (r.openai = { reasoningEffort: "none" }, r.deepseek = { type: "disabled" }), r;
|
|
72
|
+
}, r.google = { thinkingLevel: e }, r.deepseek = { type: "enabled" }) : (r.openai = { reasoningEffort: "none" }, r.anthropic = { type: "disabled" }, r.google = { thinkingLevel: "minimal" }, r.deepseek = { type: "disabled" }), r;
|
|
73
73
|
}
|
|
74
74
|
return e;
|
|
75
75
|
}
|
|
76
|
-
var
|
|
76
|
+
var ye = m(r(), _e, ve).optional(), be = {
|
|
77
|
+
openai: { reasoningEffort: "low" },
|
|
78
|
+
anthropic: {
|
|
79
|
+
type: "adaptive",
|
|
80
|
+
effort: "low"
|
|
81
|
+
},
|
|
82
|
+
google: { thinkingLevel: "low" }
|
|
83
|
+
};
|
|
84
|
+
function xe(e) {
|
|
85
|
+
return !!e && typeof e == "object" && Object.values(e).some((e) => e !== void 0);
|
|
86
|
+
}
|
|
87
|
+
function Se(e, t) {
|
|
88
|
+
let n = t?.[e];
|
|
89
|
+
return xe(n) ? n : be[e];
|
|
90
|
+
}
|
|
91
|
+
var S = /* @__PURE__ */ function(e) {
|
|
77
92
|
return e.Geocode = "geocode", e.GetWeather = "getWeather", e.ReadDocumentFile = "readDocumentFile", e.RequestConfirm = "requestConfirm", e.RequestGeolocation = "requestGeolocation", e.RetrieveRevisedAnswers = "retrieveRevisedAnswers", e.SearchInKnowledgeBase = "searchInKnowledgeBase", e.SearchInUserFiles = "searchInUserFiles", e.UserMemory = "userMemory", e.RunWorker = "runWorker", e.FetchTeamsChannelHistory = "fetchTeamsChannelHistory", 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.ShowVideo = "showVideo", e.ShowWeather = "showWeather", e.ShowWebPages = "showWebPages", e.ShowMultipleChoice = "showMultipleChoice", e;
|
|
78
93
|
}({});
|
|
79
|
-
function
|
|
80
|
-
return !
|
|
94
|
+
function Ce(e) {
|
|
95
|
+
return !C(e) && e !== S.RequestGeolocation;
|
|
81
96
|
}
|
|
82
|
-
function
|
|
83
|
-
return e ===
|
|
97
|
+
function C(e) {
|
|
98
|
+
return e === S.RequestConfirm || e === S.ShowArtifact || e === S.ShowCalendarEvent || e === S.ShowComparison || e === S.ShowContactForm || e === S.ShowDiagram || e === S.ShowEmail || e === S.ShowImageGallery || e === S.ShowLocation || e === S.ShowMessage || e === S.ShowForm || e === S.ShowMultipleChoice || e === S.ShowProductList || e === S.ShowQrCode || e === S.ShowSources || e === S.ShowSuggestedReply || e === S.ShowVideo || e === S.ShowWeather || e === S.ShowWebPages;
|
|
84
99
|
}
|
|
85
|
-
var
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
var we = /* @__PURE__ */ new Set([
|
|
101
|
+
S.RequestConfirm,
|
|
102
|
+
S.ShowArtifact,
|
|
103
|
+
S.ShowWeather,
|
|
104
|
+
S.ShowLocation,
|
|
105
|
+
S.ShowComparison,
|
|
106
|
+
S.ShowProductList,
|
|
107
|
+
S.ShowWebPages,
|
|
108
|
+
S.ShowImageGallery,
|
|
109
|
+
S.ShowVideo,
|
|
110
|
+
S.ShowSources,
|
|
111
|
+
S.ShowSuggestedReply,
|
|
112
|
+
S.ShowCalendarEvent,
|
|
113
|
+
S.ShowEmail,
|
|
114
|
+
S.ShowMessage,
|
|
115
|
+
S.ShowForm
|
|
101
116
|
]);
|
|
102
|
-
function
|
|
103
|
-
return
|
|
117
|
+
function Te(e) {
|
|
118
|
+
return we.has(e);
|
|
104
119
|
}
|
|
105
|
-
var
|
|
120
|
+
var w = o({
|
|
106
121
|
maxSteps: s().int().min(1).max(10).optional().default(5),
|
|
107
122
|
maxOptionsPerStep: s().int().min(2).max(10).optional().default(5)
|
|
108
|
-
}),
|
|
123
|
+
}), T = o({ mode: l(["optional", "required"]).optional().default("optional") }), E = o({ mode: l(["optional", "required"]).optional().default("required") }), D = /* @__PURE__ */ function(e) {
|
|
109
124
|
return e.Perplexity = "perplexity", e.Parallel = "parallel", e.Native = "native", e;
|
|
110
|
-
}({}),
|
|
125
|
+
}({}), Ee = o({
|
|
111
126
|
maxResults: s().int().min(1).max(20).optional(),
|
|
112
127
|
maxTokens: s().int().positive().max(1e6).optional(),
|
|
113
128
|
maxTokensPerPage: s().int().positive().optional(),
|
|
114
|
-
country:
|
|
115
|
-
searchLanguageFilter: n(
|
|
116
|
-
searchDomainFilter: n(
|
|
117
|
-
searchRecencyFilter:
|
|
129
|
+
country: d().max(2).optional(),
|
|
130
|
+
searchLanguageFilter: n(d().max(5)).max(10).optional(),
|
|
131
|
+
searchDomainFilter: n(d()).max(20).optional(),
|
|
132
|
+
searchRecencyFilter: l([
|
|
118
133
|
"day",
|
|
119
134
|
"week",
|
|
120
135
|
"month",
|
|
121
136
|
"year"
|
|
122
137
|
]).optional()
|
|
123
|
-
}),
|
|
124
|
-
mode:
|
|
138
|
+
}), De = o({
|
|
139
|
+
mode: l(["one-shot", "agentic"]).optional(),
|
|
125
140
|
maxResults: s().int().min(1).max(20).optional(),
|
|
126
141
|
sourcePolicy: o({
|
|
127
|
-
includeDomains: n(
|
|
128
|
-
excludeDomains: n(
|
|
129
|
-
afterDate:
|
|
142
|
+
includeDomains: n(d()).optional(),
|
|
143
|
+
excludeDomains: n(d()).optional(),
|
|
144
|
+
afterDate: d().optional()
|
|
130
145
|
}).optional(),
|
|
131
146
|
excerpts: o({
|
|
132
147
|
maxCharsPerResult: s().int().positive().optional(),
|
|
133
148
|
maxCharsTotal: s().int().positive().optional()
|
|
134
149
|
}).optional(),
|
|
135
150
|
fetchPolicy: o({ maxAgeSeconds: s().int().positive().optional() }).optional()
|
|
136
|
-
}),
|
|
151
|
+
}), Oe = o({
|
|
137
152
|
openai: o({}).optional(),
|
|
138
153
|
anthropic: o({
|
|
139
154
|
maxUses: s().int().positive().optional(),
|
|
140
|
-
allowedDomains: n(
|
|
141
|
-
blockedDomains: n(
|
|
155
|
+
allowedDomains: n(d()).optional(),
|
|
156
|
+
blockedDomains: n(d()).optional(),
|
|
142
157
|
userLocation: o({
|
|
143
158
|
type: a("approximate").optional(),
|
|
144
|
-
country:
|
|
145
|
-
region:
|
|
146
|
-
city:
|
|
147
|
-
timezone:
|
|
159
|
+
country: d().optional(),
|
|
160
|
+
region: d().optional(),
|
|
161
|
+
city: d().optional(),
|
|
162
|
+
timezone: d().optional()
|
|
148
163
|
}).optional()
|
|
149
164
|
}).optional(),
|
|
150
165
|
google: o({}).optional()
|
|
151
|
-
}),
|
|
152
|
-
enabled:
|
|
153
|
-
provider:
|
|
154
|
-
perplexity:
|
|
155
|
-
parallel:
|
|
156
|
-
native:
|
|
157
|
-
}),
|
|
158
|
-
disabled: n(
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
166
|
+
}), O = o({
|
|
167
|
+
enabled: u().default(!1),
|
|
168
|
+
provider: l(D).optional().default(D.Native),
|
|
169
|
+
perplexity: Ee.optional(),
|
|
170
|
+
parallel: De.optional(),
|
|
171
|
+
native: Oe.optional()
|
|
172
|
+
}), ke = o({ useAllUserKb: u().default(!1) }), Ae = o({ useAllUserFiles: u().default(!1) }), je = o({ tools: n(d()).default([]) }), k = o({
|
|
173
|
+
disabled: n(l(S)).default([
|
|
174
|
+
S.UserMemory,
|
|
175
|
+
S.SearchInUserFiles,
|
|
176
|
+
S.RunWorker,
|
|
177
|
+
S.FetchTeamsChannelHistory
|
|
163
178
|
]),
|
|
164
|
-
showForm:
|
|
165
|
-
suggestedReply:
|
|
166
|
-
showSources:
|
|
167
|
-
webSearch:
|
|
168
|
-
userMemory:
|
|
169
|
-
userFiles:
|
|
170
|
-
approval:
|
|
171
|
-
}),
|
|
179
|
+
showForm: w.optional().default(() => w.parse({})),
|
|
180
|
+
suggestedReply: T.optional().default(() => T.parse({})),
|
|
181
|
+
showSources: E.optional().default(() => E.parse({})),
|
|
182
|
+
webSearch: O.optional().default(() => O.parse({})),
|
|
183
|
+
userMemory: ke.optional().default(() => ke.parse({})),
|
|
184
|
+
userFiles: Ae.optional().default(() => Ae.parse({})),
|
|
185
|
+
approval: je.optional().default(() => je.parse({}))
|
|
186
|
+
}), A = o({
|
|
172
187
|
freshness: o({
|
|
173
|
-
enabled:
|
|
188
|
+
enabled: u().default(!1),
|
|
174
189
|
scale: s().int().min(86400).max(31536e3).default(7776e3),
|
|
175
190
|
weight: s().min(.05).max(.5).default(.1)
|
|
176
191
|
}).prefault({}),
|
|
177
|
-
priority: o({ enabled:
|
|
192
|
+
priority: o({ enabled: u().default(!0) }).prefault({}),
|
|
178
193
|
mmr: o({
|
|
179
|
-
enabled:
|
|
194
|
+
enabled: u().default(!1),
|
|
180
195
|
diversity: s().min(0).max(1).default(.3),
|
|
181
196
|
candidatesLimit: s().int().min(20).max(100).default(50)
|
|
182
197
|
}).prefault({})
|
|
183
|
-
}).prefault({}),
|
|
184
|
-
prompt:
|
|
198
|
+
}).prefault({}), Me = o({
|
|
199
|
+
prompt: d().optional(),
|
|
185
200
|
temperature: s().min(0).max(2).optional().default(.6),
|
|
186
201
|
maxOutputTokens: s().positive().optional(),
|
|
187
202
|
presencePenalty: s().min(-2).max(2).optional(),
|
|
188
203
|
frequencyPenalty: s().min(-2).max(2).optional(),
|
|
189
|
-
searchMode:
|
|
204
|
+
searchMode: l(x).optional().default(x.Balanced),
|
|
190
205
|
limit: s().positive().max(100).optional().default(10),
|
|
191
206
|
maxStepCount: s().int().min(1).max(40).optional().default(10),
|
|
192
|
-
reasoning:
|
|
193
|
-
ranking:
|
|
194
|
-
}),
|
|
207
|
+
reasoning: ye,
|
|
208
|
+
ranking: A.optional().default(() => A.parse({}))
|
|
209
|
+
}), j = m(r(), t(d(), d()), (e) => typeof e == "string" ? { it: e } : e), M = "https://cdn.jsdelivr.net/npm/@8wave/ai-elements/dist/ai-elements.es.js", N = /* @__PURE__ */ function(e) {
|
|
195
210
|
return e.InlineModule = "inline-module", e.ScriptSrc = "script-src", e.DynamicImport = "dynamic-import", e;
|
|
196
|
-
}({}),
|
|
211
|
+
}({}), P = /* @__PURE__ */ function(e) {
|
|
197
212
|
return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
|
|
198
|
-
}({}),
|
|
199
|
-
media:
|
|
200
|
-
logo:
|
|
201
|
-
theme:
|
|
213
|
+
}({}), F = Object.values(P), I = o({
|
|
214
|
+
media: te.optional(),
|
|
215
|
+
logo: d().optional(),
|
|
216
|
+
theme: l([
|
|
202
217
|
"light",
|
|
203
218
|
"dark",
|
|
204
219
|
"auto"
|
|
205
220
|
]).optional().default("auto"),
|
|
206
|
-
mainColor:
|
|
207
|
-
textColor:
|
|
221
|
+
mainColor: d().regex(/^#[0-9A-Fa-f]{6}$/).optional().default("#000000"),
|
|
222
|
+
textColor: l([
|
|
208
223
|
"auto",
|
|
209
224
|
"white",
|
|
210
225
|
"black"
|
|
211
226
|
]).optional().default("auto"),
|
|
212
|
-
useColorsForAgentHeader:
|
|
213
|
-
initialMessage:
|
|
214
|
-
greeting: n(
|
|
215
|
-
messagePlaceholder:
|
|
216
|
-
dismissableNotice:
|
|
217
|
-
footerMessage:
|
|
218
|
-
privacyPolicyNotice:
|
|
219
|
-
interactiveLogin:
|
|
220
|
-
welcomePopup:
|
|
221
|
-
floatingButtonPosition:
|
|
227
|
+
useColorsForAgentHeader: u().optional().default(!1),
|
|
228
|
+
initialMessage: j.optional(),
|
|
229
|
+
greeting: n(j).min(1).max(10).optional(),
|
|
230
|
+
messagePlaceholder: j.optional(),
|
|
231
|
+
dismissableNotice: j.optional(),
|
|
232
|
+
footerMessage: j.optional(),
|
|
233
|
+
privacyPolicyNotice: j.optional(),
|
|
234
|
+
interactiveLogin: u().optional().default(!0),
|
|
235
|
+
welcomePopup: u().optional().default(!1),
|
|
236
|
+
floatingButtonPosition: l(["left", "right"]).optional().default("right"),
|
|
222
237
|
maxMessageLength: s().int().positive().optional(),
|
|
223
|
-
widgetUrl:
|
|
238
|
+
widgetUrl: f().default(M),
|
|
224
239
|
loadDelay: s().int().min(0).max(3e4).optional().default(0),
|
|
225
|
-
loaderStrategy:
|
|
226
|
-
customCss:
|
|
227
|
-
smoothStream:
|
|
228
|
-
showExtendedSteps:
|
|
229
|
-
}),
|
|
230
|
-
enabled:
|
|
240
|
+
loaderStrategy: l(N).optional().default(N.InlineModule),
|
|
241
|
+
customCss: d().optional(),
|
|
242
|
+
smoothStream: u().optional().default(!1),
|
|
243
|
+
showExtendedSteps: u().optional().default(!1)
|
|
244
|
+
}), L = o({
|
|
245
|
+
enabled: u().default(!1),
|
|
231
246
|
maxFileSizeBytes: s().int().positive().max(104857600).optional().default(20971520),
|
|
232
|
-
allowedMimeTypes: n(
|
|
247
|
+
allowedMimeTypes: n(d().regex(ne)).optional().default([
|
|
233
248
|
"image/jpeg",
|
|
234
249
|
"image/png",
|
|
235
250
|
"image/gif",
|
|
@@ -241,97 +256,98 @@ var T = o({
|
|
|
241
256
|
]),
|
|
242
257
|
maxFilesPerMessage: s().int().positive().max(10).optional().default(5),
|
|
243
258
|
maxFilesPerChat: s().int().positive().max(50).optional().default(20)
|
|
244
|
-
}),
|
|
245
|
-
zeroDataRetention:
|
|
246
|
-
disallowPromptTraining:
|
|
259
|
+
}), R = o({
|
|
260
|
+
zeroDataRetention: u().default(!0),
|
|
261
|
+
disallowPromptTraining: u().default(!0),
|
|
247
262
|
providerTimeoutMs: s().int().min(1e3).max(789e3).optional()
|
|
248
|
-
}),
|
|
249
|
-
model:
|
|
250
|
-
interface:
|
|
251
|
-
tools:
|
|
252
|
-
fileUpload:
|
|
253
|
-
gatewayOptions:
|
|
254
|
-
channels: n(
|
|
255
|
-
externalContextSchema: re.optional()
|
|
256
|
-
|
|
263
|
+
}), z = o({ enabled: u().default(!1) }), B = o({
|
|
264
|
+
model: Me,
|
|
265
|
+
interface: I,
|
|
266
|
+
tools: k.optional().default(() => k.parse({})),
|
|
267
|
+
fileUpload: L.optional().default(() => L.parse({})),
|
|
268
|
+
gatewayOptions: R.optional().default(() => R.parse({})),
|
|
269
|
+
channels: n(l(P)).optional().default(() => [...F]),
|
|
270
|
+
externalContextSchema: re.optional(),
|
|
271
|
+
openaiApi: z.optional().default(() => z.parse({}))
|
|
272
|
+
}), V = o({
|
|
257
273
|
rateLimits: o({
|
|
258
274
|
minuteRateLimit: s().int().min(0).optional(),
|
|
259
275
|
hourRateLimit: s().int().min(0).optional(),
|
|
260
276
|
dayRateLimit: s().int().min(0).optional(),
|
|
261
277
|
monthRateLimit: s().int().min(0).optional()
|
|
262
278
|
}),
|
|
263
|
-
trustedOrigins: o({ origins: n(
|
|
279
|
+
trustedOrigins: o({ origins: n(f().or(a(""))).overwrite((e) => e?.filter((e) => e?.trim())).default([]) }).default({ origins: [] })
|
|
264
280
|
});
|
|
265
281
|
o({
|
|
266
|
-
id:
|
|
267
|
-
name:
|
|
268
|
-
prompt:
|
|
269
|
-
model:
|
|
270
|
-
fallbackModels: n(
|
|
271
|
-
status:
|
|
272
|
-
visibility:
|
|
273
|
-
settings:
|
|
274
|
-
security:
|
|
275
|
-
type:
|
|
276
|
-
organizationId:
|
|
282
|
+
id: d().optional(),
|
|
283
|
+
name: d(),
|
|
284
|
+
prompt: d().optional(),
|
|
285
|
+
model: d().default(ie.gpt52Chat),
|
|
286
|
+
fallbackModels: n(d()).default([]),
|
|
287
|
+
status: l(v).default(v.Draft),
|
|
288
|
+
visibility: l(y).default(y.Organization),
|
|
289
|
+
settings: B,
|
|
290
|
+
security: V.nullish(),
|
|
291
|
+
type: l(b).default(b.Chat),
|
|
292
|
+
organizationId: d()
|
|
277
293
|
}), i(() => o({
|
|
278
|
-
id:
|
|
279
|
-
name:
|
|
280
|
-
prompt:
|
|
281
|
-
model:
|
|
282
|
-
fallbackModels: n(
|
|
283
|
-
status:
|
|
284
|
-
visibility:
|
|
285
|
-
settings:
|
|
286
|
-
security:
|
|
287
|
-
type:
|
|
288
|
-
organizationId:
|
|
289
|
-
createdAt:
|
|
290
|
-
createdBy:
|
|
291
|
-
updatedAt:
|
|
292
|
-
updatedBy:
|
|
293
|
-
deleted:
|
|
294
|
-
deletedAt:
|
|
295
|
-
deletedBy:
|
|
296
|
-
outOfBudget:
|
|
297
|
-
outOfBudgetReason:
|
|
294
|
+
id: d(),
|
|
295
|
+
name: d(),
|
|
296
|
+
prompt: d(),
|
|
297
|
+
model: d(),
|
|
298
|
+
fallbackModels: n(d()).nullable().default([]),
|
|
299
|
+
status: l(v).default(v.Draft),
|
|
300
|
+
visibility: l(y).default(y.Organization),
|
|
301
|
+
settings: B,
|
|
302
|
+
security: V.nullable(),
|
|
303
|
+
type: l(b).default(b.Chat),
|
|
304
|
+
organizationId: d(),
|
|
305
|
+
createdAt: p(),
|
|
306
|
+
createdBy: d(),
|
|
307
|
+
updatedAt: p(),
|
|
308
|
+
updatedBy: d(),
|
|
309
|
+
deleted: u(),
|
|
310
|
+
deletedAt: p().nullable(),
|
|
311
|
+
deletedBy: d().nullable(),
|
|
312
|
+
outOfBudget: u().optional().default(!1),
|
|
313
|
+
outOfBudgetReason: d().optional().default("")
|
|
298
314
|
}));
|
|
299
|
-
var
|
|
300
|
-
id:
|
|
301
|
-
name:
|
|
302
|
-
status:
|
|
303
|
-
visibility:
|
|
304
|
-
organizationId:
|
|
305
|
-
interface:
|
|
306
|
-
createdAt:
|
|
307
|
-
updatedAt:
|
|
308
|
-
capabilities: o({ fileUpload:
|
|
309
|
-
channels: n(
|
|
310
|
-
}),
|
|
315
|
+
var H = o({
|
|
316
|
+
id: d(),
|
|
317
|
+
name: d(),
|
|
318
|
+
status: l(v),
|
|
319
|
+
visibility: l(y),
|
|
320
|
+
organizationId: d(),
|
|
321
|
+
interface: I,
|
|
322
|
+
createdAt: p(),
|
|
323
|
+
updatedAt: p(),
|
|
324
|
+
capabilities: o({ fileUpload: L }),
|
|
325
|
+
channels: n(l(P)).default(() => [...F])
|
|
326
|
+
}), Ne = I.pick({
|
|
311
327
|
logo: !0,
|
|
312
328
|
mainColor: !0,
|
|
313
329
|
textColor: !0,
|
|
314
330
|
theme: !0,
|
|
315
331
|
floatingButtonPosition: !0,
|
|
316
332
|
customCss: !0
|
|
317
|
-
}),
|
|
333
|
+
}), Pe = H.pick({
|
|
318
334
|
id: !0,
|
|
319
335
|
name: !0,
|
|
320
336
|
organizationId: !0
|
|
321
|
-
}).extend({ interface:
|
|
322
|
-
emailPassword:
|
|
323
|
-
google:
|
|
324
|
-
microsoft:
|
|
325
|
-
}), je = o({
|
|
326
|
-
requiresAuth: a(!1),
|
|
327
|
-
agent: De,
|
|
328
|
-
branding: c()
|
|
337
|
+
}).extend({ interface: Ne }), U = o({
|
|
338
|
+
emailPassword: u(),
|
|
339
|
+
google: u(),
|
|
340
|
+
microsoft: u()
|
|
329
341
|
}), W = o({
|
|
342
|
+
requiresAuth: a(!1),
|
|
343
|
+
agent: H,
|
|
344
|
+
branding: ee()
|
|
345
|
+
}), Fe = o({
|
|
330
346
|
requiresAuth: a(!0),
|
|
331
|
-
agent:
|
|
332
|
-
branding:
|
|
347
|
+
agent: ee(),
|
|
348
|
+
branding: Pe
|
|
333
349
|
});
|
|
334
|
-
|
|
350
|
+
c("requiresAuth", [W, Fe]), c("requiresAuth", [W.extend({ authMethods: U }), Fe.extend({ authMethods: U })]), o({
|
|
335
351
|
id: e(),
|
|
336
352
|
agentIds: n(e())
|
|
337
353
|
}), o({
|
|
@@ -353,49 +369,49 @@ l("requiresAuth", [je, W]), l("requiresAuth", [je.extend({ authMethods: Ae }), W
|
|
|
353
369
|
});
|
|
354
370
|
//#endregion
|
|
355
371
|
//#region ../../packages/models/src/schema/ConversationAnalysis.ts
|
|
356
|
-
var
|
|
372
|
+
var Ie = /* @__PURE__ */ function(e) {
|
|
357
373
|
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;
|
|
358
|
-
}({}),
|
|
374
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
359
375
|
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
360
|
-
}({}),
|
|
376
|
+
}({}), Re = /* @__PURE__ */ function(e) {
|
|
361
377
|
return e.Hallucination = "hallucination", e.OffBrand = "off_brand", e.DataLeak = "data_leak", e.InappropriateTone = "inappropriate_tone", e.RefusalLoop = "refusal_loop", e.Repetition = "repetition", e;
|
|
362
|
-
}({}),
|
|
378
|
+
}({}), ze = /* @__PURE__ */ function(e) {
|
|
363
379
|
return e.SummaryCycle = "summary_cycle", e.AgentRequest = "agent_request", e.Manual = "manual", e;
|
|
364
|
-
}({}),
|
|
380
|
+
}({}), Be = /* @__PURE__ */ function(e) {
|
|
365
381
|
return e.High = "high", e.Medium = "medium", e.Low = "low", e.Disengaged = "disengaged", e;
|
|
366
|
-
}({}),
|
|
382
|
+
}({}), Ve = /* @__PURE__ */ function(e) {
|
|
367
383
|
return e.Polite = "polite", e.Neutral = "neutral", e.Impatient = "impatient", e.Aggressive = "aggressive", e.Abusive = "abusive", e;
|
|
368
|
-
}({}),
|
|
384
|
+
}({}), He = /* @__PURE__ */ function(e) {
|
|
369
385
|
return e.Positive = "positive", e.Neutral = "neutral", e.Negative = "negative", e.Frustrated = "frustrated", e.Excited = "excited", e;
|
|
370
|
-
}({}),
|
|
386
|
+
}({}), Ue = /* @__PURE__ */ function(e) {
|
|
371
387
|
return e.Improving = "improving", e.Stable = "stable", e.Degrading = "degrading", e;
|
|
372
|
-
}({}),
|
|
373
|
-
analyzedAt:
|
|
374
|
-
analysisTrigger:
|
|
375
|
-
sentiment:
|
|
376
|
-
sentimentTrend:
|
|
377
|
-
userTone:
|
|
378
|
-
language:
|
|
379
|
-
topics: n(
|
|
380
|
-
userAbuseDetected:
|
|
381
|
-
userAbuseCategories: n(
|
|
382
|
-
userAbuseConfidence:
|
|
383
|
-
userAbuseSummary:
|
|
384
|
-
llmIssueDetected:
|
|
385
|
-
llmIssueCategories: n(
|
|
386
|
-
llmIssueSummary:
|
|
387
|
-
userEngagement:
|
|
388
|
-
conversationGoalMet:
|
|
388
|
+
}({}), We = o({
|
|
389
|
+
analyzedAt: p().describe("When the analysis was generated."),
|
|
390
|
+
analysisTrigger: l(ze).describe("What triggered this analysis run."),
|
|
391
|
+
sentiment: l(He).describe("Overall user sentiment in the conversation."),
|
|
392
|
+
sentimentTrend: l(Ue).describe("How the user sentiment evolved during the conversation."),
|
|
393
|
+
userTone: l(Ve).describe("Predominant tone of the user messages."),
|
|
394
|
+
language: d().max(10).describe("ISO 639-1 language code of the conversation (e.g. \"en\", \"it\")."),
|
|
395
|
+
topics: n(d().max(100)).max(10).describe("Main topics discussed, as short lowercase labels."),
|
|
396
|
+
userAbuseDetected: u().describe("Whether user abuse was detected. If false, userAbuseCategories MUST be empty."),
|
|
397
|
+
userAbuseCategories: n(l(Ie)).default([]).describe("Abuse categories detected. Non-empty only if userAbuseDetected is true."),
|
|
398
|
+
userAbuseConfidence: l(Le).optional().describe("Confidence level of the abuse detection. Set only if userAbuseDetected is true."),
|
|
399
|
+
userAbuseSummary: d().max(500).optional().describe("Brief description of the abusive behavior detected. Always write in English. Set only if userAbuseDetected is true."),
|
|
400
|
+
llmIssueDetected: u().describe("Whether an LLM quality issue was detected. If false, llmIssueCategories MUST be empty."),
|
|
401
|
+
llmIssueCategories: n(l(Re)).default([]).describe("LLM issue categories detected. Non-empty only if llmIssueDetected is true."),
|
|
402
|
+
llmIssueSummary: d().max(500).optional().describe("Brief description of the LLM quality issue detected. Always write in English. Set only if llmIssueDetected is true."),
|
|
403
|
+
userEngagement: l(Be).describe("Level of user engagement in the conversation."),
|
|
404
|
+
conversationGoalMet: u().optional().describe("Whether the user seems to have achieved what they came for. Leave undefined if unclear."),
|
|
389
405
|
riskScore: s().int().min(0).max(100).describe("Overall risk score (0 = safe, 100 = critical). Combination of abuse severity, persistence and escalation.")
|
|
390
|
-
}),
|
|
391
|
-
dateTime:
|
|
392
|
-
timezone:
|
|
393
|
-
language:
|
|
394
|
-
languages: n(
|
|
395
|
-
url:
|
|
396
|
-
pathname:
|
|
397
|
-
pageTitle:
|
|
398
|
-
referrer:
|
|
406
|
+
}), Ge = o({
|
|
407
|
+
dateTime: d().optional(),
|
|
408
|
+
timezone: d().optional(),
|
|
409
|
+
language: d().optional(),
|
|
410
|
+
languages: n(d()).optional(),
|
|
411
|
+
url: d().optional(),
|
|
412
|
+
pathname: d().optional(),
|
|
413
|
+
pageTitle: d().optional(),
|
|
414
|
+
referrer: d().optional(),
|
|
399
415
|
screenWidth: s().optional(),
|
|
400
416
|
screenHeight: s().optional(),
|
|
401
417
|
viewportWidth: s().optional(),
|
|
@@ -404,83 +420,83 @@ var Me = /* @__PURE__ */ function(e) {
|
|
|
404
420
|
maxTouchPoints: s().optional(),
|
|
405
421
|
hardwareConcurrency: s().optional(),
|
|
406
422
|
deviceMemory: s().optional(),
|
|
407
|
-
platform:
|
|
408
|
-
connectionType:
|
|
409
|
-
connectionEffectiveType:
|
|
423
|
+
platform: d().optional(),
|
|
424
|
+
connectionType: d().optional(),
|
|
425
|
+
connectionEffectiveType: d().optional(),
|
|
410
426
|
connectionDownlink: s().optional(),
|
|
411
427
|
connectionRtt: s().optional(),
|
|
412
|
-
saveData:
|
|
413
|
-
darkMode:
|
|
414
|
-
reducedMotion:
|
|
428
|
+
saveData: u().optional(),
|
|
429
|
+
darkMode: u().optional(),
|
|
430
|
+
reducedMotion: u().optional(),
|
|
415
431
|
historyLength: s().optional(),
|
|
416
432
|
geolocationLatitude: s().optional(),
|
|
417
433
|
geolocationLongitude: s().optional(),
|
|
418
434
|
geolocationAccuracy: s().optional(),
|
|
419
|
-
geolocationCity:
|
|
420
|
-
}),
|
|
435
|
+
geolocationCity: d().optional()
|
|
436
|
+
}), Ke = o({
|
|
421
437
|
type: a("text"),
|
|
422
|
-
text:
|
|
423
|
-
}),
|
|
438
|
+
text: d()
|
|
439
|
+
}), qe = o({
|
|
424
440
|
type: a("file"),
|
|
425
|
-
mediaType:
|
|
426
|
-
url:
|
|
427
|
-
filename:
|
|
428
|
-
providerMetadata: t(
|
|
429
|
-
}),
|
|
441
|
+
mediaType: d().regex(ne),
|
|
442
|
+
url: f(),
|
|
443
|
+
filename: d().optional(),
|
|
444
|
+
providerMetadata: t(d(), t(d(), r())).optional()
|
|
445
|
+
}), Je = c("type", [Ke, qe]);
|
|
430
446
|
o({
|
|
431
|
-
id:
|
|
447
|
+
id: d(),
|
|
432
448
|
messages: n(o({
|
|
433
|
-
id:
|
|
434
|
-
role:
|
|
435
|
-
content:
|
|
436
|
-
parts: n(
|
|
437
|
-
createdAt:
|
|
449
|
+
id: d().optional(),
|
|
450
|
+
role: l(["assistant", "user"]),
|
|
451
|
+
content: d(),
|
|
452
|
+
parts: n(Je),
|
|
453
|
+
createdAt: d().optional()
|
|
438
454
|
})),
|
|
439
|
-
model:
|
|
455
|
+
model: d().optional(),
|
|
440
456
|
temperature: s().optional(),
|
|
441
|
-
prompt:
|
|
457
|
+
prompt: d().optional(),
|
|
442
458
|
maxOutputTokens: s().positive().optional(),
|
|
443
459
|
presencePenalty: s().min(-2).max(2).optional(),
|
|
444
460
|
frequencyPenalty: s().min(-2).max(2).optional(),
|
|
445
|
-
searchMode:
|
|
461
|
+
searchMode: l(x).optional(),
|
|
446
462
|
limit: s().optional(),
|
|
447
|
-
ranking:
|
|
448
|
-
reasoning:
|
|
449
|
-
webSearch:
|
|
463
|
+
ranking: A.optional(),
|
|
464
|
+
reasoning: ye,
|
|
465
|
+
webSearch: O.optional(),
|
|
450
466
|
maxStepCount: s().int().min(1).max(40).optional(),
|
|
451
|
-
disabledTools: n(
|
|
452
|
-
fallbackModels: n(
|
|
453
|
-
gatewayOptions:
|
|
454
|
-
deviceContext:
|
|
455
|
-
externalContext: t(
|
|
456
|
-
smoothStream:
|
|
467
|
+
disabledTools: n(l(S)).optional(),
|
|
468
|
+
fallbackModels: n(d()).optional(),
|
|
469
|
+
gatewayOptions: R.partial().optional(),
|
|
470
|
+
deviceContext: Ge.optional(),
|
|
471
|
+
externalContext: t(d(), r()).optional(),
|
|
472
|
+
smoothStream: u().optional()
|
|
457
473
|
});
|
|
458
|
-
var
|
|
474
|
+
var Ye = /* @__PURE__ */ function(e) {
|
|
459
475
|
return e.SevereAbuse = "severe_abuse", e.HighRiskScore = "high_risk_score", e.RepeatedWarnings = "repeated_warnings", e;
|
|
460
|
-
}({}),
|
|
461
|
-
id:
|
|
476
|
+
}({}), Xe = o({
|
|
477
|
+
id: d(),
|
|
462
478
|
messages: n(r()),
|
|
463
|
-
title:
|
|
464
|
-
summary:
|
|
465
|
-
messageCountAtLastSummary:
|
|
466
|
-
createdAt:
|
|
467
|
-
updatedAt:
|
|
468
|
-
metadata: t(
|
|
469
|
-
totalCostInUSD:
|
|
479
|
+
title: d().nullable(),
|
|
480
|
+
summary: d().nullable(),
|
|
481
|
+
messageCountAtLastSummary: d().nullable(),
|
|
482
|
+
createdAt: p(),
|
|
483
|
+
updatedAt: p(),
|
|
484
|
+
metadata: t(d(), r()),
|
|
485
|
+
totalCostInUSD: d(),
|
|
470
486
|
usage: r(),
|
|
471
|
-
agentId:
|
|
472
|
-
userId:
|
|
473
|
-
organizationId:
|
|
474
|
-
deleted:
|
|
475
|
-
deletedAt:
|
|
476
|
-
deletedBy:
|
|
477
|
-
conversationAnalysis:
|
|
478
|
-
blocked:
|
|
479
|
-
blockedAt:
|
|
480
|
-
blockedReasonCode:
|
|
481
|
-
blockedReason:
|
|
487
|
+
agentId: d().nullable(),
|
|
488
|
+
userId: d(),
|
|
489
|
+
organizationId: d(),
|
|
490
|
+
deleted: u(),
|
|
491
|
+
deletedAt: p().nullable(),
|
|
492
|
+
deletedBy: d().nullable(),
|
|
493
|
+
conversationAnalysis: We.nullable().optional(),
|
|
494
|
+
blocked: u(),
|
|
495
|
+
blockedAt: p().nullable(),
|
|
496
|
+
blockedReasonCode: l(Ye).nullable(),
|
|
497
|
+
blockedReason: d().nullable(),
|
|
482
498
|
warningCount: s(),
|
|
483
|
-
lastMessageAt:
|
|
499
|
+
lastMessageAt: p()
|
|
484
500
|
});
|
|
485
501
|
o({
|
|
486
502
|
...h.pagination(),
|
|
@@ -493,22 +509,22 @@ o({
|
|
|
493
509
|
...h.range("updatedAt"),
|
|
494
510
|
...h.range("lastMessageAt"),
|
|
495
511
|
...h.ids(),
|
|
496
|
-
startDate:
|
|
497
|
-
endDate:
|
|
512
|
+
startDate: d().optional(),
|
|
513
|
+
endDate: d().optional()
|
|
498
514
|
});
|
|
499
|
-
var
|
|
500
|
-
id:
|
|
501
|
-
agentId:
|
|
502
|
-
organizationId:
|
|
503
|
-
summary:
|
|
504
|
-
title:
|
|
505
|
-
userId:
|
|
506
|
-
createdAt:
|
|
507
|
-
updatedAt:
|
|
508
|
-
lastMessageAt:
|
|
515
|
+
var Ze = o({
|
|
516
|
+
id: d(),
|
|
517
|
+
agentId: d().optional(),
|
|
518
|
+
organizationId: d(),
|
|
519
|
+
summary: d().optional(),
|
|
520
|
+
title: d().optional(),
|
|
521
|
+
userId: d(),
|
|
522
|
+
createdAt: p(),
|
|
523
|
+
updatedAt: p(),
|
|
524
|
+
lastMessageAt: p(),
|
|
509
525
|
messages: n(r()),
|
|
510
|
-
blocked:
|
|
511
|
-
}),
|
|
526
|
+
blocked: u()
|
|
527
|
+
}), Qe = class {
|
|
512
528
|
constructor(e, t) {
|
|
513
529
|
this.operator = e, this.value = t, Object.defineProperty(this, "_notes", { writable: !0 });
|
|
514
530
|
}
|
|
@@ -518,18 +534,18 @@ var qe = o({
|
|
|
518
534
|
addNote(e) {
|
|
519
535
|
this._notes = this._notes || [], this._notes.push(e);
|
|
520
536
|
}
|
|
521
|
-
},
|
|
537
|
+
}, $e = class extends Qe {}, G = class extends $e {
|
|
522
538
|
constructor(e, t) {
|
|
523
539
|
if (!Array.isArray(t)) throw Error(`"${e}" operator expects to receive an array of conditions`);
|
|
524
540
|
super(e, t);
|
|
525
541
|
}
|
|
526
|
-
},
|
|
542
|
+
}, et = "__itself__", K = class extends Qe {
|
|
527
543
|
constructor(e, t, n) {
|
|
528
544
|
super(e, n), this.field = t;
|
|
529
545
|
}
|
|
530
|
-
},
|
|
546
|
+
}, tt = new $e("__null__", null);
|
|
531
547
|
Object.hasOwn;
|
|
532
|
-
function
|
|
548
|
+
function nt(e, t) {
|
|
533
549
|
let n;
|
|
534
550
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
535
551
|
let i = t[r];
|
|
@@ -546,69 +562,69 @@ function Qe(e, t) {
|
|
|
546
562
|
}
|
|
547
563
|
return n || t;
|
|
548
564
|
}
|
|
549
|
-
function
|
|
565
|
+
function rt(e, t) {
|
|
550
566
|
if (t.length === 1) return t[0];
|
|
551
567
|
if (t.length === 0) return new G(e, t);
|
|
552
|
-
let n =
|
|
568
|
+
let n = nt(e, t);
|
|
553
569
|
return n.length === 1 ? n[0] : (n.length, new G(e, n));
|
|
554
570
|
}
|
|
555
571
|
Object.defineProperty(Object.create(null), "__@type@__", { value: "ignore value" });
|
|
556
572
|
//#endregion
|
|
557
573
|
//#region ../../node_modules/.pnpm/@ucast+mongo@3.0.0/node_modules/@ucast/mongo/dist/esm/index.mjs
|
|
558
|
-
var
|
|
574
|
+
var it = Object.defineProperty;
|
|
559
575
|
((e, t) => {
|
|
560
576
|
let n = {};
|
|
561
|
-
for (var r in e)
|
|
577
|
+
for (var r in e) it(n, r, {
|
|
562
578
|
get: e[r],
|
|
563
579
|
enumerable: !0
|
|
564
580
|
});
|
|
565
|
-
return t ||
|
|
581
|
+
return t || it(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
566
582
|
})({
|
|
567
|
-
$all: () =>
|
|
568
|
-
$and: () =>
|
|
569
|
-
$elemMatch: () =>
|
|
570
|
-
$eq: () =>
|
|
571
|
-
$exists: () =>
|
|
583
|
+
$all: () => pt,
|
|
584
|
+
$and: () => at,
|
|
585
|
+
$elemMatch: () => ut,
|
|
586
|
+
$eq: () => yt,
|
|
587
|
+
$exists: () => ht,
|
|
572
588
|
$gt: () => J,
|
|
573
|
-
$gte: () =>
|
|
589
|
+
$gte: () => gt,
|
|
574
590
|
$in: () => q,
|
|
575
|
-
$lt: () =>
|
|
576
|
-
$lte: () =>
|
|
577
|
-
$mod: () =>
|
|
578
|
-
$ne: () =>
|
|
579
|
-
$nin: () =>
|
|
580
|
-
$nor: () =>
|
|
581
|
-
$not: () =>
|
|
582
|
-
$options: () =>
|
|
583
|
-
$or: () =>
|
|
584
|
-
$regex: () =>
|
|
585
|
-
$size: () =>
|
|
586
|
-
$where: () =>
|
|
591
|
+
$lt: () => _t,
|
|
592
|
+
$lte: () => vt,
|
|
593
|
+
$mod: () => mt,
|
|
594
|
+
$ne: () => bt,
|
|
595
|
+
$nin: () => ft,
|
|
596
|
+
$nor: () => st,
|
|
597
|
+
$not: () => lt,
|
|
598
|
+
$options: () => St,
|
|
599
|
+
$or: () => ot,
|
|
600
|
+
$regex: () => xt,
|
|
601
|
+
$size: () => dt,
|
|
602
|
+
$where: () => Ct
|
|
587
603
|
});
|
|
588
|
-
var
|
|
604
|
+
var at = {
|
|
589
605
|
type: "compound",
|
|
590
|
-
validate:
|
|
606
|
+
validate: Tt,
|
|
591
607
|
parse(e, t, n) {
|
|
592
|
-
let r =
|
|
593
|
-
return
|
|
608
|
+
let r = ct(e, t, n);
|
|
609
|
+
return rt(e.name, r);
|
|
594
610
|
}
|
|
595
|
-
},
|
|
611
|
+
}, ot = at, st = {
|
|
596
612
|
type: "compound",
|
|
597
|
-
validate:
|
|
613
|
+
validate: Tt,
|
|
598
614
|
parse(e, t, n) {
|
|
599
|
-
let r =
|
|
615
|
+
let r = ct(e, t, n);
|
|
600
616
|
return new G(e.name, r);
|
|
601
617
|
}
|
|
602
618
|
};
|
|
603
|
-
function
|
|
619
|
+
function ct(e, t, n) {
|
|
604
620
|
let r = Array(t.length);
|
|
605
621
|
for (let i = 0; i < t.length; i++) {
|
|
606
622
|
let a = t[i];
|
|
607
|
-
|
|
623
|
+
Dt(e, a, i), r[i] = n.parse(a);
|
|
608
624
|
}
|
|
609
625
|
return r;
|
|
610
626
|
}
|
|
611
|
-
var
|
|
627
|
+
var lt = {
|
|
612
628
|
type: "field",
|
|
613
629
|
validate(e, t) {
|
|
614
630
|
if (!(t && (t instanceof RegExp || t.constructor === Object))) throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`);
|
|
@@ -617,33 +633,33 @@ var at = {
|
|
|
617
633
|
let r = t instanceof RegExp ? new K("regex", n.field, t) : n.parse(t, n);
|
|
618
634
|
return new G(e.name, [r]);
|
|
619
635
|
}
|
|
620
|
-
},
|
|
636
|
+
}, ut = {
|
|
621
637
|
type: "field",
|
|
622
638
|
validate(e, t) {
|
|
623
639
|
if (!t || t.constructor !== Object) throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`);
|
|
624
640
|
},
|
|
625
641
|
parse(e, t, { parse: n, field: r, hasOperators: i }) {
|
|
626
|
-
let a = i(t) ? n(t, { field:
|
|
642
|
+
let a = i(t) ? n(t, { field: et }) : n(t);
|
|
627
643
|
return new K(e.name, r, a);
|
|
628
644
|
}
|
|
629
|
-
},
|
|
645
|
+
}, dt = {
|
|
630
646
|
type: "field",
|
|
631
647
|
validate: Y("number")
|
|
632
648
|
}, q = {
|
|
633
649
|
type: "field",
|
|
634
|
-
validate:
|
|
635
|
-
},
|
|
650
|
+
validate: wt
|
|
651
|
+
}, ft = q, pt = q, mt = {
|
|
636
652
|
type: "field",
|
|
637
653
|
validate(e, t) {
|
|
638
654
|
if (!Array.isArray(t) || t.length !== 2) throw Error(`"${e.name}" expects an array with 2 numeric elements`);
|
|
639
655
|
}
|
|
640
|
-
},
|
|
656
|
+
}, ht = {
|
|
641
657
|
type: "field",
|
|
642
658
|
validate: Y("boolean")
|
|
643
|
-
},
|
|
659
|
+
}, gt = {
|
|
644
660
|
type: "field",
|
|
645
|
-
validate:
|
|
646
|
-
}, J =
|
|
661
|
+
validate: Et
|
|
662
|
+
}, J = gt, _t = J, vt = J, yt = { type: "field" }, bt = yt, xt = {
|
|
647
663
|
type: "field",
|
|
648
664
|
validate(e, t) {
|
|
649
665
|
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`);
|
|
@@ -652,20 +668,20 @@ var at = {
|
|
|
652
668
|
let r = typeof t == "string" ? new RegExp(t, n.query.$options || "") : t;
|
|
653
669
|
return new K(e.name, n.field, r);
|
|
654
670
|
}
|
|
655
|
-
},
|
|
671
|
+
}, St = {
|
|
656
672
|
type: "field",
|
|
657
|
-
parse: () =>
|
|
658
|
-
},
|
|
673
|
+
parse: () => tt
|
|
674
|
+
}, Ct = {
|
|
659
675
|
type: "document",
|
|
660
676
|
validate: Y("function")
|
|
661
677
|
};
|
|
662
|
-
function
|
|
678
|
+
function wt(e, t) {
|
|
663
679
|
if (!Array.isArray(t)) throw Error(`"${e.name}" expects value to be an array`);
|
|
664
680
|
}
|
|
665
|
-
function
|
|
666
|
-
if (
|
|
681
|
+
function Tt(e, t) {
|
|
682
|
+
if (wt(e, t), !t.length) throw Error(`"${e.name}" expects to have at least one element in array`);
|
|
667
683
|
}
|
|
668
|
-
function
|
|
684
|
+
function Et(e, t) {
|
|
669
685
|
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)`);
|
|
670
686
|
}
|
|
671
687
|
function Y(e) {
|
|
@@ -673,7 +689,7 @@ function Y(e) {
|
|
|
673
689
|
if (typeof n !== e) throw Error(`"${t.name}" expects value to be a "${e}"`);
|
|
674
690
|
};
|
|
675
691
|
}
|
|
676
|
-
function
|
|
692
|
+
function Dt(e, t, n) {
|
|
677
693
|
let r = t;
|
|
678
694
|
if (!r || r.constructor !== Object) throw Error(`"${e.name}" expects item at index ${n} to be an object`);
|
|
679
695
|
}
|
|
@@ -683,7 +699,7 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
683
699
|
return e.Backoffice = "backoffice", e.Frontoffice = "frontoffice", e.System = "system", e.Public = "public", e;
|
|
684
700
|
}({}), Z = /* @__PURE__ */ function(e) {
|
|
685
701
|
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.PlatformConnection = "platform_connection", e;
|
|
686
|
-
}({}),
|
|
702
|
+
}({}), Ot = (e) => e ? [
|
|
687
703
|
{
|
|
688
704
|
subject: Z.Chat,
|
|
689
705
|
action: "create"
|
|
@@ -715,21 +731,21 @@ var X = /* @__PURE__ */ function(e) {
|
|
|
715
731
|
action: "read",
|
|
716
732
|
condition: { createdBy: { $eq: e.user?.id } }
|
|
717
733
|
}
|
|
718
|
-
] : [],
|
|
734
|
+
] : [], kt = ce({ modify: [
|
|
719
735
|
"read",
|
|
720
736
|
"update",
|
|
721
737
|
"delete"
|
|
722
|
-
] }),
|
|
723
|
-
new oe(
|
|
724
|
-
conditionsMatcher:
|
|
725
|
-
resolveAction:
|
|
738
|
+
] }), At = se({ $or: ot });
|
|
739
|
+
new oe(Ot(), {
|
|
740
|
+
conditionsMatcher: At,
|
|
741
|
+
resolveAction: kt,
|
|
726
742
|
fieldMatcher: (e) => (t) => e.includes(t)
|
|
727
743
|
});
|
|
728
744
|
var Q = le(de);
|
|
729
745
|
Q.newRole(ue.statements), Q.newRole(fe.statements), Q.newRole(_.statements), Q.newRole(_.statements);
|
|
730
746
|
//#endregion
|
|
731
747
|
//#region ../../packages/composable/src/chatbot/api/resolveShortUrls.ts
|
|
732
|
-
async function
|
|
748
|
+
async function jt(e, t, n = {}) {
|
|
733
749
|
try {
|
|
734
750
|
let r = g(e), i = await fetch(`${r}/api/r/resolve`, {
|
|
735
751
|
method: "POST",
|
|
@@ -747,12 +763,12 @@ async function Dt(e, t, n = {}) {
|
|
|
747
763
|
}
|
|
748
764
|
//#endregion
|
|
749
765
|
//#region ../../packages/composable/src/chatbot/api/createChatbotApiClient.ts
|
|
750
|
-
var
|
|
766
|
+
var Mt = Xe.or(Ze);
|
|
751
767
|
function $(e) {
|
|
752
|
-
let t =
|
|
768
|
+
let t = Mt.safeParse(e);
|
|
753
769
|
return t.success ? t.data : e;
|
|
754
770
|
}
|
|
755
|
-
function
|
|
771
|
+
function Nt(e) {
|
|
756
772
|
let t = e.basePath ? ae(e.basePath) : `/api/v1/${X.Public}`, n = `${g(e.baseUrl)}${t}`, r = `${g(e.baseUrl)}${t.replace(/\/[^/]+$/, `/${X.Frontoffice}`)}`;
|
|
757
773
|
async function i(t, r, i = "json") {
|
|
758
774
|
let a = await fetch(`${n}${t}`, {
|
|
@@ -900,7 +916,7 @@ function kt(e) {
|
|
|
900
916
|
return i(`/agents/${encodeURIComponent(e)}/mcp-oauth/authorize?${n}`);
|
|
901
917
|
},
|
|
902
918
|
resolveShortUrls(t) {
|
|
903
|
-
return
|
|
919
|
+
return jt(e.baseUrl, t, {
|
|
904
920
|
headers: e.headers?.(),
|
|
905
921
|
credentials: e.credentials
|
|
906
922
|
});
|
|
@@ -908,6 +924,6 @@ function kt(e) {
|
|
|
908
924
|
};
|
|
909
925
|
}
|
|
910
926
|
//#endregion
|
|
911
|
-
export {
|
|
927
|
+
export { L as a, M as c, Se as d, Te as f, P as i, D as l, X as n, N as o, C as p, S as r, b as s, Nt as t, Ce as u };
|
|
912
928
|
|
|
913
|
-
//# sourceMappingURL=createChatbotApiClient-
|
|
929
|
+
//# sourceMappingURL=createChatbotApiClient-2iaBCziJ.js.map
|