@8wave/ai-elements 0.115.0-beta.2 → 0.115.0-beta.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{PkToolShowSources-VFoI0YS8.js → PkToolShowSources-ClqmBUMB.js} +2 -2
- package/dist/_chunks/{PkToolShowSources-VFoI0YS8.js.map → PkToolShowSources-ClqmBUMB.js.map} +1 -1
- package/dist/_chunks/{markdown-BL7WANiX.js → markdown-BAq2EAVh.js} +36 -11
- package/dist/_chunks/markdown-BAq2EAVh.js.map +1 -0
- package/dist/ai-elements.es.js +1677 -1568
- 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/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/{Document-nCWwJC2h.js → Document-CRiJBpnk.js} +37 -12
- package/dist-vue/_chunks/Document-CRiJBpnk.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbot-CdtYJ1Lf.js → PkChatbot-_7hJo-g0.js} +6 -6
- package/dist-vue/_chunks/{PkChatbot-CdtYJ1Lf.js.map → PkChatbot-_7hJo-g0.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotFilePreview-CwiVQDF2.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotInput-DcLmOqA1.js.map +1 -1
- package/dist-vue/_chunks/PkChatbotMessageFeedback-BYmrVaCE.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-R1EsTJpM.js → PkChatbotMessages-ClPdP7sw.js} +109 -100
- package/dist-vue/_chunks/PkChatbotMessages-ClPdP7sw.js.map +1 -0
- package/dist-vue/_chunks/PkChatbotSteps-CPPjwTJN.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-CbqrHEC6.js → PkChatbotViewChat-BBYfIQBR.js} +5 -5
- package/dist-vue/_chunks/{PkChatbotViewChat-CbqrHEC6.js.map → PkChatbotViewChat-BBYfIQBR.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js → PkChatbotViewConversations-DvmRjVND.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js.map → PkChatbotViewConversations-DvmRjVND.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-Bk9-K6Hw.js → PkChatbotViewFiles-D7KcAEiB.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-Bk9-K6Hw.js.map → PkChatbotViewFiles-D7KcAEiB.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js → PkChatbotViewProfile-C1eLHU7x.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js.map → PkChatbotViewProfile-C1eLHU7x.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-Dmtqu3th.js → PkToolShowDiagram-Co3GRItt.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-Dmtqu3th.js.map → PkToolShowDiagram-Co3GRItt.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-TzkNgwnr.js → PkToolShowSources-CIccPA8Z.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSources-TzkNgwnr.js.map → PkToolShowSources-CIccPA8Z.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BlWs282E.js → createChatbotApiClient-BJz36z7v.js} +110 -110
- package/dist-vue/_chunks/createChatbotApiClient-BJz36z7v.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js → useChatbotStore-D3Q1ZgQg.js} +2 -2
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js.map → useChatbotStore-D3Q1ZgQg.js.map} +1 -1
- package/dist-vue/api.js +1 -1
- package/dist-vue/composables.js +110 -10
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +12 -9
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +4 -0
- package/dist-vue/packages/auth/src/active-membership.d.ts +36 -0
- package/dist-vue/packages/auth/src/add-member-to-organization.d.ts +5 -1
- package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +1 -1
- package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +3 -3
- package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +1 -1
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +5 -0
- package/dist-vue/packages/models/src/schema/AgentApiTool.d.ts +5 -8
- package/dist-vue/packages/models/src/schema/ConversationAnalysis.d.ts +6 -1
- package/dist-vue/packages/models/src/schema/Document.d.ts +477 -0
- package/dist-vue/packages/models/src/schema/Header.d.ts +39 -0
- package/dist-vue/packages/models/src/schema/McpServer.d.ts +76 -8
- package/dist-vue/packages/models/src/schema/Notification.d.ts +2 -0
- package/dist-vue/packages/models/src/schema/SignInSecurity.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/markdown-BL7WANiX.js.map +0 -1
- package/dist-vue/_chunks/Document-nCWwJC2h.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-R1EsTJpM.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +0 -1
package/dist-vue/_chunks/{createChatbotApiClient-BlWs282E.js → createChatbotApiClient-BJz36z7v.js}
RENAMED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { C as e, S as t, _ as n, a as r, b as i, g as a, l as o, n as s, o as c, p as l, y as u } from "./schemas-DxbHVg3r.js";
|
|
2
2
|
import { i as d, t as ee } from "./Media-_HfFLHGD.js";
|
|
3
|
-
import { M as f, a as
|
|
4
|
-
import { t as
|
|
3
|
+
import { M as f, a as te, b as p, c as m, f as h, j as g, k as ne, l as re, n as ie, s as ae } from "./Agent-tbKw8Mdt.js";
|
|
4
|
+
import { t as oe } from "./StreamError-D1AtGgS3.js";
|
|
5
5
|
import "./src-DT8FLE4_.js";
|
|
6
|
-
import { r as
|
|
7
|
-
import { buildMongoQueryMatcher as
|
|
8
|
-
import { createAccessControl as
|
|
9
|
-
import { adminAc as
|
|
6
|
+
import { r as _, t as se } from "./url-validation-uLMZ5-AU.js";
|
|
7
|
+
import { buildMongoQueryMatcher as ce, createAliasResolver as le } from "@casl/ability";
|
|
8
|
+
import { createAccessControl as ue } from "better-auth/plugins";
|
|
9
|
+
import { adminAc as de, defaultStatements as fe, memberAc as v, ownerAc as pe } from "better-auth/plugins/organization/access";
|
|
10
10
|
//#region ../../packages/models/src/schema/ConversationAnalysis.ts
|
|
11
|
-
var
|
|
11
|
+
var me = /* @__PURE__ */ function(e) {
|
|
12
12
|
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;
|
|
13
|
-
}({}),
|
|
13
|
+
}({}), he = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
15
|
-
}({}),
|
|
16
|
-
return e.FalseSuccess = "false_success", e.Hallucination = "hallucination", e.OffBrand = "off_brand", e.DataLeak = "data_leak", e.InappropriateTone = "inappropriate_tone", e.RefusalLoop = "refusal_loop", e.Repetition = "repetition", e;
|
|
15
|
+
}({}), ge = /* @__PURE__ */ function(e) {
|
|
16
|
+
return e.FalseSuccess = "false_success", e.Hallucination = "hallucination", e.OffBrand = "off_brand", e.DataLeak = "data_leak", e.InappropriateTone = "inappropriate_tone", e.RefusalLoop = "refusal_loop", e.Repetition = "repetition", e.FailedAction = "failed_action", e.EmptyReply = "empty_reply", e.StuckFlow = "stuck_flow", e;
|
|
17
17
|
}({}), y = /* @__PURE__ */ function(e) {
|
|
18
18
|
return e.SummaryCycle = "summary_cycle", e.AgentRequest = "agent_request", e.Manual = "manual", e;
|
|
19
19
|
}({}), b = /* @__PURE__ */ function(e) {
|
|
@@ -24,7 +24,7 @@ var he = /* @__PURE__ */ function(e) {
|
|
|
24
24
|
return e.Positive = "positive", e.Neutral = "neutral", e.Negative = "negative", e.Frustrated = "frustrated", e.Excited = "excited", e;
|
|
25
25
|
}({}), C = /* @__PURE__ */ function(e) {
|
|
26
26
|
return e.Improving = "improving", e.Stable = "stable", e.Degrading = "degrading", e;
|
|
27
|
-
}({}), w = n({
|
|
27
|
+
}({}), w = 1e3, T = n({
|
|
28
28
|
analyzedAt: d().describe("When the analysis was generated."),
|
|
29
29
|
analysisTrigger: s(y).describe("What triggered this analysis run."),
|
|
30
30
|
sentiment: s(S).describe("Overall user sentiment in the conversation."),
|
|
@@ -33,32 +33,32 @@ var he = /* @__PURE__ */ function(e) {
|
|
|
33
33
|
language: i().max(10).describe("ISO 639-1 language code of the conversation (e.g. \"en\", \"it\")."),
|
|
34
34
|
topics: r(i().max(100)).max(10).describe("Main topics discussed, as short lowercase labels."),
|
|
35
35
|
userAbuseDetected: c().describe("Whether user abuse was detected. If false, userAbuseCategories MUST be empty."),
|
|
36
|
-
userAbuseCategories: r(s(
|
|
37
|
-
userAbuseConfidence: s(
|
|
38
|
-
userAbuseSummary: i().max(
|
|
36
|
+
userAbuseCategories: r(s(me)).default([]).describe("Abuse categories detected. Non-empty only if userAbuseDetected is true."),
|
|
37
|
+
userAbuseConfidence: s(he).optional().describe("Confidence level of the abuse detection. Set only if userAbuseDetected is true."),
|
|
38
|
+
userAbuseSummary: i().max(w).optional().describe("Brief description of the abusive behavior detected. Always write in English. Set only if userAbuseDetected is true."),
|
|
39
39
|
llmIssueDetected: c().describe("Whether an LLM quality issue was detected. If false, llmIssueCategories MUST be empty."),
|
|
40
|
-
llmIssueCategories: r(s(
|
|
41
|
-
llmIssueSummary: i().max(
|
|
40
|
+
llmIssueCategories: r(s(ge)).default([]).describe("LLM issue categories detected. Non-empty only if llmIssueDetected is true."),
|
|
41
|
+
llmIssueSummary: i().max(w).optional().describe("Brief description of the LLM quality issue detected. Always write in English. Set only if llmIssueDetected is true."),
|
|
42
42
|
userEngagement: s(b).describe("Level of user engagement in the conversation."),
|
|
43
43
|
conversationGoalMet: c().optional().describe("Whether the user seems to have achieved what they came for. Leave undefined if unclear."),
|
|
44
44
|
riskScore: a().int().min(0).max(100).describe("Overall risk score (0 = safe, 100 = critical). Combination of abuse severity, persistence and escalation.")
|
|
45
|
-
}),
|
|
45
|
+
}), E = n({
|
|
46
46
|
type: l("text"),
|
|
47
47
|
text: i()
|
|
48
|
-
}),
|
|
48
|
+
}), D = n({
|
|
49
49
|
type: l("file"),
|
|
50
50
|
mediaType: i().regex(ee),
|
|
51
51
|
url: e(),
|
|
52
52
|
filename: i().optional(),
|
|
53
53
|
providerMetadata: u(i(), u(i(), t())).optional()
|
|
54
|
-
}),
|
|
54
|
+
}), O = o("type", [E, D]);
|
|
55
55
|
n({
|
|
56
56
|
id: i(),
|
|
57
57
|
messages: r(n({
|
|
58
58
|
id: i().optional(),
|
|
59
59
|
role: s(["assistant", "user"]),
|
|
60
60
|
content: i(),
|
|
61
|
-
parts: r(
|
|
61
|
+
parts: r(O),
|
|
62
62
|
createdAt: i().optional()
|
|
63
63
|
})),
|
|
64
64
|
model: i().optional(),
|
|
@@ -67,29 +67,29 @@ n({
|
|
|
67
67
|
maxOutputTokens: a().positive().optional(),
|
|
68
68
|
presencePenalty: a().min(-2).max(2).optional(),
|
|
69
69
|
frequencyPenalty: a().min(-2).max(2).optional(),
|
|
70
|
-
searchMode: s(
|
|
70
|
+
searchMode: s(re).optional(),
|
|
71
71
|
limit: a().optional(),
|
|
72
|
-
ranking:
|
|
73
|
-
reasoning:
|
|
74
|
-
webSearch:
|
|
72
|
+
ranking: ae.optional(),
|
|
73
|
+
reasoning: m,
|
|
74
|
+
webSearch: h.optional(),
|
|
75
75
|
maxStepCount: a().int().min(1).max(40).optional(),
|
|
76
|
-
disabledTools: r(s(
|
|
76
|
+
disabledTools: r(s(ie)).optional(),
|
|
77
77
|
fallbackModels: r(i()).optional(),
|
|
78
|
-
gatewayOptions:
|
|
79
|
-
deviceContext:
|
|
78
|
+
gatewayOptions: te.partial().optional(),
|
|
79
|
+
deviceContext: ne.optional(),
|
|
80
80
|
externalContext: u(i(), t()).optional(),
|
|
81
81
|
smoothStream: c().optional()
|
|
82
82
|
}), n({
|
|
83
83
|
id: i().min(1),
|
|
84
84
|
messages: r(n({ role: i() }).loose()).min(1)
|
|
85
85
|
}).loose();
|
|
86
|
-
var
|
|
86
|
+
var k = /* @__PURE__ */ function(e) {
|
|
87
87
|
return e.SevereAbuse = "severe_abuse", e.HighRiskScore = "high_risk_score", e.RepeatedWarnings = "repeated_warnings", e;
|
|
88
88
|
}({});
|
|
89
89
|
s(/* @__PURE__ */ function(e) {
|
|
90
90
|
return e.Web = "web", e.WhatsApp = "whatsapp", e.Teams = "teams", e.Voice = "voice", e.Api = "api", e.Reasoning = "reasoning", e.Endpoint = "endpoint", e;
|
|
91
91
|
}({}));
|
|
92
|
-
function
|
|
92
|
+
function A(e) {
|
|
93
93
|
let t = e.metadata?.toolCatalogue, n = t?.workingSet;
|
|
94
94
|
if (!t || !n) return;
|
|
95
95
|
let r = new Map(t.groups.flatMap((e) => e.keys.map((t) => [t, e.id]))), i = new Map(t.groups.map((e) => [e.name, e.id])), a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
|
|
@@ -104,8 +104,8 @@ function k(e) {
|
|
|
104
104
|
}
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
|
-
let n =
|
|
108
|
-
s && (t.state === "output-error" &&
|
|
107
|
+
let n = g(e, r.keys()), s = n && r.get(n);
|
|
108
|
+
s && (t.state === "output-error" && oe.test(t.errorText ?? "") ? o.add(s) : a.add(s));
|
|
109
109
|
}
|
|
110
110
|
let s = new Set(n.selected), c = new Set(n.seeded), l = t.groups.map((e) => ({
|
|
111
111
|
id: e.id,
|
|
@@ -124,18 +124,18 @@ function k(e) {
|
|
|
124
124
|
missed: l.filter((e) => e.used && !e.selected).length
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
var
|
|
127
|
+
var j = [
|
|
128
128
|
"durableFact",
|
|
129
129
|
"abusive",
|
|
130
130
|
"manipulation",
|
|
131
131
|
"asksHuman",
|
|
132
132
|
"missingInfo",
|
|
133
133
|
"informationGap"
|
|
134
|
-
],
|
|
134
|
+
], M = /* @__PURE__ */ new Set([
|
|
135
135
|
"output-available",
|
|
136
136
|
"output-error",
|
|
137
137
|
"output-denied"
|
|
138
|
-
]),
|
|
138
|
+
]), N = n({
|
|
139
139
|
id: i(),
|
|
140
140
|
messages: r(t()),
|
|
141
141
|
title: i().nullable(),
|
|
@@ -152,10 +152,10 @@ var A = [
|
|
|
152
152
|
deleted: c(),
|
|
153
153
|
deletedAt: d().nullable(),
|
|
154
154
|
deletedBy: i().nullable(),
|
|
155
|
-
conversationAnalysis:
|
|
155
|
+
conversationAnalysis: T.nullable().optional(),
|
|
156
156
|
blocked: c(),
|
|
157
157
|
blockedAt: d().nullable(),
|
|
158
|
-
blockedReasonCode: s(
|
|
158
|
+
blockedReasonCode: s(k).nullable(),
|
|
159
159
|
blockedReason: i().nullable(),
|
|
160
160
|
warningCount: a(),
|
|
161
161
|
lastMessageAt: d()
|
|
@@ -174,7 +174,7 @@ n({
|
|
|
174
174
|
startDate: i().optional(),
|
|
175
175
|
endDate: i().optional()
|
|
176
176
|
});
|
|
177
|
-
var
|
|
177
|
+
var P = n({
|
|
178
178
|
id: i(),
|
|
179
179
|
agentId: i().optional(),
|
|
180
180
|
organizationId: i(),
|
|
@@ -186,7 +186,7 @@ var N = n({
|
|
|
186
186
|
lastMessageAt: d(),
|
|
187
187
|
messages: r(t()),
|
|
188
188
|
blocked: c()
|
|
189
|
-
}),
|
|
189
|
+
}), F = class {
|
|
190
190
|
constructor(e, t) {
|
|
191
191
|
this.operator = e, this.value = t, Object.defineProperty(this, "_notes", { writable: !0 });
|
|
192
192
|
}
|
|
@@ -196,22 +196,22 @@ var N = n({
|
|
|
196
196
|
addNote(e) {
|
|
197
197
|
this._notes = this._notes || [], this._notes.push(e);
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, I = class extends F {}, L = class extends I {
|
|
200
200
|
constructor(e, t) {
|
|
201
201
|
if (!Array.isArray(t)) throw Error(`"${e}" operator expects to receive an array of conditions`);
|
|
202
202
|
super(e, t);
|
|
203
203
|
}
|
|
204
|
-
},
|
|
204
|
+
}, _e = "__itself__", R = class extends F {
|
|
205
205
|
constructor(e, t, n) {
|
|
206
206
|
super(e, n), this.field = t;
|
|
207
207
|
}
|
|
208
|
-
},
|
|
208
|
+
}, ve = new I("__null__", null);
|
|
209
209
|
Object.hasOwn;
|
|
210
|
-
function
|
|
210
|
+
function ye(e, t) {
|
|
211
211
|
let n;
|
|
212
212
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
213
213
|
let i = t[r];
|
|
214
|
-
if (i instanceof
|
|
214
|
+
if (i instanceof L) {
|
|
215
215
|
if (i.operator !== e) {
|
|
216
216
|
n && n.push(i);
|
|
217
217
|
continue;
|
|
@@ -224,11 +224,11 @@ function ve(e, t) {
|
|
|
224
224
|
}
|
|
225
225
|
return n || t;
|
|
226
226
|
}
|
|
227
|
-
function
|
|
227
|
+
function be(e, t) {
|
|
228
228
|
if (t.length === 1) return t[0];
|
|
229
|
-
if (t.length === 0) return new
|
|
230
|
-
let n =
|
|
231
|
-
return n.length === 1 ? n[0] : (n.length, new
|
|
229
|
+
if (t.length === 0) return new L(e, t);
|
|
230
|
+
let n = ye(e, t);
|
|
231
|
+
return n.length === 1 ? n[0] : (n.length, new L(e, n));
|
|
232
232
|
}
|
|
233
233
|
Object.defineProperty(Object.create(null), "__@type@__", { value: "ignore value" });
|
|
234
234
|
//#endregion
|
|
@@ -242,86 +242,86 @@ var z = Object.defineProperty;
|
|
|
242
242
|
});
|
|
243
243
|
return t || z(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
244
244
|
})({
|
|
245
|
-
$all: () =>
|
|
245
|
+
$all: () => Ee,
|
|
246
246
|
$and: () => B,
|
|
247
|
-
$elemMatch: () =>
|
|
248
|
-
$eq: () =>
|
|
249
|
-
$exists: () =>
|
|
250
|
-
$gt: () =>
|
|
251
|
-
$gte: () =>
|
|
252
|
-
$in: () =>
|
|
253
|
-
$lt: () =>
|
|
254
|
-
$lte: () =>
|
|
255
|
-
$mod: () =>
|
|
256
|
-
$ne: () =>
|
|
257
|
-
$nin: () =>
|
|
258
|
-
$nor: () =>
|
|
259
|
-
$not: () =>
|
|
260
|
-
$options: () =>
|
|
247
|
+
$elemMatch: () => Ce,
|
|
248
|
+
$eq: () => K,
|
|
249
|
+
$exists: () => Oe,
|
|
250
|
+
$gt: () => G,
|
|
251
|
+
$gte: () => W,
|
|
252
|
+
$in: () => U,
|
|
253
|
+
$lt: () => ke,
|
|
254
|
+
$lte: () => Ae,
|
|
255
|
+
$mod: () => De,
|
|
256
|
+
$ne: () => je,
|
|
257
|
+
$nin: () => Te,
|
|
258
|
+
$nor: () => xe,
|
|
259
|
+
$not: () => Se,
|
|
260
|
+
$options: () => Ne,
|
|
261
261
|
$or: () => V,
|
|
262
|
-
$regex: () =>
|
|
263
|
-
$size: () =>
|
|
264
|
-
$where: () =>
|
|
262
|
+
$regex: () => Me,
|
|
263
|
+
$size: () => we,
|
|
264
|
+
$where: () => Pe
|
|
265
265
|
});
|
|
266
266
|
var B = {
|
|
267
267
|
type: "compound",
|
|
268
|
-
validate:
|
|
268
|
+
validate: J,
|
|
269
269
|
parse(e, t, n) {
|
|
270
|
-
let r =
|
|
271
|
-
return
|
|
270
|
+
let r = H(e, t, n);
|
|
271
|
+
return be(e.name, r);
|
|
272
272
|
}
|
|
273
|
-
}, V = B,
|
|
273
|
+
}, V = B, xe = {
|
|
274
274
|
type: "compound",
|
|
275
|
-
validate:
|
|
275
|
+
validate: J,
|
|
276
276
|
parse(e, t, n) {
|
|
277
|
-
let r =
|
|
278
|
-
return new
|
|
277
|
+
let r = H(e, t, n);
|
|
278
|
+
return new L(e.name, r);
|
|
279
279
|
}
|
|
280
280
|
};
|
|
281
|
-
function
|
|
281
|
+
function H(e, t, n) {
|
|
282
282
|
let r = Array(t.length);
|
|
283
283
|
for (let i = 0; i < t.length; i++) {
|
|
284
284
|
let a = t[i];
|
|
285
|
-
|
|
285
|
+
Fe(e, a, i), r[i] = n.parse(a);
|
|
286
286
|
}
|
|
287
287
|
return r;
|
|
288
288
|
}
|
|
289
|
-
var
|
|
289
|
+
var Se = {
|
|
290
290
|
type: "field",
|
|
291
291
|
validate(e, t) {
|
|
292
292
|
if (!(t && (t instanceof RegExp || t.constructor === Object))) throw Error(`"${e.name}" expects to receive either regular expression or object of field operators`);
|
|
293
293
|
},
|
|
294
294
|
parse(e, t, n) {
|
|
295
295
|
let r = t instanceof RegExp ? new R("regex", n.field, t) : n.parse(t, n);
|
|
296
|
-
return new
|
|
296
|
+
return new L(e.name, [r]);
|
|
297
297
|
}
|
|
298
|
-
},
|
|
298
|
+
}, Ce = {
|
|
299
299
|
type: "field",
|
|
300
300
|
validate(e, t) {
|
|
301
301
|
if (!t || t.constructor !== Object) throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`);
|
|
302
302
|
},
|
|
303
303
|
parse(e, t, { parse: n, field: r, hasOperators: i }) {
|
|
304
|
-
let a = i(t) ? n(t, { field:
|
|
304
|
+
let a = i(t) ? n(t, { field: _e }) : n(t);
|
|
305
305
|
return new R(e.name, r, a);
|
|
306
306
|
}
|
|
307
|
-
},
|
|
307
|
+
}, we = {
|
|
308
308
|
type: "field",
|
|
309
309
|
validate: X("number")
|
|
310
|
-
},
|
|
310
|
+
}, U = {
|
|
311
311
|
type: "field",
|
|
312
|
-
validate:
|
|
313
|
-
},
|
|
312
|
+
validate: q
|
|
313
|
+
}, Te = U, Ee = U, De = {
|
|
314
314
|
type: "field",
|
|
315
315
|
validate(e, t) {
|
|
316
316
|
if (!Array.isArray(t) || t.length !== 2) throw Error(`"${e.name}" expects an array with 2 numeric elements`);
|
|
317
317
|
}
|
|
318
|
-
},
|
|
318
|
+
}, Oe = {
|
|
319
319
|
type: "field",
|
|
320
320
|
validate: X("boolean")
|
|
321
|
-
},
|
|
321
|
+
}, W = {
|
|
322
322
|
type: "field",
|
|
323
|
-
validate:
|
|
324
|
-
},
|
|
323
|
+
validate: Y
|
|
324
|
+
}, G = W, ke = G, Ae = G, K = { type: "field" }, je = K, Me = {
|
|
325
325
|
type: "field",
|
|
326
326
|
validate(e, t) {
|
|
327
327
|
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`);
|
|
@@ -330,20 +330,20 @@ var be = {
|
|
|
330
330
|
let r = typeof t == "string" ? new RegExp(t, n.query.$options || "") : t;
|
|
331
331
|
return new R(e.name, n.field, r);
|
|
332
332
|
}
|
|
333
|
-
},
|
|
333
|
+
}, Ne = {
|
|
334
334
|
type: "field",
|
|
335
|
-
parse: () =>
|
|
336
|
-
},
|
|
335
|
+
parse: () => ve
|
|
336
|
+
}, Pe = {
|
|
337
337
|
type: "document",
|
|
338
338
|
validate: X("function")
|
|
339
339
|
};
|
|
340
|
-
function
|
|
340
|
+
function q(e, t) {
|
|
341
341
|
if (!Array.isArray(t)) throw Error(`"${e.name}" expects value to be an array`);
|
|
342
342
|
}
|
|
343
|
-
function
|
|
344
|
-
if (
|
|
343
|
+
function J(e, t) {
|
|
344
|
+
if (q(e, t), !t.length) throw Error(`"${e.name}" expects to have at least one element in array`);
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function Y(e, t) {
|
|
347
347
|
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)`);
|
|
348
348
|
}
|
|
349
349
|
function X(e) {
|
|
@@ -351,7 +351,7 @@ function X(e) {
|
|
|
351
351
|
if (typeof n !== e) throw Error(`"${t.name}" expects value to be a "${e}"`);
|
|
352
352
|
};
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Fe(e, t, n) {
|
|
355
355
|
let r = t;
|
|
356
356
|
if (!r || r.constructor !== Object) throw Error(`"${e.name}" expects item at index ${n} to be an object`);
|
|
357
357
|
}
|
|
@@ -360,18 +360,18 @@ function Pe(e, t, n) {
|
|
|
360
360
|
var Z = /* @__PURE__ */ function(e) {
|
|
361
361
|
return e.Backoffice = "backoffice", e.Frontoffice = "frontoffice", e.System = "system", e.Public = "public", e;
|
|
362
362
|
}({});
|
|
363
|
-
|
|
363
|
+
le({ modify: [
|
|
364
364
|
"read",
|
|
365
365
|
"update",
|
|
366
366
|
"delete"
|
|
367
|
-
] }),
|
|
368
|
-
var Q =
|
|
369
|
-
Q.newRole(
|
|
367
|
+
] }), ce({ $or: V });
|
|
368
|
+
var Q = ue(fe);
|
|
369
|
+
Q.newRole(de.statements), Q.newRole(pe.statements), Q.newRole(v.statements), Q.newRole(v.statements);
|
|
370
370
|
//#endregion
|
|
371
371
|
//#region ../../packages/composable/src/chatbot/api/resolveShortUrls.ts
|
|
372
|
-
async function
|
|
372
|
+
async function Ie(e, t, n = {}) {
|
|
373
373
|
try {
|
|
374
|
-
let r =
|
|
374
|
+
let r = _(e), i = await fetch(`${r}/api/r/resolve`, {
|
|
375
375
|
method: "POST",
|
|
376
376
|
credentials: n.credentials ?? "include",
|
|
377
377
|
headers: {
|
|
@@ -387,12 +387,12 @@ async function Fe(e, t, n = {}) {
|
|
|
387
387
|
}
|
|
388
388
|
//#endregion
|
|
389
389
|
//#region ../../packages/composable/src/chatbot/api/createChatbotApiClient.ts
|
|
390
|
-
var
|
|
390
|
+
var Le = N.or(P);
|
|
391
391
|
function $(e) {
|
|
392
|
-
let t =
|
|
392
|
+
let t = Le.safeParse(e);
|
|
393
393
|
return t.success ? t.data : e;
|
|
394
394
|
}
|
|
395
|
-
async function
|
|
395
|
+
async function Re(e) {
|
|
396
396
|
let t = `${e.status} ${e.statusText}`.trim();
|
|
397
397
|
try {
|
|
398
398
|
let n = await e.json();
|
|
@@ -401,8 +401,8 @@ async function Le(e) {
|
|
|
401
401
|
return t;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
-
function
|
|
405
|
-
let t = e.basePath ?
|
|
404
|
+
function ze(e) {
|
|
405
|
+
let t = e.basePath ? se(e.basePath) : `/api/v1/${Z.Public}`, n = `${_(e.baseUrl)}${t}`, r = `${_(e.baseUrl)}${t.replace(/\/[^/]+$/, `/${Z.Frontoffice}`)}`;
|
|
406
406
|
async function i(t, r, i = "json") {
|
|
407
407
|
let a = await fetch(`${n}${t}`, {
|
|
408
408
|
credentials: e.credentials ?? "include",
|
|
@@ -412,7 +412,7 @@ function Re(e) {
|
|
|
412
412
|
...r?.headers
|
|
413
413
|
}
|
|
414
414
|
});
|
|
415
|
-
if (!a.ok) throw Error(await
|
|
415
|
+
if (!a.ok) throw Error(await Re(a));
|
|
416
416
|
if (i !== "void" && a.status !== 204) return a.json();
|
|
417
417
|
}
|
|
418
418
|
return {
|
|
@@ -553,7 +553,7 @@ function Re(e) {
|
|
|
553
553
|
return i(`/agents/${encodeURIComponent(e)}/mcp-oauth/status?${n}`);
|
|
554
554
|
},
|
|
555
555
|
async createVoiceSession(e, t, n) {
|
|
556
|
-
return
|
|
556
|
+
return p.parse(await i(`/agents/${encodeURIComponent(e)}/voice/session`, {
|
|
557
557
|
method: "POST",
|
|
558
558
|
headers: { "Content-Type": "application/json" },
|
|
559
559
|
body: JSON.stringify({
|
|
@@ -570,7 +570,7 @@ function Re(e) {
|
|
|
570
570
|
}, "void");
|
|
571
571
|
},
|
|
572
572
|
resolveShortUrls(t) {
|
|
573
|
-
return
|
|
573
|
+
return Ie(e.baseUrl, t, {
|
|
574
574
|
headers: e.headers?.(),
|
|
575
575
|
credentials: e.credentials
|
|
576
576
|
});
|
|
@@ -578,6 +578,6 @@ function Re(e) {
|
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
|
-
export {
|
|
581
|
+
export { A as a, j as i, Z as n, M as r, ze as t };
|
|
582
582
|
|
|
583
|
-
//# sourceMappingURL=createChatbotApiClient-
|
|
583
|
+
//# sourceMappingURL=createChatbotApiClient-BJz36z7v.js.map
|