@8wave/ai-elements 0.98.0-beta.5 → 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.
- package/README.md +24 -5
- package/dist/_chunks/{PkToolShowForm-BNV4Ja6g.js → PkToolShowForm-dFuoqTPs.js} +84 -80
- package/dist/_chunks/PkToolShowForm-dFuoqTPs.js.map +1 -0
- package/dist/ai-elements.es.js +3153 -2982
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js → PkChatbot-BlG1WlAO.js} +7 -7
- package/dist-vue/_chunks/{PkChatbot-DHkhT0Jf.js.map → PkChatbot-BlG1WlAO.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-BrufA7o1.js +752 -0
- package/dist-vue/_chunks/PkChatbotMessages-BrufA7o1.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js → PkChatbotStepToolDetail-BVI72gyx.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-ldThv0t5.js.map → PkChatbotStepToolDetail-BVI72gyx.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-Dv9NkYER.js +172 -0
- package/dist-vue/_chunks/{PkChatbotSteps-BpqdFhsG.js.map → PkChatbotSteps-Dv9NkYER.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-C08TsXiL.js → PkChatbotViewChat-CAqvbbfN.js} +66 -66
- package/dist-vue/_chunks/PkChatbotViewChat-CAqvbbfN.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js → PkChatbotViewConversations-Cq41H-tc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BQZi5kSC.js.map → PkChatbotViewConversations-Cq41H-tc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js → PkChatbotViewFiles-DNuzmBJc.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-TLKE_tRw.js.map → PkChatbotViewFiles-DNuzmBJc.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js → PkChatbotViewProfile-C0BXIY2N.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-B6ANZY96.js.map → PkChatbotViewProfile-C0BXIY2N.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-C-mWyeka.js → PkToolShowForm-CQuX08lk.js} +62 -58
- package/dist-vue/_chunks/PkToolShowForm-CQuX08lk.js.map +1 -0
- package/dist-vue/_chunks/{createChatbotApiClient-BOBdBxmf.js → createChatbotApiClient-BMZltBLh.js} +367 -363
- package/dist-vue/_chunks/createChatbotApiClient-BMZltBLh.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js → useChatbotStore-DZiorgLW.js} +113 -103
- package/dist-vue/_chunks/{useChatbotStore-BJ-EDmND.js.map → useChatbotStore-DZiorgLW.js.map} +1 -1
- package/dist-vue/_chunks/{utils-BMa8jwJS.js → utils-Cru8TJxe.js} +48 -30
- package/dist-vue/_chunks/utils-Cru8TJxe.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +3 -3
- package/dist-vue/index.js +4351 -4041
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +16 -0
- package/dist-vue/packages/components/src/PkCheckboxField.d.ts +45 -0
- package/dist-vue/packages/components/src/PkEditorRepeater.d.ts +2 -2
- package/dist-vue/packages/components/src/PkPwaInstallPrompt.d.ts +4 -0
- package/dist-vue/packages/components/src/PkPwaOfflineNotice.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +11 -2
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +24 -2
- package/dist-vue/packages/components/src/chat/PkToolApprovalBadge.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkToolApprovalCard.d.ts +35 -0
- package/dist-vue/packages/components/src/chat/PkToolApprovalPreviewMessage.d.ts +11 -0
- package/dist-vue/packages/components/src/chat/index.d.ts +2 -1
- package/dist-vue/packages/components/src/chat/toolApprovalPreviews.d.ts +12 -0
- package/dist-vue/packages/components/src/chat/toolComponentMap.d.ts +5 -3
- package/dist-vue/packages/components/src/chat/useChatScroll.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +13 -0
- package/dist-vue/packages/components/src/index.d.ts +4 -1
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +34 -1
- package/dist-vue/packages/models/src/schema/Agent.d.ts +48 -0
- package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +6 -0
- package/dist-vue/packages/models/src/schema/SubAgent.d.ts +6 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js +0 -48
- package/dist/_chunks/PkToolRequestConfirm-FQ9nDFXy.js.map +0 -1
- package/dist/_chunks/PkToolShowForm-BNV4Ja6g.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js +0 -630
- package/dist-vue/_chunks/PkChatbotMessages-B4qfTNOJ.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-BpqdFhsG.js +0 -172
- package/dist-vue/_chunks/PkChatbotViewChat-C08TsXiL.js.map +0 -1
- package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js +0 -48
- package/dist-vue/_chunks/PkToolRequestConfirm-CQNa3seA.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowForm-C-mWyeka.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BOBdBxmf.js.map +0 -1
- package/dist-vue/_chunks/utils-BMa8jwJS.js.map +0 -1
- package/dist-vue/packages/components/src/chat/PkToolRequestConfirm.d.ts +0 -11
package/dist-vue/_chunks/{createChatbotApiClient-BOBdBxmf.js → createChatbotApiClient-BMZltBLh.js}
RENAMED
|
@@ -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
|
|
2
|
-
import { i as
|
|
3
|
-
import { a as
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, d as i, f as a, g as o, h as s, i as ee, l as c, n as l, o as u, v as d, x as f } from "./schemas-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
|
|
6
|
-
import { Ability as
|
|
7
|
-
import { createAccessControl as
|
|
8
|
-
import { adminAc as
|
|
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
|
|
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.
|
|
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
|
-
}({}),
|
|
19
|
-
reasoningEffort:
|
|
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:
|
|
26
|
+
reasoningSummary: l([
|
|
27
27
|
"auto",
|
|
28
28
|
"detailed",
|
|
29
29
|
"concise"
|
|
30
30
|
]).optional()
|
|
31
|
-
}),
|
|
32
|
-
type:
|
|
31
|
+
}), pe = o({
|
|
32
|
+
type: l([
|
|
33
33
|
"adaptive",
|
|
34
34
|
"enabled",
|
|
35
35
|
"disabled"
|
|
36
36
|
]).optional(),
|
|
37
|
-
effort:
|
|
37
|
+
effort: l([
|
|
38
38
|
"low",
|
|
39
39
|
"medium",
|
|
40
40
|
"high",
|
|
41
41
|
"xhigh",
|
|
42
42
|
"max"
|
|
43
43
|
]).optional(),
|
|
44
|
-
display:
|
|
44
|
+
display: l(["summarized", "omitted"]).optional(),
|
|
45
45
|
budgetTokens: s().int().positive().optional()
|
|
46
|
-
}),
|
|
47
|
-
thinkingLevel:
|
|
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:
|
|
55
|
-
}),
|
|
56
|
-
openai:
|
|
57
|
-
anthropic:
|
|
58
|
-
google:
|
|
59
|
-
deepseek:
|
|
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
|
|
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
|
|
77
|
-
function
|
|
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
|
|
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 ===
|
|
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
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
|
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
|
-
}),
|
|
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:
|
|
130
|
-
searchLanguageFilter: n(
|
|
131
|
-
searchDomainFilter: n(
|
|
132
|
-
searchRecencyFilter:
|
|
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:
|
|
142
|
+
mode: l(["one-shot", "agentic"]).optional(),
|
|
140
143
|
maxResults: s().int().min(1).max(20).optional(),
|
|
141
144
|
sourcePolicy: o({
|
|
142
|
-
includeDomains: n(
|
|
143
|
-
excludeDomains: n(
|
|
144
|
-
afterDate:
|
|
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(
|
|
156
|
-
blockedDomains: n(
|
|
158
|
+
allowedDomains: n(d()).optional(),
|
|
159
|
+
blockedDomains: n(d()).optional(),
|
|
157
160
|
userLocation: o({
|
|
158
161
|
type: a("approximate").optional(),
|
|
159
|
-
country:
|
|
160
|
-
region:
|
|
161
|
-
city:
|
|
162
|
-
timezone:
|
|
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
|
-
}),
|
|
167
|
-
enabled:
|
|
168
|
-
provider:
|
|
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
|
-
}),
|
|
173
|
-
disabled: n(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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:
|
|
180
|
-
webSearch:
|
|
181
|
-
userMemory:
|
|
182
|
-
userFiles:
|
|
183
|
-
|
|
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:
|
|
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:
|
|
193
|
+
priority: o({ enabled: u().default(!0) }).prefault({}),
|
|
190
194
|
mmr: o({
|
|
191
|
-
enabled:
|
|
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({}),
|
|
196
|
-
prompt:
|
|
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:
|
|
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:
|
|
205
|
-
ranking:
|
|
206
|
-
}),
|
|
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
|
-
}({}),
|
|
212
|
+
}({}), M = /* @__PURE__ */ function(e) {
|
|
209
213
|
return e.Frontoffice = "frontoffice", e.App = "app", e.Widget = "widget", e;
|
|
210
|
-
}({}),
|
|
211
|
-
media:
|
|
212
|
-
logo:
|
|
213
|
-
theme:
|
|
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:
|
|
219
|
-
textColor:
|
|
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:
|
|
225
|
-
initialMessage:
|
|
226
|
-
greeting: n(
|
|
227
|
-
messagePlaceholder:
|
|
228
|
-
dismissableNotice:
|
|
229
|
-
footerMessage:
|
|
230
|
-
privacyPolicyNotice:
|
|
231
|
-
interactiveLogin:
|
|
232
|
-
welcomePopup:
|
|
233
|
-
floatingButtonPosition:
|
|
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:
|
|
239
|
+
widgetUrl: f().default(A),
|
|
236
240
|
loadDelay: s().int().min(0).max(3e4).optional().default(0),
|
|
237
|
-
loaderStrategy:
|
|
238
|
-
customCss:
|
|
239
|
-
smoothStream:
|
|
240
|
-
showExtendedSteps:
|
|
241
|
-
}),
|
|
242
|
-
enabled:
|
|
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(
|
|
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
|
-
}),
|
|
257
|
-
zeroDataRetention:
|
|
258
|
-
disallowPromptTraining:
|
|
260
|
+
}), I = o({
|
|
261
|
+
zeroDataRetention: u().default(!0),
|
|
262
|
+
disallowPromptTraining: u().default(!0),
|
|
259
263
|
providerTimeoutMs: s().int().min(1e3).max(789e3).optional()
|
|
260
|
-
}),
|
|
261
|
-
model:
|
|
262
|
-
interface:
|
|
263
|
-
tools:
|
|
264
|
-
fileUpload:
|
|
265
|
-
gatewayOptions:
|
|
266
|
-
channels: n(
|
|
267
|
-
externalContextSchema:
|
|
268
|
-
}),
|
|
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(
|
|
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:
|
|
279
|
-
name:
|
|
280
|
-
prompt:
|
|
281
|
-
model:
|
|
282
|
-
fallbackModels: n(
|
|
283
|
-
status:
|
|
284
|
-
visibility:
|
|
285
|
-
settings:
|
|
286
|
-
security:
|
|
287
|
-
type:
|
|
288
|
-
organizationId:
|
|
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:
|
|
291
|
-
name:
|
|
292
|
-
prompt:
|
|
293
|
-
model:
|
|
294
|
-
fallbackModels: n(
|
|
295
|
-
status:
|
|
296
|
-
visibility:
|
|
297
|
-
settings:
|
|
298
|
-
security:
|
|
299
|
-
type:
|
|
300
|
-
organizationId:
|
|
301
|
-
createdAt:
|
|
302
|
-
createdBy:
|
|
303
|
-
updatedAt:
|
|
304
|
-
updatedBy:
|
|
305
|
-
deleted:
|
|
306
|
-
deletedAt:
|
|
307
|
-
deletedBy:
|
|
308
|
-
outOfBudget:
|
|
309
|
-
outOfBudgetReason:
|
|
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
|
|
312
|
-
id:
|
|
313
|
-
name:
|
|
314
|
-
status:
|
|
315
|
-
visibility:
|
|
316
|
-
organizationId:
|
|
317
|
-
interface:
|
|
318
|
-
createdAt:
|
|
319
|
-
updatedAt:
|
|
320
|
-
capabilities: o({ fileUpload:
|
|
321
|
-
channels: n(
|
|
322
|
-
}),
|
|
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
|
-
}),
|
|
333
|
+
}), Me = z.pick({
|
|
330
334
|
id: !0,
|
|
331
335
|
name: !0,
|
|
332
336
|
organizationId: !0
|
|
333
|
-
}).extend({ interface:
|
|
334
|
-
emailPassword:
|
|
335
|
-
google:
|
|
336
|
-
microsoft:
|
|
337
|
-
}),
|
|
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:
|
|
340
|
-
branding:
|
|
341
|
-
}),
|
|
343
|
+
agent: z,
|
|
344
|
+
branding: ee()
|
|
345
|
+
}), H = o({
|
|
342
346
|
requiresAuth: a(!0),
|
|
343
|
-
agent:
|
|
344
|
-
branding:
|
|
347
|
+
agent: ee(),
|
|
348
|
+
branding: Me
|
|
345
349
|
});
|
|
346
|
-
|
|
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
|
-
...
|
|
351
|
-
...
|
|
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
|
-
...
|
|
362
|
-
...
|
|
363
|
-
...
|
|
364
|
-
...
|
|
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
|
|
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
|
-
}({}),
|
|
374
|
+
}({}), Pe = /* @__PURE__ */ function(e) {
|
|
371
375
|
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
372
|
-
}({}),
|
|
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
|
-
}({}),
|
|
378
|
+
}({}), Ie = /* @__PURE__ */ function(e) {
|
|
375
379
|
return e.SummaryCycle = "summary_cycle", e.AgentRequest = "agent_request", e.Manual = "manual", e;
|
|
376
|
-
}({}),
|
|
380
|
+
}({}), Le = /* @__PURE__ */ function(e) {
|
|
377
381
|
return e.High = "high", e.Medium = "medium", e.Low = "low", e.Disengaged = "disengaged", e;
|
|
378
|
-
}({}),
|
|
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
|
-
}({}),
|
|
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
|
-
}({}),
|
|
386
|
+
}({}), Be = /* @__PURE__ */ function(e) {
|
|
383
387
|
return e.Improving = "improving", e.Stable = "stable", e.Degrading = "degrading", e;
|
|
384
|
-
}({}),
|
|
385
|
-
analyzedAt:
|
|
386
|
-
analysisTrigger:
|
|
387
|
-
sentiment:
|
|
388
|
-
sentimentTrend:
|
|
389
|
-
userTone:
|
|
390
|
-
language:
|
|
391
|
-
topics: n(
|
|
392
|
-
userAbuseDetected:
|
|
393
|
-
userAbuseCategories: n(
|
|
394
|
-
userAbuseConfidence:
|
|
395
|
-
userAbuseSummary:
|
|
396
|
-
llmIssueDetected:
|
|
397
|
-
llmIssueCategories: n(
|
|
398
|
-
llmIssueSummary:
|
|
399
|
-
userEngagement:
|
|
400
|
-
conversationGoalMet:
|
|
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
|
-
}),
|
|
403
|
-
dateTime:
|
|
404
|
-
timezone:
|
|
405
|
-
language:
|
|
406
|
-
languages: n(
|
|
407
|
-
url:
|
|
408
|
-
pathname:
|
|
409
|
-
pageTitle:
|
|
410
|
-
referrer:
|
|
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:
|
|
420
|
-
connectionType:
|
|
421
|
-
connectionEffectiveType:
|
|
423
|
+
platform: d().optional(),
|
|
424
|
+
connectionType: d().optional(),
|
|
425
|
+
connectionEffectiveType: d().optional(),
|
|
422
426
|
connectionDownlink: s().optional(),
|
|
423
427
|
connectionRtt: s().optional(),
|
|
424
|
-
saveData:
|
|
425
|
-
darkMode:
|
|
426
|
-
reducedMotion:
|
|
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:
|
|
432
|
-
}),
|
|
435
|
+
geolocationCity: d().optional()
|
|
436
|
+
}), Ue = c("type", [o({
|
|
433
437
|
type: a("text"),
|
|
434
|
-
text:
|
|
438
|
+
text: d()
|
|
435
439
|
}), o({
|
|
436
440
|
type: a("file"),
|
|
437
|
-
mediaType:
|
|
438
|
-
url:
|
|
439
|
-
filename:
|
|
440
|
-
providerMetadata: t(
|
|
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:
|
|
447
|
+
id: d(),
|
|
444
448
|
messages: n(o({
|
|
445
|
-
id:
|
|
446
|
-
role:
|
|
447
|
-
content:
|
|
448
|
-
parts: n(
|
|
449
|
-
createdAt:
|
|
449
|
+
id: d().optional(),
|
|
450
|
+
role: l(["assistant", "user"]),
|
|
451
|
+
content: d(),
|
|
452
|
+
parts: n(Ue),
|
|
453
|
+
createdAt: d().optional()
|
|
450
454
|
})),
|
|
451
|
-
model:
|
|
455
|
+
model: d().optional(),
|
|
452
456
|
temperature: s().optional(),
|
|
453
|
-
prompt:
|
|
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:
|
|
461
|
+
searchMode: l(S).optional(),
|
|
458
462
|
limit: s().optional(),
|
|
459
|
-
ranking:
|
|
460
|
-
reasoning:
|
|
461
|
-
webSearch:
|
|
463
|
+
ranking: O.optional(),
|
|
464
|
+
reasoning: C,
|
|
465
|
+
webSearch: D.optional(),
|
|
462
466
|
maxStepCount: s().int().min(1).max(40).optional(),
|
|
463
|
-
disabledTools: n(
|
|
464
|
-
fallbackModels: n(
|
|
465
|
-
gatewayOptions:
|
|
466
|
-
deviceContext:
|
|
467
|
-
externalContext: t(
|
|
468
|
-
smoothStream:
|
|
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
|
|
474
|
+
var We = /* @__PURE__ */ function(e) {
|
|
471
475
|
return e.SevereAbuse = "severe_abuse", e.HighRiskScore = "high_risk_score", e.RepeatedWarnings = "repeated_warnings", e;
|
|
472
|
-
}({}),
|
|
473
|
-
id:
|
|
476
|
+
}({}), Ge = o({
|
|
477
|
+
id: d(),
|
|
474
478
|
messages: n(r()),
|
|
475
|
-
title:
|
|
476
|
-
summary:
|
|
477
|
-
messageCountAtLastSummary:
|
|
478
|
-
createdAt:
|
|
479
|
-
updatedAt:
|
|
480
|
-
metadata: t(
|
|
481
|
-
totalCostInUSD:
|
|
479
|
+
title: d().nullable(),
|
|
480
|
+
summary: d().nullable(),
|
|
481
|
+
messageCountAtLastSummary: d().nullable(),
|
|
482
|
+
createdAt: p(),
|
|
483
|
+
updatedAt: p(),
|
|
484
|
+
metadata: t(d(), r()),
|
|
485
|
+
totalCostInUSD: d(),
|
|
482
486
|
usage: r(),
|
|
483
|
-
agentId:
|
|
484
|
-
userId:
|
|
485
|
-
organizationId:
|
|
486
|
-
deleted:
|
|
487
|
-
deletedAt:
|
|
488
|
-
deletedBy:
|
|
489
|
-
conversationAnalysis:
|
|
490
|
-
blocked:
|
|
491
|
-
blockedAt:
|
|
492
|
-
blockedReasonCode:
|
|
493
|
-
blockedReason:
|
|
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:
|
|
499
|
+
lastMessageAt: p()
|
|
496
500
|
});
|
|
497
501
|
o({
|
|
498
|
-
...
|
|
499
|
-
...
|
|
502
|
+
...g.pagination(),
|
|
503
|
+
...g.sort([
|
|
500
504
|
"updatedAt",
|
|
501
505
|
"createdAt",
|
|
502
506
|
"lastMessageAt"
|
|
503
507
|
]),
|
|
504
|
-
...
|
|
505
|
-
...
|
|
506
|
-
...
|
|
507
|
-
...
|
|
508
|
-
startDate:
|
|
509
|
-
endDate:
|
|
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
|
|
512
|
-
id:
|
|
513
|
-
agentId:
|
|
514
|
-
organizationId:
|
|
515
|
-
summary:
|
|
516
|
-
title:
|
|
517
|
-
userId:
|
|
518
|
-
createdAt:
|
|
519
|
-
updatedAt:
|
|
520
|
-
lastMessageAt:
|
|
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:
|
|
523
|
-
}),
|
|
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
|
-
},
|
|
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
|
-
},
|
|
542
|
+
}, qe = "__itself__", K = class extends U {
|
|
539
543
|
constructor(e, t, n) {
|
|
540
544
|
super(e, n), this.field = t;
|
|
541
545
|
}
|
|
542
|
-
},
|
|
546
|
+
}, Je = new W("__null__", null);
|
|
543
547
|
Object.hasOwn;
|
|
544
|
-
function
|
|
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
|
|
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 =
|
|
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
|
|
574
|
+
var Ze = Object.defineProperty;
|
|
571
575
|
((e, t) => {
|
|
572
576
|
let n = {};
|
|
573
|
-
for (var r in e)
|
|
577
|
+
for (var r in e) Ze(n, r, {
|
|
574
578
|
get: e[r],
|
|
575
579
|
enumerable: !0
|
|
576
580
|
});
|
|
577
|
-
return t ||
|
|
581
|
+
return t || Ze(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
578
582
|
})({
|
|
579
|
-
$all: () =>
|
|
580
|
-
$and: () =>
|
|
581
|
-
$elemMatch: () =>
|
|
582
|
-
$eq: () =>
|
|
583
|
-
$exists: () =>
|
|
583
|
+
$all: () => ot,
|
|
584
|
+
$and: () => Qe,
|
|
585
|
+
$elemMatch: () => rt,
|
|
586
|
+
$eq: () => ft,
|
|
587
|
+
$exists: () => ct,
|
|
584
588
|
$gt: () => J,
|
|
585
|
-
$gte: () =>
|
|
589
|
+
$gte: () => lt,
|
|
586
590
|
$in: () => q,
|
|
587
|
-
$lt: () =>
|
|
588
|
-
$lte: () =>
|
|
589
|
-
$mod: () =>
|
|
590
|
-
$ne: () =>
|
|
591
|
-
$nin: () =>
|
|
592
|
-
$nor: () =>
|
|
593
|
-
$not: () =>
|
|
594
|
-
$options: () =>
|
|
595
|
-
$or: () =>
|
|
596
|
-
$regex: () =>
|
|
597
|
-
$size: () =>
|
|
598
|
-
$where: () =>
|
|
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
|
|
604
|
+
var Qe = {
|
|
601
605
|
type: "compound",
|
|
602
|
-
validate:
|
|
606
|
+
validate: vt,
|
|
603
607
|
parse(e, t, n) {
|
|
604
|
-
let r =
|
|
605
|
-
return
|
|
608
|
+
let r = tt(e, t, n);
|
|
609
|
+
return Xe(e.name, r);
|
|
606
610
|
}
|
|
607
|
-
},
|
|
611
|
+
}, $e = Qe, et = {
|
|
608
612
|
type: "compound",
|
|
609
|
-
validate:
|
|
613
|
+
validate: vt,
|
|
610
614
|
parse(e, t, n) {
|
|
611
|
-
let r =
|
|
615
|
+
let r = tt(e, t, n);
|
|
612
616
|
return new G(e.name, r);
|
|
613
617
|
}
|
|
614
618
|
};
|
|
615
|
-
function
|
|
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
|
-
|
|
623
|
+
bt(e, a, i), r[i] = n.parse(a);
|
|
620
624
|
}
|
|
621
625
|
return r;
|
|
622
626
|
}
|
|
623
|
-
var
|
|
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
|
-
},
|
|
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:
|
|
642
|
+
let a = i(t) ? n(t, { field: qe }) : n(t);
|
|
639
643
|
return new K(e.name, r, a);
|
|
640
644
|
}
|
|
641
|
-
},
|
|
645
|
+
}, it = {
|
|
642
646
|
type: "field",
|
|
643
647
|
validate: Y("number")
|
|
644
648
|
}, q = {
|
|
645
649
|
type: "field",
|
|
646
|
-
validate:
|
|
647
|
-
},
|
|
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
|
-
},
|
|
656
|
+
}, ct = {
|
|
653
657
|
type: "field",
|
|
654
658
|
validate: Y("boolean")
|
|
655
|
-
},
|
|
659
|
+
}, lt = {
|
|
656
660
|
type: "field",
|
|
657
|
-
validate:
|
|
658
|
-
}, J =
|
|
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
|
-
},
|
|
671
|
+
}, ht = {
|
|
668
672
|
type: "field",
|
|
669
|
-
parse: () =>
|
|
670
|
-
},
|
|
673
|
+
parse: () => Je
|
|
674
|
+
}, gt = {
|
|
671
675
|
type: "document",
|
|
672
676
|
validate: Y("function")
|
|
673
677
|
};
|
|
674
|
-
function
|
|
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
|
|
678
|
-
if (
|
|
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
|
|
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
|
|
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
|
-
}({}),
|
|
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:
|
|
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
|
-
] : [],
|
|
734
|
+
] : [], St = se({ modify: [
|
|
731
735
|
"read",
|
|
732
736
|
"update",
|
|
733
737
|
"delete"
|
|
734
|
-
] }),
|
|
735
|
-
new
|
|
736
|
-
conditionsMatcher:
|
|
737
|
-
resolveAction:
|
|
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 =
|
|
741
|
-
Q.newRole(
|
|
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
|
|
748
|
+
async function wt(e, t, n = {}) {
|
|
745
749
|
try {
|
|
746
|
-
let r =
|
|
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
|
|
766
|
+
var Tt = Ge.or(Ke);
|
|
763
767
|
function $(e) {
|
|
764
|
-
let t =
|
|
768
|
+
let t = Tt.safeParse(e);
|
|
765
769
|
return t.success ? t.data : e;
|
|
766
770
|
}
|
|
767
|
-
function
|
|
768
|
-
let t = e.basePath ?
|
|
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
|
|
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 {
|
|
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-
|
|
929
|
+
//# sourceMappingURL=createChatbotApiClient-BMZltBLh.js.map
|