@8wave/ai-elements 0.112.0 → 0.114.0-beta.15
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/Agent-D3ODaN3E.js +566 -0
- package/dist/_chunks/Agent-D3ODaN3E.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-CRlRDGYl.js → PkStreamingMarkdown-CYOm47PX.js} +1276 -453
- package/dist/_chunks/PkStreamingMarkdown-CYOm47PX.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-BbxYKt-9.js → PkToolRequestGeolocation-BY7nXImb.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-BbxYKt-9.js.map → PkToolRequestGeolocation-BY7nXImb.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-CTp2w60F.js → PkToolRequestOAuthConnection-DFOTALFt.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-CTp2w60F.js.map → PkToolRequestOAuthConnection-DFOTALFt.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-CNnt82aH.js → PkToolShowArtifact-DzHRWoru.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-CNnt82aH.js.map → PkToolShowArtifact-DzHRWoru.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-D77gyjQG.js → PkToolShowContactForm-1J6_1AA2.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-D77gyjQG.js.map → PkToolShowContactForm-1J6_1AA2.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-DP4LLAk3.js → PkToolShowForm-DmQYj3v1.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-DP4LLAk3.js.map → PkToolShowForm-DmQYj3v1.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Bwy0Ptmi.js → PkToolShowSources-BO8V5rlS.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Bwy0Ptmi.js.map → PkToolShowSources-BO8V5rlS.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js → PkToolShowSuggestedReply-CTWVG1Zk.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-CFO8wV1b.js.map → PkToolShowSuggestedReply-CTWVG1Zk.js.map} +1 -1
- package/dist/_chunks/{markdown-BRD-hDrH.js → markdown-JpLFzufn.js} +7 -7
- package/dist/_chunks/{markdown-BRD-hDrH.js.map → markdown-JpLFzufn.js.map} +1 -1
- package/dist/_chunks/url-validation-uLMZ5-AU.js.map +1 -1
- package/dist/ai-elements.es.js +2773 -2733
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.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/Media-_HfFLHGD.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbot-C11EVHnI.js → PkChatbot-DZP40EZP.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-C11EVHnI.js.map → PkChatbot-DZP40EZP.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-CacY4o02.js → PkChatbotEmptyState-DycCrfwz.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-CacY4o02.js.map → PkChatbotEmptyState-DycCrfwz.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-Dkz3SNAk.js → PkChatbotInput-BCuqLdkT.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-Dkz3SNAk.js.map → PkChatbotInput-BCuqLdkT.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js +776 -0
- package/dist-vue/_chunks/PkChatbotMessages-PjKRDNYJ.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js → PkChatbotStepPayload-CI98RiNv.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-DU0W-eUp.js.map → PkChatbotStepPayload-CI98RiNv.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js → PkChatbotStepToolDetail-B8zXJOdI.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-etlBryOg.js.map → PkChatbotStepToolDetail-B8zXJOdI.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-CL27pMFS.js +190 -0
- package/dist-vue/_chunks/{PkChatbotSteps-jW07Q-4x.js.map → PkChatbotSteps-CL27pMFS.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewChat-DJnjuhjt.js → PkChatbotViewChat-BZVcDXzL.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-DJnjuhjt.js.map → PkChatbotViewChat-BZVcDXzL.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-BCdolW0R.js → PkChatbotViewConversations-Cx-mLdUE.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-BCdolW0R.js.map → PkChatbotViewConversations-Cx-mLdUE.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-Cudao8ew.js → PkChatbotViewFiles-DLIa-xG8.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewFiles-Cudao8ew.js.map → PkChatbotViewFiles-DLIa-xG8.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-DDsKOkcC.js → PkChatbotViewProfile-DEc9apXY.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-DDsKOkcC.js.map → PkChatbotViewProfile-DEc9apXY.js.map} +1 -1
- package/dist-vue/_chunks/PkStreamingMarkdown-B2iju0WK.js +3245 -0
- package/dist-vue/_chunks/PkStreamingMarkdown-B2iju0WK.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowArtifact-BnwU7CV2.js → PkToolShowArtifact-C0J71YF6.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-BnwU7CV2.js.map → PkToolShowArtifact-C0J71YF6.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-_x_dbiHn.js → PkToolShowContactForm-De3Od9mC.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-_x_dbiHn.js.map → PkToolShowContactForm-De3Od9mC.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-RtkI_sKL.js → PkToolShowDiagram-DmY_hhAS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-RtkI_sKL.js.map → PkToolShowDiagram-DmY_hhAS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-CRQjoJr1.js → PkToolShowEmail-D_Z15wCS.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-CRQjoJr1.js.map → PkToolShowEmail-D_Z15wCS.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-IPAkJIXh.js → PkToolShowForm-DUGysIxj.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowForm-IPAkJIXh.js.map → PkToolShowForm-DUGysIxj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-joTzAg9N.js → PkToolShowMessage-e5_EI5mV.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-joTzAg9N.js.map → PkToolShowMessage-e5_EI5mV.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-tOYjd2bq.js → PkToolShowProductList-B3X7Svyc.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-tOYjd2bq.js.map → PkToolShowProductList-B3X7Svyc.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-gI947JOm.js → PkToolShowSources-BUjBSGc5.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-gI947JOm.js.map → PkToolShowSources-BUjBSGc5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-D3Xy4iUs.js → PkToolShowWebPages-DEih8h5k.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-D3Xy4iUs.js.map → PkToolShowWebPages-DEih8h5k.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-BgMBemSz.js → PkUrl-3NH9t-WA.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-BgMBemSz.js.map → PkUrl-3NH9t-WA.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-CaVLm5W9.js → createChatbotApiClient-DohvHshj.js} +115 -108
- package/dist-vue/_chunks/createChatbotApiClient-DohvHshj.js.map +1 -0
- package/dist-vue/_chunks/url-validation-uLMZ5-AU.js.map +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BwrBZJCq.js → useChatbotStore-_10Jaf4z.js} +2 -2
- package/dist-vue/_chunks/{useChatbotStore-BwrBZJCq.js.map → useChatbotStore-_10Jaf4z.js.map} +1 -1
- package/dist-vue/_chunks/utils-BL4Ppr2R.js +184 -0
- package/dist-vue/_chunks/utils-BL4Ppr2R.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +1 -3
- package/dist-vue/composables.js +136 -95
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3203 -3107
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +16 -0
- package/dist-vue/packages/auth/src/social-redirect-plugin.d.ts +18 -12
- package/dist-vue/packages/components/src/chat/PkTurnEvaluation.d.ts +8 -0
- package/dist-vue/packages/components/src/chat/markdownHtml.d.ts +20 -0
- package/dist-vue/packages/components/src/chat/utils.d.ts +9 -0
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +60 -0
- package/dist-vue/packages/models/src/schema/AgentApiTool.d.ts +70 -0
- package/dist-vue/packages/models/src/schema/Chat.d.ts +42 -0
- package/dist-vue/packages/models/src/schema/Lead.d.ts +13 -0
- package/dist-vue/packages/models/src/schema/Media.d.ts +0 -1
- package/dist-vue/packages/models/src/schema/ModelProvider.d.ts +1 -1
- package/dist-vue/style.css +1 -1
- package/package.json +2 -1
- package/dist/_chunks/Agent-DTLrWpzX.js +0 -460
- package/dist/_chunks/Agent-DTLrWpzX.js.map +0 -1
- package/dist/_chunks/Media-Cft7Pwrh.js +0 -108
- package/dist/_chunks/Media-Cft7Pwrh.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-CRlRDGYl.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BD-vUak6.js +0 -776
- package/dist-vue/_chunks/PkChatbotMessages-BD-vUak6.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-jW07Q-4x.js +0 -190
- package/dist-vue/_chunks/PkStreamingMarkdown-BoEpwaYQ.js +0 -2430
- package/dist-vue/_chunks/PkStreamingMarkdown-BoEpwaYQ.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-CaVLm5W9.js.map +0 -1
- package/dist-vue/_chunks/utils-h4C7rRcu.js +0 -177
- package/dist-vue/_chunks/utils-h4C7rRcu.js.map +0 -1
package/dist-vue/_chunks/{createChatbotApiClient-CaVLm5W9.js → createChatbotApiClient-DohvHshj.js}
RENAMED
|
@@ -1,64 +1,64 @@
|
|
|
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
|
-
import { i as d, t as
|
|
3
|
-
import { A as
|
|
4
|
-
import { t as
|
|
2
|
+
import { i as d, t as ee } from "./Media-_HfFLHGD.js";
|
|
3
|
+
import { A as te, M as ne, N as f, a as re, c as ie, l as ae, n as oe, p as se, s as ce, u as le, x as ue } from "./Agent-BNlmK-uJ.js";
|
|
4
|
+
import { t as de } from "./StreamError-D1AtGgS3.js";
|
|
5
5
|
import "./src-DT8FLE4_.js";
|
|
6
|
-
import { r as
|
|
7
|
-
import { Ability as
|
|
8
|
-
import { createAccessControl as
|
|
9
|
-
import { adminAc as
|
|
6
|
+
import { r as p, t as fe } from "./url-validation-uLMZ5-AU.js";
|
|
7
|
+
import { Ability as m, buildMongoQueryMatcher as h, createAliasResolver as pe } from "@casl/ability";
|
|
8
|
+
import { createAccessControl as me } from "better-auth/plugins";
|
|
9
|
+
import { adminAc as he, defaultStatements as ge, memberAc as g, ownerAc as _e } from "better-auth/plugins/organization/access";
|
|
10
10
|
//#region ../../packages/models/src/schema/ConversationAnalysis.ts
|
|
11
|
-
var
|
|
11
|
+
var ve = /* @__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
|
+
}({}), _ = /* @__PURE__ */ function(e) {
|
|
14
14
|
return e.Low = "low", e.Medium = "medium", e.High = "high", e;
|
|
15
|
-
}({}),
|
|
15
|
+
}({}), v = /* @__PURE__ */ function(e) {
|
|
16
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;
|
|
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) {
|
|
20
20
|
return e.High = "high", e.Medium = "medium", e.Low = "low", e.Disengaged = "disengaged", e;
|
|
21
|
-
}({}),
|
|
21
|
+
}({}), x = /* @__PURE__ */ function(e) {
|
|
22
22
|
return e.Polite = "polite", e.Neutral = "neutral", e.Impatient = "impatient", e.Aggressive = "aggressive", e.Abusive = "abusive", e;
|
|
23
|
-
}({}),
|
|
23
|
+
}({}), S = /* @__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
|
-
}({}),
|
|
27
|
+
}({}), w = n({
|
|
28
28
|
analyzedAt: d().describe("When the analysis was generated."),
|
|
29
|
-
analysisTrigger: s(
|
|
30
|
-
sentiment: s(
|
|
31
|
-
sentimentTrend: s(
|
|
32
|
-
userTone: s(
|
|
29
|
+
analysisTrigger: s(y).describe("What triggered this analysis run."),
|
|
30
|
+
sentiment: s(S).describe("Overall user sentiment in the conversation."),
|
|
31
|
+
sentimentTrend: s(C).describe("How the user sentiment evolved during the conversation."),
|
|
32
|
+
userTone: s(x).describe("Predominant tone of the user messages."),
|
|
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(
|
|
36
|
+
userAbuseCategories: r(s(ve)).default([]).describe("Abuse categories detected. Non-empty only if userAbuseDetected is true."),
|
|
37
|
+
userAbuseConfidence: s(_).optional().describe("Confidence level of the abuse detection. Set only if userAbuseDetected is true."),
|
|
38
38
|
userAbuseSummary: i().max(500).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(
|
|
40
|
+
llmIssueCategories: r(s(v)).default([]).describe("LLM issue categories detected. Non-empty only if llmIssueDetected is true."),
|
|
41
41
|
llmIssueSummary: i().max(500).optional().describe("Brief description of the LLM quality issue detected. Always write in English. Set only if llmIssueDetected is true."),
|
|
42
|
-
userEngagement: s(
|
|
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
|
+
}), T = n({
|
|
46
46
|
type: l("text"),
|
|
47
47
|
text: i()
|
|
48
|
-
}),
|
|
48
|
+
}), E = n({
|
|
49
49
|
type: l("file"),
|
|
50
|
-
mediaType: i().regex(
|
|
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
|
+
}), D = o("type", [T, E]);
|
|
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(D),
|
|
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(ae).optional(),
|
|
71
71
|
limit: a().optional(),
|
|
72
|
-
ranking:
|
|
73
|
-
reasoning:
|
|
74
|
-
webSearch:
|
|
72
|
+
ranking: ce.optional(),
|
|
73
|
+
reasoning: ie,
|
|
74
|
+
webSearch: se.optional(),
|
|
75
75
|
maxStepCount: a().int().min(1).max(40).optional(),
|
|
76
|
-
disabledTools: r(s(
|
|
76
|
+
disabledTools: r(s(oe)).optional(),
|
|
77
77
|
fallbackModels: r(i()).optional(),
|
|
78
|
-
gatewayOptions:
|
|
79
|
-
deviceContext:
|
|
78
|
+
gatewayOptions: re.partial().optional(),
|
|
79
|
+
deviceContext: te.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 O = /* @__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 k(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 A(e) {
|
|
|
104
104
|
}
|
|
105
105
|
continue;
|
|
106
106
|
}
|
|
107
|
-
let n =
|
|
108
|
-
s && (t.state === "output-error" &&
|
|
107
|
+
let n = ne(e, r.keys()), s = n && r.get(n);
|
|
108
|
+
s && (t.state === "output-error" && de.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,7 +124,14 @@ function A(e) {
|
|
|
124
124
|
missed: l.filter((e) => e.used && !e.selected).length
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
var
|
|
127
|
+
var A = [
|
|
128
|
+
"durableFact",
|
|
129
|
+
"abusive",
|
|
130
|
+
"manipulation",
|
|
131
|
+
"asksHuman",
|
|
132
|
+
"missingInfo",
|
|
133
|
+
"informationGap"
|
|
134
|
+
], j = /* @__PURE__ */ new Set([
|
|
128
135
|
"output-available",
|
|
129
136
|
"output-error",
|
|
130
137
|
"output-denied"
|
|
@@ -145,25 +152,25 @@ var j = /* @__PURE__ */ new Set([
|
|
|
145
152
|
deleted: c(),
|
|
146
153
|
deletedAt: d().nullable(),
|
|
147
154
|
deletedBy: i().nullable(),
|
|
148
|
-
conversationAnalysis:
|
|
155
|
+
conversationAnalysis: w.nullable().optional(),
|
|
149
156
|
blocked: c(),
|
|
150
157
|
blockedAt: d().nullable(),
|
|
151
|
-
blockedReasonCode: s(
|
|
158
|
+
blockedReasonCode: s(O).nullable(),
|
|
152
159
|
blockedReason: i().nullable(),
|
|
153
160
|
warningCount: a(),
|
|
154
161
|
lastMessageAt: d()
|
|
155
162
|
});
|
|
156
163
|
n({
|
|
157
|
-
...
|
|
158
|
-
...
|
|
164
|
+
...f.pagination(),
|
|
165
|
+
...f.sort([
|
|
159
166
|
"updatedAt",
|
|
160
167
|
"createdAt",
|
|
161
168
|
"lastMessageAt"
|
|
162
169
|
]),
|
|
163
|
-
...
|
|
164
|
-
...
|
|
165
|
-
...
|
|
166
|
-
...
|
|
170
|
+
...f.filters(["agentId", "userId"]),
|
|
171
|
+
...f.range("updatedAt"),
|
|
172
|
+
...f.range("lastMessageAt"),
|
|
173
|
+
...f.ids(),
|
|
167
174
|
startDate: i().optional(),
|
|
168
175
|
endDate: i().optional()
|
|
169
176
|
});
|
|
@@ -194,13 +201,13 @@ var N = n({
|
|
|
194
201
|
if (!Array.isArray(t)) throw Error(`"${e}" operator expects to receive an array of conditions`);
|
|
195
202
|
super(e, t);
|
|
196
203
|
}
|
|
197
|
-
},
|
|
204
|
+
}, ye = "__itself__", L = class extends P {
|
|
198
205
|
constructor(e, t, n) {
|
|
199
206
|
super(e, n), this.field = t;
|
|
200
207
|
}
|
|
201
|
-
},
|
|
208
|
+
}, be = new F("__null__", null);
|
|
202
209
|
Object.hasOwn;
|
|
203
|
-
function
|
|
210
|
+
function xe(e, t) {
|
|
204
211
|
let n;
|
|
205
212
|
for (let r = 0, i = t.length; r < i; r++) {
|
|
206
213
|
let i = t[r];
|
|
@@ -217,10 +224,10 @@ function be(e, t) {
|
|
|
217
224
|
}
|
|
218
225
|
return n || t;
|
|
219
226
|
}
|
|
220
|
-
function
|
|
227
|
+
function Se(e, t) {
|
|
221
228
|
if (t.length === 1) return t[0];
|
|
222
229
|
if (t.length === 0) return new I(e, t);
|
|
223
|
-
let n =
|
|
230
|
+
let n = xe(e, t);
|
|
224
231
|
return n.length === 1 ? n[0] : (n.length, new I(e, n));
|
|
225
232
|
}
|
|
226
233
|
Object.defineProperty(Object.create(null), "__@type@__", { value: "ignore value" });
|
|
@@ -238,17 +245,17 @@ var R = Object.defineProperty;
|
|
|
238
245
|
$all: () => De,
|
|
239
246
|
$and: () => z,
|
|
240
247
|
$elemMatch: () => we,
|
|
241
|
-
$eq: () =>
|
|
248
|
+
$eq: () => K,
|
|
242
249
|
$exists: () => ke,
|
|
243
|
-
$gt: () =>
|
|
244
|
-
$gte: () =>
|
|
245
|
-
$in: () =>
|
|
250
|
+
$gt: () => G,
|
|
251
|
+
$gte: () => W,
|
|
252
|
+
$in: () => U,
|
|
246
253
|
$lt: () => Ae,
|
|
247
254
|
$lte: () => je,
|
|
248
255
|
$mod: () => Oe,
|
|
249
256
|
$ne: () => Me,
|
|
250
257
|
$nin: () => Ee,
|
|
251
|
-
$nor: () =>
|
|
258
|
+
$nor: () => V,
|
|
252
259
|
$not: () => Ce,
|
|
253
260
|
$options: () => Pe,
|
|
254
261
|
$or: () => B,
|
|
@@ -258,20 +265,20 @@ var R = Object.defineProperty;
|
|
|
258
265
|
});
|
|
259
266
|
var z = {
|
|
260
267
|
type: "compound",
|
|
261
|
-
validate:
|
|
268
|
+
validate: J,
|
|
262
269
|
parse(e, t, n) {
|
|
263
|
-
let r =
|
|
264
|
-
return
|
|
270
|
+
let r = H(e, t, n);
|
|
271
|
+
return Se(e.name, r);
|
|
265
272
|
}
|
|
266
|
-
}, B = z,
|
|
273
|
+
}, B = z, V = {
|
|
267
274
|
type: "compound",
|
|
268
|
-
validate:
|
|
275
|
+
validate: J,
|
|
269
276
|
parse(e, t, n) {
|
|
270
|
-
let r =
|
|
277
|
+
let r = H(e, t, n);
|
|
271
278
|
return new I(e.name, r);
|
|
272
279
|
}
|
|
273
280
|
};
|
|
274
|
-
function
|
|
281
|
+
function H(e, t, n) {
|
|
275
282
|
let r = Array(t.length);
|
|
276
283
|
for (let i = 0; i < t.length; i++) {
|
|
277
284
|
let a = t[i];
|
|
@@ -294,27 +301,27 @@ var Ce = {
|
|
|
294
301
|
if (!t || t.constructor !== Object) throw Error(`"${e.name}" expects to receive an object with nested query or field level operators`);
|
|
295
302
|
},
|
|
296
303
|
parse(e, t, { parse: n, field: r, hasOperators: i }) {
|
|
297
|
-
let a = i(t) ? n(t, { field:
|
|
304
|
+
let a = i(t) ? n(t, { field: ye }) : n(t);
|
|
298
305
|
return new L(e.name, r, a);
|
|
299
306
|
}
|
|
300
307
|
}, Te = {
|
|
301
308
|
type: "field",
|
|
302
|
-
validate:
|
|
303
|
-
},
|
|
309
|
+
validate: Y("number")
|
|
310
|
+
}, U = {
|
|
304
311
|
type: "field",
|
|
305
|
-
validate:
|
|
306
|
-
}, Ee =
|
|
312
|
+
validate: q
|
|
313
|
+
}, Ee = U, De = U, Oe = {
|
|
307
314
|
type: "field",
|
|
308
315
|
validate(e, t) {
|
|
309
316
|
if (!Array.isArray(t) || t.length !== 2) throw Error(`"${e.name}" expects an array with 2 numeric elements`);
|
|
310
317
|
}
|
|
311
318
|
}, ke = {
|
|
312
319
|
type: "field",
|
|
313
|
-
validate:
|
|
314
|
-
},
|
|
320
|
+
validate: Y("boolean")
|
|
321
|
+
}, W = {
|
|
315
322
|
type: "field",
|
|
316
323
|
validate: Ie
|
|
317
|
-
},
|
|
324
|
+
}, G = W, Ae = G, je = G, K = { type: "field" }, Me = K, Ne = {
|
|
318
325
|
type: "field",
|
|
319
326
|
validate(e, t) {
|
|
320
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`);
|
|
@@ -325,21 +332,21 @@ var Ce = {
|
|
|
325
332
|
}
|
|
326
333
|
}, Pe = {
|
|
327
334
|
type: "field",
|
|
328
|
-
parse: () =>
|
|
335
|
+
parse: () => be
|
|
329
336
|
}, Fe = {
|
|
330
337
|
type: "document",
|
|
331
|
-
validate:
|
|
338
|
+
validate: Y("function")
|
|
332
339
|
};
|
|
333
|
-
function
|
|
340
|
+
function q(e, t) {
|
|
334
341
|
if (!Array.isArray(t)) throw Error(`"${e.name}" expects value to be an array`);
|
|
335
342
|
}
|
|
336
|
-
function
|
|
337
|
-
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`);
|
|
338
345
|
}
|
|
339
346
|
function Ie(e, t) {
|
|
340
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)`);
|
|
341
348
|
}
|
|
342
|
-
function
|
|
349
|
+
function Y(e) {
|
|
343
350
|
return (t, n) => {
|
|
344
351
|
if (typeof n !== e) throw Error(`"${t.name}" expects value to be a "${e}"`);
|
|
345
352
|
};
|
|
@@ -350,59 +357,59 @@ function Le(e, t, n) {
|
|
|
350
357
|
}
|
|
351
358
|
//#endregion
|
|
352
359
|
//#region ../../packages/ability/src/types.ts
|
|
353
|
-
var
|
|
360
|
+
var X = /* @__PURE__ */ function(e) {
|
|
354
361
|
return e.Backoffice = "backoffice", e.Frontoffice = "frontoffice", e.System = "system", e.Public = "public", e;
|
|
355
|
-
}({}),
|
|
362
|
+
}({}), Z = /* @__PURE__ */ function(e) {
|
|
356
363
|
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;
|
|
357
364
|
}({}), Re = (e) => e ? [
|
|
358
365
|
{
|
|
359
|
-
subject:
|
|
366
|
+
subject: Z.Chat,
|
|
360
367
|
action: "create"
|
|
361
368
|
},
|
|
362
369
|
{
|
|
363
|
-
subject:
|
|
370
|
+
subject: Z.Chat,
|
|
364
371
|
action: "read",
|
|
365
372
|
condition: { createdBy: { $eq: e.user?.id } }
|
|
366
373
|
},
|
|
367
374
|
{
|
|
368
|
-
subject:
|
|
375
|
+
subject: Z.Chat,
|
|
369
376
|
action: "update"
|
|
370
377
|
},
|
|
371
378
|
{
|
|
372
|
-
subject:
|
|
379
|
+
subject: Z.Chat,
|
|
373
380
|
action: "delete"
|
|
374
381
|
},
|
|
375
382
|
{
|
|
376
|
-
subject:
|
|
383
|
+
subject: Z.Agent,
|
|
377
384
|
action: "read",
|
|
378
|
-
condition: { status: { $eq:
|
|
385
|
+
condition: { status: { $eq: le.Active } }
|
|
379
386
|
},
|
|
380
387
|
{
|
|
381
|
-
subject:
|
|
388
|
+
subject: Z.MessageFeedback,
|
|
382
389
|
action: "create"
|
|
383
390
|
},
|
|
384
391
|
{
|
|
385
|
-
subject:
|
|
392
|
+
subject: Z.MessageFeedback,
|
|
386
393
|
action: "read",
|
|
387
394
|
condition: { createdBy: { $eq: e.user?.id } }
|
|
388
395
|
}
|
|
389
|
-
] : [], ze =
|
|
396
|
+
] : [], ze = pe({ modify: [
|
|
390
397
|
"read",
|
|
391
398
|
"update",
|
|
392
399
|
"delete"
|
|
393
|
-
] }),
|
|
394
|
-
new
|
|
395
|
-
conditionsMatcher:
|
|
400
|
+
] }), Be = h({ $or: B });
|
|
401
|
+
new m(Re(), {
|
|
402
|
+
conditionsMatcher: Be,
|
|
396
403
|
resolveAction: ze,
|
|
397
404
|
fieldMatcher: (e) => (t) => e.includes(t)
|
|
398
405
|
});
|
|
399
|
-
var Q =
|
|
400
|
-
Q.newRole(
|
|
406
|
+
var Q = me(ge);
|
|
407
|
+
Q.newRole(he.statements), Q.newRole(_e.statements), Q.newRole(g.statements), Q.newRole(g.statements);
|
|
401
408
|
//#endregion
|
|
402
409
|
//#region ../../packages/composable/src/chatbot/api/resolveShortUrls.ts
|
|
403
|
-
async function
|
|
410
|
+
async function Ve(e, t, n = {}) {
|
|
404
411
|
try {
|
|
405
|
-
let r =
|
|
412
|
+
let r = p(e), i = await fetch(`${r}/api/r/resolve`, {
|
|
406
413
|
method: "POST",
|
|
407
414
|
credentials: n.credentials ?? "include",
|
|
408
415
|
headers: {
|
|
@@ -418,12 +425,12 @@ async function Be(e, t, n = {}) {
|
|
|
418
425
|
}
|
|
419
426
|
//#endregion
|
|
420
427
|
//#region ../../packages/composable/src/chatbot/api/createChatbotApiClient.ts
|
|
421
|
-
var
|
|
428
|
+
var He = M.or(N);
|
|
422
429
|
function $(e) {
|
|
423
|
-
let t =
|
|
430
|
+
let t = He.safeParse(e);
|
|
424
431
|
return t.success ? t.data : e;
|
|
425
432
|
}
|
|
426
|
-
async function
|
|
433
|
+
async function Ue(e) {
|
|
427
434
|
let t = `${e.status} ${e.statusText}`.trim();
|
|
428
435
|
try {
|
|
429
436
|
let n = await e.json();
|
|
@@ -432,8 +439,8 @@ async function He(e) {
|
|
|
432
439
|
return t;
|
|
433
440
|
}
|
|
434
441
|
}
|
|
435
|
-
function
|
|
436
|
-
let t = e.basePath ?
|
|
442
|
+
function We(e) {
|
|
443
|
+
let t = e.basePath ? fe(e.basePath) : `/api/v1/${X.Public}`, n = `${p(e.baseUrl)}${t}`, r = `${p(e.baseUrl)}${t.replace(/\/[^/]+$/, `/${X.Frontoffice}`)}`;
|
|
437
444
|
async function i(t, r, i = "json") {
|
|
438
445
|
let a = await fetch(`${n}${t}`, {
|
|
439
446
|
credentials: e.credentials ?? "include",
|
|
@@ -443,7 +450,7 @@ function Ue(e) {
|
|
|
443
450
|
...r?.headers
|
|
444
451
|
}
|
|
445
452
|
});
|
|
446
|
-
if (!a.ok) throw Error(await
|
|
453
|
+
if (!a.ok) throw Error(await Ue(a));
|
|
447
454
|
if (i !== "void" && a.status !== 204) return a.json();
|
|
448
455
|
}
|
|
449
456
|
return {
|
|
@@ -584,7 +591,7 @@ function Ue(e) {
|
|
|
584
591
|
return i(`/agents/${encodeURIComponent(e)}/mcp-oauth/status?${n}`);
|
|
585
592
|
},
|
|
586
593
|
async createVoiceSession(e, t, n) {
|
|
587
|
-
return
|
|
594
|
+
return ue.parse(await i(`/agents/${encodeURIComponent(e)}/voice/session`, {
|
|
588
595
|
method: "POST",
|
|
589
596
|
headers: { "Content-Type": "application/json" },
|
|
590
597
|
body: JSON.stringify({
|
|
@@ -601,7 +608,7 @@ function Ue(e) {
|
|
|
601
608
|
}, "void");
|
|
602
609
|
},
|
|
603
610
|
resolveShortUrls(t) {
|
|
604
|
-
return
|
|
611
|
+
return Ve(e.baseUrl, t, {
|
|
605
612
|
headers: e.headers?.(),
|
|
606
613
|
credentials: e.credentials
|
|
607
614
|
});
|
|
@@ -609,6 +616,6 @@ function Ue(e) {
|
|
|
609
616
|
};
|
|
610
617
|
}
|
|
611
618
|
//#endregion
|
|
612
|
-
export { A as i,
|
|
619
|
+
export { k as a, A as i, X as n, j as r, We as t };
|
|
613
620
|
|
|
614
|
-
//# sourceMappingURL=createChatbotApiClient-
|
|
621
|
+
//# sourceMappingURL=createChatbotApiClient-DohvHshj.js.map
|