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