@8wave/ai-elements 0.87.0 → 0.88.0

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