@8wave/ai-elements 0.100.0 → 0.101.0-beta.1

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.
Files changed (37) hide show
  1. package/dist/ai-elements.es.js +1522 -1519
  2. package/dist/ai-elements.es.js.map +1 -1
  3. package/dist-vue/PkChatbot.js +1 -1
  4. package/dist-vue/PkChatbotViewChat.js +1 -1
  5. package/dist-vue/PkChatbotViewConversations.js +1 -1
  6. package/dist-vue/PkChatbotViewFiles.js +1 -1
  7. package/dist-vue/PkChatbotViewProfile.js +1 -1
  8. package/dist-vue/_chunks/{PkChatbot-bWzP1psN.js → PkChatbot-BraWzebX.js} +6 -6
  9. package/dist-vue/_chunks/{PkChatbot-bWzP1psN.js.map → PkChatbot-BraWzebX.js.map} +1 -1
  10. package/dist-vue/_chunks/{PkChatbotViewChat-glcxrv5f.js → PkChatbotViewChat-BhwV8BzI.js} +2 -2
  11. package/dist-vue/_chunks/{PkChatbotViewChat-glcxrv5f.js.map → PkChatbotViewChat-BhwV8BzI.js.map} +1 -1
  12. package/dist-vue/_chunks/{PkChatbotViewConversations-CNZuX3Rl.js → PkChatbotViewConversations-Dmv8R7EN.js} +2 -2
  13. package/dist-vue/_chunks/{PkChatbotViewConversations-CNZuX3Rl.js.map → PkChatbotViewConversations-Dmv8R7EN.js.map} +1 -1
  14. package/dist-vue/_chunks/{PkChatbotViewFiles-CyBqTzjY.js → PkChatbotViewFiles-DKuu-7Hw.js} +2 -2
  15. package/dist-vue/_chunks/{PkChatbotViewFiles-CyBqTzjY.js.map → PkChatbotViewFiles-DKuu-7Hw.js.map} +1 -1
  16. package/dist-vue/_chunks/{PkChatbotViewProfile-BCPCO6mp.js → PkChatbotViewProfile-CIO0mBFM.js} +2 -2
  17. package/dist-vue/_chunks/{PkChatbotViewProfile-BCPCO6mp.js.map → PkChatbotViewProfile-CIO0mBFM.js.map} +1 -1
  18. package/dist-vue/_chunks/{createChatbotApiClient-BGkXm2NB.js → createChatbotApiClient-2iaBCziJ.js} +362 -346
  19. package/dist-vue/_chunks/createChatbotApiClient-2iaBCziJ.js.map +1 -0
  20. package/dist-vue/_chunks/{useChatbotStore-D9b5Fz-e.js → useChatbotStore-BK1xv_i6.js} +2 -2
  21. package/dist-vue/_chunks/{useChatbotStore-D9b5Fz-e.js.map → useChatbotStore-BK1xv_i6.js.map} +1 -1
  22. package/dist-vue/api.js +1 -1
  23. package/dist-vue/composables.js +2 -2
  24. package/dist-vue/index.js +2872 -2858
  25. package/dist-vue/index.js.map +1 -1
  26. package/dist-vue/locales.js +2 -0
  27. package/dist-vue/packages/auth/src/index.d.ts +4 -4
  28. package/dist-vue/packages/models/src/schema/Agent.d.ts +114 -5
  29. package/dist-vue/packages/models/src/schema/Chat.d.ts +7 -0
  30. package/dist-vue/packages/models/src/schema/OpenAiCompat.d.ts +192 -0
  31. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
  32. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
  33. package/dist-vue/packages/models/src/schema/TimingLog.d.ts +153 -0
  34. package/dist-vue/packages/models/src/schema/UserOverview.d.ts +1 -1
  35. package/dist-vue/packages/models/src/schema/index.d.ts +2 -0
  36. package/package.json +1 -1
  37. package/dist-vue/_chunks/createChatbotApiClient-BGkXm2NB.js.map +0 -1
@@ -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 c, l, n as u, o as d, v as f, x as p } from "./schemas-pShs5g_i.js";
2
- import { i as m, n as ee, t as te } from "./Media-DCJ2pi6q.js";
3
- import { a as ne, o as re, r as ie, s as h } from "./constants-h4s5C7jp.js";
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: u([
19
+ reasoningEffort: l([
20
20
  "none",
21
21
  "low",
22
22
  "medium",
23
23
  "high",
24
24
  "xhigh"
25
25
  ]).optional(),
26
- reasoningSummary: u([
26
+ reasoningSummary: l([
27
27
  "auto",
28
28
  "detailed",
29
29
  "concise"
30
30
  ]).optional()
31
31
  }), me = o({
32
- type: u([
32
+ type: l([
33
33
  "adaptive",
34
34
  "enabled",
35
35
  "disabled"
36
36
  ]).optional(),
37
- effort: u([
37
+ effort: l([
38
38
  "low",
39
39
  "medium",
40
40
  "high",
41
41
  "xhigh",
42
42
  "max"
43
43
  ]).optional(),
44
- display: u(["summarized", "omitted"]).optional(),
44
+ display: l(["summarized", "omitted"]).optional(),
45
45
  budgetTokens: s().int().positive().optional()
46
46
  }), he = o({
47
- thinkingLevel: u([
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: d().optional()
55
- }), ge = o({ type: u(["enabled", "disabled"]).optional() }), _e = o({
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 S = ne(r(), _e, ve).optional(), C = /* @__PURE__ */ function(e) {
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 ye(e) {
80
- return !w(e) && e !== C.RequestGeolocation;
94
+ function Ce(e) {
95
+ return !C(e) && e !== S.RequestGeolocation;
81
96
  }
82
- function w(e) {
83
- 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.ShowVideo || e === C.ShowWeather || e === C.ShowWebPages;
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 be = /* @__PURE__ */ new Set([
86
- C.RequestConfirm,
87
- C.ShowArtifact,
88
- C.ShowWeather,
89
- C.ShowLocation,
90
- C.ShowComparison,
91
- C.ShowProductList,
92
- C.ShowWebPages,
93
- C.ShowImageGallery,
94
- C.ShowVideo,
95
- C.ShowSources,
96
- C.ShowSuggestedReply,
97
- C.ShowCalendarEvent,
98
- C.ShowEmail,
99
- C.ShowMessage,
100
- C.ShowForm
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 xe(e) {
103
- return be.has(e);
117
+ function Te(e) {
118
+ return we.has(e);
104
119
  }
105
- var T = o({
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
- }), E = o({ mode: u(["optional", "required"]).optional().default("optional") }), D = o({ mode: u(["optional", "required"]).optional().default("required") }), O = /* @__PURE__ */ function(e) {
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
- }({}), Se = o({
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: f().max(2).optional(),
115
- searchLanguageFilter: n(f().max(5)).max(10).optional(),
116
- searchDomainFilter: n(f()).max(20).optional(),
117
- searchRecencyFilter: u([
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
- }), Ce = o({
124
- mode: u(["one-shot", "agentic"]).optional(),
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(f()).optional(),
128
- excludeDomains: n(f()).optional(),
129
- afterDate: f().optional()
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
- }), we = o({
151
+ }), Oe = o({
137
152
  openai: o({}).optional(),
138
153
  anthropic: o({
139
154
  maxUses: s().int().positive().optional(),
140
- allowedDomains: n(f()).optional(),
141
- blockedDomains: n(f()).optional(),
155
+ allowedDomains: n(d()).optional(),
156
+ blockedDomains: n(d()).optional(),
142
157
  userLocation: o({
143
158
  type: a("approximate").optional(),
144
- country: f().optional(),
145
- region: f().optional(),
146
- city: f().optional(),
147
- timezone: f().optional()
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
- }), k = o({
152
- enabled: d().default(!1),
153
- provider: u(O).optional().default(O.Native),
154
- perplexity: Se.optional(),
155
- parallel: Ce.optional(),
156
- native: we.optional()
157
- }), A = o({ useAllUserKb: d().default(!1) }), j = o({ useAllUserFiles: d().default(!1) }), M = o({ tools: n(f()).default([]) }), N = o({
158
- disabled: n(u(C)).default([
159
- C.UserMemory,
160
- C.SearchInUserFiles,
161
- C.RunWorker,
162
- C.FetchTeamsChannelHistory
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: T.optional().default(() => T.parse({})),
165
- suggestedReply: E.optional().default(() => E.parse({})),
166
- showSources: D.optional().default(() => D.parse({})),
167
- webSearch: k.optional().default(() => k.parse({})),
168
- userMemory: A.optional().default(() => A.parse({})),
169
- userFiles: j.optional().default(() => j.parse({})),
170
- approval: M.optional().default(() => M.parse({}))
171
- }), P = o({
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: d().default(!1),
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: d().default(!0) }).prefault({}),
192
+ priority: o({ enabled: u().default(!0) }).prefault({}),
178
193
  mmr: o({
179
- enabled: d().default(!1),
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({}), Te = o({
184
- prompt: f().optional(),
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: u(x).optional().default(x.Balanced),
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: S,
193
- ranking: P.optional().default(() => P.parse({}))
194
- }), F = ne(r(), t(f(), f()), (e) => typeof e == "string" ? { it: e } : e), I = "https://cdn.jsdelivr.net/npm/@8wave/ai-elements/dist/ai-elements.es.js", L = /* @__PURE__ */ function(e) {
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
- }({}), R = /* @__PURE__ */ function(e) {
211
+ }({}), P = /* @__PURE__ */ function(e) {
197
212
  return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
198
- }({}), z = Object.values(R), B = o({
199
- media: ee.optional(),
200
- logo: f().optional(),
201
- theme: u([
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: f().regex(/^#[0-9A-Fa-f]{6}$/).optional().default("#000000"),
207
- textColor: u([
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: d().optional().default(!1),
213
- initialMessage: F.optional(),
214
- greeting: n(F).min(1).max(10).optional(),
215
- messagePlaceholder: F.optional(),
216
- dismissableNotice: F.optional(),
217
- footerMessage: F.optional(),
218
- privacyPolicyNotice: F.optional(),
219
- interactiveLogin: d().optional().default(!0),
220
- welcomePopup: d().optional().default(!1),
221
- floatingButtonPosition: u(["left", "right"]).optional().default("right"),
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: p().default(I),
238
+ widgetUrl: f().default(M),
224
239
  loadDelay: s().int().min(0).max(3e4).optional().default(0),
225
- loaderStrategy: u(L).optional().default(L.InlineModule),
226
- customCss: f().optional(),
227
- smoothStream: d().optional().default(!1),
228
- showExtendedSteps: d().optional().default(!1)
229
- }), V = o({
230
- enabled: d().default(!1),
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(f().regex(te)).optional().default([
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
- }), H = o({
245
- zeroDataRetention: d().default(!0),
246
- disallowPromptTraining: d().default(!0),
259
+ }), R = o({
260
+ zeroDataRetention: u().default(!0),
261
+ disallowPromptTraining: u().default(!0),
247
262
  providerTimeoutMs: s().int().min(1e3).max(789e3).optional()
248
- }), U = o({
249
- model: Te,
250
- interface: B,
251
- tools: N.optional().default(() => N.parse({})),
252
- fileUpload: V.optional().default(() => V.parse({})),
253
- gatewayOptions: H.optional().default(() => H.parse({})),
254
- channels: n(u(R)).optional().default(() => [...z]),
255
- externalContextSchema: re.optional()
256
- }), Ee = o({
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(p().or(a(""))).overwrite((e) => e?.filter((e) => e?.trim())).default([]) }).default({ origins: [] })
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: f().optional(),
267
- name: f(),
268
- prompt: f().optional(),
269
- model: f().default(ie.gpt52Chat),
270
- fallbackModels: n(f()).default([]),
271
- status: u(v).default(v.Draft),
272
- visibility: u(y).default(y.Organization),
273
- settings: U,
274
- security: Ee.nullish(),
275
- type: u(b).default(b.Chat),
276
- organizationId: f()
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: f(),
279
- name: f(),
280
- prompt: f(),
281
- model: f(),
282
- fallbackModels: n(f()).nullable().default([]),
283
- status: u(v).default(v.Draft),
284
- visibility: u(y).default(y.Organization),
285
- settings: U,
286
- security: Ee.nullable(),
287
- type: u(b).default(b.Chat),
288
- organizationId: f(),
289
- createdAt: m(),
290
- createdBy: f(),
291
- updatedAt: m(),
292
- updatedBy: f(),
293
- deleted: d(),
294
- deletedAt: m().nullable(),
295
- deletedBy: f().nullable(),
296
- outOfBudget: d().optional().default(!1),
297
- outOfBudgetReason: f().optional().default("")
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 De = o({
300
- id: f(),
301
- name: f(),
302
- status: u(v),
303
- visibility: u(y),
304
- organizationId: f(),
305
- interface: B,
306
- createdAt: m(),
307
- updatedAt: m(),
308
- capabilities: o({ fileUpload: V }),
309
- channels: n(u(R)).default(() => [...z])
310
- }), Oe = B.pick({
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
- }), ke = De.pick({
333
+ }), Pe = H.pick({
318
334
  id: !0,
319
335
  name: !0,
320
336
  organizationId: !0
321
- }).extend({ interface: Oe }), Ae = o({
322
- emailPassword: d(),
323
- google: d(),
324
- microsoft: d()
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: c(),
332
- branding: ke
347
+ agent: ee(),
348
+ branding: Pe
333
349
  });
334
- l("requiresAuth", [je, W]), l("requiresAuth", [je.extend({ authMethods: Ae }), W.extend({ authMethods: Ae })]), o({
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 Me = /* @__PURE__ */ function(e) {
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
- }({}), Ne = /* @__PURE__ */ function(e) {
374
+ }({}), Le = /* @__PURE__ */ function(e) {
359
375
  return e.Low = "low", e.Medium = "medium", e.High = "high", e;
360
- }({}), Pe = /* @__PURE__ */ function(e) {
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
- }({}), Fe = /* @__PURE__ */ function(e) {
378
+ }({}), ze = /* @__PURE__ */ function(e) {
363
379
  return e.SummaryCycle = "summary_cycle", e.AgentRequest = "agent_request", e.Manual = "manual", e;
364
- }({}), Ie = /* @__PURE__ */ function(e) {
380
+ }({}), Be = /* @__PURE__ */ function(e) {
365
381
  return e.High = "high", e.Medium = "medium", e.Low = "low", e.Disengaged = "disengaged", e;
366
- }({}), Le = /* @__PURE__ */ function(e) {
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
- }({}), Re = /* @__PURE__ */ function(e) {
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
- }({}), ze = /* @__PURE__ */ function(e) {
386
+ }({}), Ue = /* @__PURE__ */ function(e) {
371
387
  return e.Improving = "improving", e.Stable = "stable", e.Degrading = "degrading", e;
372
- }({}), Be = o({
373
- analyzedAt: m().describe("When the analysis was generated."),
374
- analysisTrigger: u(Fe).describe("What triggered this analysis run."),
375
- sentiment: u(Re).describe("Overall user sentiment in the conversation."),
376
- sentimentTrend: u(ze).describe("How the user sentiment evolved during the conversation."),
377
- userTone: u(Le).describe("Predominant tone of the user messages."),
378
- language: f().max(10).describe("ISO 639-1 language code of the conversation (e.g. \"en\", \"it\")."),
379
- topics: n(f().max(100)).max(10).describe("Main topics discussed, as short lowercase labels."),
380
- userAbuseDetected: d().describe("Whether user abuse was detected. If false, userAbuseCategories MUST be empty."),
381
- userAbuseCategories: n(u(Me)).default([]).describe("Abuse categories detected. Non-empty only if userAbuseDetected is true."),
382
- userAbuseConfidence: u(Ne).optional().describe("Confidence level of the abuse detection. Set only if userAbuseDetected is true."),
383
- userAbuseSummary: f().max(500).optional().describe("Brief description of the abusive behavior detected. Always write in English. Set only if userAbuseDetected is true."),
384
- llmIssueDetected: d().describe("Whether an LLM quality issue was detected. If false, llmIssueCategories MUST be empty."),
385
- llmIssueCategories: n(u(Pe)).default([]).describe("LLM issue categories detected. Non-empty only if llmIssueDetected is true."),
386
- llmIssueSummary: f().max(500).optional().describe("Brief description of the LLM quality issue detected. Always write in English. Set only if llmIssueDetected is true."),
387
- userEngagement: u(Ie).describe("Level of user engagement in the conversation."),
388
- conversationGoalMet: d().optional().describe("Whether the user seems to have achieved what they came for. Leave undefined if unclear."),
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
- }), Ve = o({
391
- dateTime: f().optional(),
392
- timezone: f().optional(),
393
- language: f().optional(),
394
- languages: n(f()).optional(),
395
- url: f().optional(),
396
- pathname: f().optional(),
397
- pageTitle: f().optional(),
398
- referrer: f().optional(),
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: f().optional(),
408
- connectionType: f().optional(),
409
- connectionEffectiveType: f().optional(),
423
+ platform: d().optional(),
424
+ connectionType: d().optional(),
425
+ connectionEffectiveType: d().optional(),
410
426
  connectionDownlink: s().optional(),
411
427
  connectionRtt: s().optional(),
412
- saveData: d().optional(),
413
- darkMode: d().optional(),
414
- reducedMotion: d().optional(),
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: f().optional()
420
- }), He = o({
435
+ geolocationCity: d().optional()
436
+ }), Ke = o({
421
437
  type: a("text"),
422
- text: f()
423
- }), Ue = o({
438
+ text: d()
439
+ }), qe = o({
424
440
  type: a("file"),
425
- mediaType: f().regex(te),
426
- url: p(),
427
- filename: f().optional(),
428
- providerMetadata: t(f(), t(f(), r())).optional()
429
- }), We = l("type", [He, Ue]);
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: f(),
447
+ id: d(),
432
448
  messages: n(o({
433
- id: f().optional(),
434
- role: u(["assistant", "user"]),
435
- content: f(),
436
- parts: n(We),
437
- createdAt: f().optional()
449
+ id: d().optional(),
450
+ role: l(["assistant", "user"]),
451
+ content: d(),
452
+ parts: n(Je),
453
+ createdAt: d().optional()
438
454
  })),
439
- model: f().optional(),
455
+ model: d().optional(),
440
456
  temperature: s().optional(),
441
- prompt: f().optional(),
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: u(x).optional(),
461
+ searchMode: l(x).optional(),
446
462
  limit: s().optional(),
447
- ranking: P.optional(),
448
- reasoning: S,
449
- webSearch: k.optional(),
463
+ ranking: A.optional(),
464
+ reasoning: ye,
465
+ webSearch: O.optional(),
450
466
  maxStepCount: s().int().min(1).max(40).optional(),
451
- disabledTools: n(u(C)).optional(),
452
- fallbackModels: n(f()).optional(),
453
- gatewayOptions: H.partial().optional(),
454
- deviceContext: Ve.optional(),
455
- externalContext: t(f(), r()).optional(),
456
- smoothStream: d().optional()
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 Ge = /* @__PURE__ */ function(e) {
474
+ var Ye = /* @__PURE__ */ function(e) {
459
475
  return e.SevereAbuse = "severe_abuse", e.HighRiskScore = "high_risk_score", e.RepeatedWarnings = "repeated_warnings", e;
460
- }({}), Ke = o({
461
- id: f(),
476
+ }({}), Xe = o({
477
+ id: d(),
462
478
  messages: n(r()),
463
- title: f().nullable(),
464
- summary: f().nullable(),
465
- messageCountAtLastSummary: f().nullable(),
466
- createdAt: m(),
467
- updatedAt: m(),
468
- metadata: t(f(), r()),
469
- totalCostInUSD: f(),
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: f().nullable(),
472
- userId: f(),
473
- organizationId: f(),
474
- deleted: d(),
475
- deletedAt: m().nullable(),
476
- deletedBy: f().nullable(),
477
- conversationAnalysis: Be.nullable().optional(),
478
- blocked: d(),
479
- blockedAt: m().nullable(),
480
- blockedReasonCode: u(Ge).nullable(),
481
- blockedReason: f().nullable(),
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: m()
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: f().optional(),
497
- endDate: f().optional()
512
+ startDate: d().optional(),
513
+ endDate: d().optional()
498
514
  });
499
- var qe = o({
500
- id: f(),
501
- agentId: f().optional(),
502
- organizationId: f(),
503
- summary: f().optional(),
504
- title: f().optional(),
505
- userId: f(),
506
- createdAt: m(),
507
- updatedAt: m(),
508
- lastMessageAt: m(),
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: d()
511
- }), Je = class {
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
- }, Ye = class extends Je {}, G = class extends Ye {
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
- }, Xe = "__itself__", K = class extends Je {
542
+ }, et = "__itself__", K = class extends Qe {
527
543
  constructor(e, t, n) {
528
544
  super(e, n), this.field = t;
529
545
  }
530
- }, Ze = new Ye("__null__", null);
546
+ }, tt = new $e("__null__", null);
531
547
  Object.hasOwn;
532
- function Qe(e, t) {
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 $e(e, t) {
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 = Qe(e, t);
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 et = Object.defineProperty;
574
+ var it = Object.defineProperty;
559
575
  ((e, t) => {
560
576
  let n = {};
561
- for (var r in e) et(n, r, {
577
+ for (var r in e) it(n, r, {
562
578
  get: e[r],
563
579
  enumerable: !0
564
580
  });
565
- return t || et(n, Symbol.toStringTag, { value: "Module" }), n;
581
+ return t || it(n, Symbol.toStringTag, { value: "Module" }), n;
566
582
  })({
567
- $all: () => lt,
568
- $and: () => tt,
569
- $elemMatch: () => ot,
570
- $eq: () => ht,
571
- $exists: () => dt,
583
+ $all: () => pt,
584
+ $and: () => at,
585
+ $elemMatch: () => ut,
586
+ $eq: () => yt,
587
+ $exists: () => ht,
572
588
  $gt: () => J,
573
- $gte: () => ft,
589
+ $gte: () => gt,
574
590
  $in: () => q,
575
- $lt: () => pt,
576
- $lte: () => mt,
577
- $mod: () => ut,
578
- $ne: () => gt,
579
- $nin: () => ct,
580
- $nor: () => rt,
581
- $not: () => at,
582
- $options: () => vt,
583
- $or: () => nt,
584
- $regex: () => _t,
585
- $size: () => st,
586
- $where: () => yt
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 tt = {
604
+ var at = {
589
605
  type: "compound",
590
- validate: xt,
606
+ validate: Tt,
591
607
  parse(e, t, n) {
592
- let r = it(e, t, n);
593
- return $e(e.name, r);
608
+ let r = ct(e, t, n);
609
+ return rt(e.name, r);
594
610
  }
595
- }, nt = tt, rt = {
611
+ }, ot = at, st = {
596
612
  type: "compound",
597
- validate: xt,
613
+ validate: Tt,
598
614
  parse(e, t, n) {
599
- let r = it(e, t, n);
615
+ let r = ct(e, t, n);
600
616
  return new G(e.name, r);
601
617
  }
602
618
  };
603
- function it(e, t, n) {
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
- Ct(e, a, i), r[i] = n.parse(a);
623
+ Dt(e, a, i), r[i] = n.parse(a);
608
624
  }
609
625
  return r;
610
626
  }
611
- var at = {
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
- }, ot = {
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: Xe }) : n(t);
642
+ let a = i(t) ? n(t, { field: et }) : n(t);
627
643
  return new K(e.name, r, a);
628
644
  }
629
- }, st = {
645
+ }, dt = {
630
646
  type: "field",
631
647
  validate: Y("number")
632
648
  }, q = {
633
649
  type: "field",
634
- validate: bt
635
- }, ct = q, lt = q, ut = {
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
- }, dt = {
656
+ }, ht = {
641
657
  type: "field",
642
658
  validate: Y("boolean")
643
- }, ft = {
659
+ }, gt = {
644
660
  type: "field",
645
- validate: St
646
- }, J = ft, pt = J, mt = J, ht = { type: "field" }, gt = ht, _t = {
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
- }, vt = {
671
+ }, St = {
656
672
  type: "field",
657
- parse: () => Ze
658
- }, yt = {
673
+ parse: () => tt
674
+ }, Ct = {
659
675
  type: "document",
660
676
  validate: Y("function")
661
677
  };
662
- function bt(e, t) {
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 xt(e, t) {
666
- if (bt(e, t), !t.length) throw Error(`"${e.name}" expects to have at least one element in array`);
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 St(e, t) {
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 Ct(e, t, n) {
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
- }({}), wt = (e) => e ? [
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
- ] : [], Tt = ce({ modify: [
734
+ ] : [], kt = ce({ modify: [
719
735
  "read",
720
736
  "update",
721
737
  "delete"
722
- ] }), Et = se({ $or: nt });
723
- new oe(wt(), {
724
- conditionsMatcher: Et,
725
- resolveAction: Tt,
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 Dt(e, t, n = {}) {
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 Ot = Ke.or(qe);
766
+ var Mt = Xe.or(Ze);
751
767
  function $(e) {
752
- let t = Ot.safeParse(e);
768
+ let t = Mt.safeParse(e);
753
769
  return t.success ? t.data : e;
754
770
  }
755
- function kt(e) {
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 Dt(e.baseUrl, t, {
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 { V as a, I as c, xe as d, w as f, R as i, O as l, X as n, L as o, C as r, b as s, kt as t, ye as u };
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-BGkXm2NB.js.map
929
+ //# sourceMappingURL=createChatbotApiClient-2iaBCziJ.js.map