@8wave/ai-elements 0.114.0-beta.28 → 0.114.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/_chunks/Agent-DTLrWpzX.js +460 -0
  2. package/dist/_chunks/Agent-DTLrWpzX.js.map +1 -0
  3. package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
  4. package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
  5. package/dist/_chunks/{PkStreamingMarkdown-ZD0SROu1.js → PkStreamingMarkdown-C1sANAr5.js} +672 -688
  6. package/dist/_chunks/PkStreamingMarkdown-C1sANAr5.js.map +1 -0
  7. package/dist/_chunks/{PkToolRequestGeolocation-OF1PWhMw.js → PkToolRequestGeolocation-BbxYKt-9.js} +2 -2
  8. package/{dist-vue/_chunks/PkToolRequestGeolocation-BOVbaCzQ.js.map → dist/_chunks/PkToolRequestGeolocation-BbxYKt-9.js.map} +1 -1
  9. package/dist/_chunks/{PkToolRequestOAuthConnection-ChGMAKV7.js → PkToolRequestOAuthConnection-CTp2w60F.js} +2 -2
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-ChGMAKV7.js.map → PkToolRequestOAuthConnection-CTp2w60F.js.map} +1 -1
  11. package/dist/_chunks/{PkToolShowArtifact-LEfO5zfg.js → PkToolShowArtifact-BfTjxGOT.js} +2 -2
  12. package/dist/_chunks/{PkToolShowArtifact-LEfO5zfg.js.map → PkToolShowArtifact-BfTjxGOT.js.map} +1 -1
  13. package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js +60 -0
  14. package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js.map +1 -0
  15. package/dist/_chunks/{PkToolShowContactForm-BO3JQfts.js → PkToolShowContactForm-PFpY9dIp.js} +2 -2
  16. package/dist/_chunks/{PkToolShowContactForm-BO3JQfts.js.map → PkToolShowContactForm-PFpY9dIp.js.map} +1 -1
  17. package/dist/_chunks/{PkToolShowForm-KW8MOL-j.js → PkToolShowForm-CMtSN0oX.js} +5 -5
  18. package/dist/_chunks/{PkToolShowForm-KW8MOL-j.js.map → PkToolShowForm-CMtSN0oX.js.map} +1 -1
  19. package/dist/_chunks/{PkToolShowSources-Sc1W6WHe.js → PkToolShowSources-C6cu66Ts.js} +3 -3
  20. package/dist/_chunks/{PkToolShowSources-Sc1W6WHe.js.map → PkToolShowSources-C6cu66Ts.js.map} +1 -1
  21. package/dist/_chunks/{PkToolShowSuggestedReply-Dl4x_nEJ.js → PkToolShowSuggestedReply-CFO8wV1b.js} +2 -2
  22. package/dist/_chunks/{PkToolShowSuggestedReply-Dl4x_nEJ.js.map → PkToolShowSuggestedReply-CFO8wV1b.js.map} +1 -1
  23. package/dist/_chunks/{markdown-BrvkrEUr.js → markdown-BRD-hDrH.js} +10 -10
  24. package/dist/_chunks/{markdown-BrvkrEUr.js.map → markdown-BRD-hDrH.js.map} +1 -1
  25. package/dist/ai-elements.es.js +2753 -3001
  26. package/dist/ai-elements.es.js.map +1 -1
  27. package/dist-vue/PkChatbot.js +1 -1
  28. package/dist-vue/PkChatbotAuth.js +1 -1
  29. package/dist-vue/PkChatbotEmptyState.js +1 -1
  30. package/dist-vue/PkChatbotInput.js +1 -1
  31. package/dist-vue/PkChatbotMessages.js +1 -1
  32. package/dist-vue/PkChatbotStepPayload.js +1 -1
  33. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  34. package/dist-vue/PkChatbotSteps.js +1 -1
  35. package/dist-vue/PkChatbotViewChat.js +1 -1
  36. package/dist-vue/PkChatbotViewConversations.js +1 -1
  37. package/dist-vue/PkChatbotViewFiles.js +1 -1
  38. package/dist-vue/PkChatbotViewProfile.js +1 -1
  39. package/dist-vue/_chunks/{Agent-tbKw8Mdt.js → Agent-BNlmK-uJ.js} +2 -2
  40. package/dist-vue/_chunks/{Agent-tbKw8Mdt.js.map → Agent-BNlmK-uJ.js.map} +1 -1
  41. package/dist-vue/_chunks/{Document-p2Y_4gk8.js → Document-2X01-F4Z.js} +9 -9
  42. package/dist-vue/_chunks/{Document-p2Y_4gk8.js.map → Document-2X01-F4Z.js.map} +1 -1
  43. package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
  44. package/dist-vue/_chunks/{PkChatbot-Dn_6yrFw.js → PkChatbot-HRayDr2d.js} +8 -8
  45. package/dist-vue/_chunks/{PkChatbot-Dn_6yrFw.js.map → PkChatbot-HRayDr2d.js.map} +1 -1
  46. package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js +349 -0
  47. package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +1 -0
  48. package/dist-vue/_chunks/{PkChatbotEmptyState-9mWiPd4B.js → PkChatbotEmptyState-CPOcfoRC.js} +2 -2
  49. package/dist-vue/_chunks/{PkChatbotEmptyState-9mWiPd4B.js.map → PkChatbotEmptyState-CPOcfoRC.js.map} +1 -1
  50. package/dist-vue/_chunks/{PkChatbotInput-BzaCyeFp.js → PkChatbotInput-pLJQIu7v.js} +2 -2
  51. package/dist-vue/_chunks/{PkChatbotInput-BzaCyeFp.js.map → PkChatbotInput-pLJQIu7v.js.map} +1 -1
  52. package/dist-vue/_chunks/{PkChatbotMessages-Yaf_5xJV.js → PkChatbotMessages-GZStJbx_.js} +256 -258
  53. package/dist-vue/_chunks/PkChatbotMessages-GZStJbx_.js.map +1 -0
  54. package/dist-vue/_chunks/{PkChatbotStepPayload-C36nXLW7.js → PkChatbotStepPayload-DU0W-eUp.js} +2 -2
  55. package/dist-vue/_chunks/{PkChatbotStepPayload-C36nXLW7.js.map → PkChatbotStepPayload-DU0W-eUp.js.map} +1 -1
  56. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CBX-AQXv.js → PkChatbotStepToolDetail-etlBryOg.js} +3 -3
  57. package/dist-vue/_chunks/{PkChatbotStepToolDetail-CBX-AQXv.js.map → PkChatbotStepToolDetail-etlBryOg.js.map} +1 -1
  58. package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js +190 -0
  59. package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js.map +1 -0
  60. package/dist-vue/_chunks/{PkChatbotViewChat-DFYw4nzP.js → PkChatbotViewChat-DIfBWFoG.js} +7 -7
  61. package/dist-vue/_chunks/{PkChatbotViewChat-DFYw4nzP.js.map → PkChatbotViewChat-DIfBWFoG.js.map} +1 -1
  62. package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js → PkChatbotViewConversations-BCdolW0R.js} +2 -2
  63. package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js.map → PkChatbotViewConversations-BCdolW0R.js.map} +1 -1
  64. package/dist-vue/_chunks/{PkChatbotViewFiles-BBBO5hyd.js → PkChatbotViewFiles-Cudao8ew.js} +3 -3
  65. package/dist-vue/_chunks/{PkChatbotViewFiles-BBBO5hyd.js.map → PkChatbotViewFiles-Cudao8ew.js.map} +1 -1
  66. package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js → PkChatbotViewProfile-DDsKOkcC.js} +2 -2
  67. package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js.map → PkChatbotViewProfile-DDsKOkcC.js.map} +1 -1
  68. package/dist-vue/_chunks/{PkStreamingMarkdown-BN7waklD.js → PkStreamingMarkdown-BloMJaIW.js} +205 -214
  69. package/dist-vue/_chunks/{PkStreamingMarkdown-BN7waklD.js.map → PkStreamingMarkdown-BloMJaIW.js.map} +1 -1
  70. package/dist-vue/_chunks/{PkToolRequestGeolocation-BOVbaCzQ.js → PkToolRequestGeolocation-9vfYNaQo.js} +2 -2
  71. package/{dist/_chunks/PkToolRequestGeolocation-OF1PWhMw.js.map → dist-vue/_chunks/PkToolRequestGeolocation-9vfYNaQo.js.map} +1 -1
  72. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DMvCGPuX.js → PkToolRequestOAuthConnection-BorR5NmZ.js} +2 -2
  73. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DMvCGPuX.js.map → PkToolRequestOAuthConnection-BorR5NmZ.js.map} +1 -1
  74. package/dist-vue/_chunks/{PkToolShowArtifact-DrE_mK1z.js → PkToolShowArtifact-BuMY7GNj.js} +2 -2
  75. package/dist-vue/_chunks/{PkToolShowArtifact-DrE_mK1z.js.map → PkToolShowArtifact-BuMY7GNj.js.map} +1 -1
  76. package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js +61 -0
  77. package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +1 -0
  78. package/dist-vue/_chunks/{PkToolShowContactForm-BBTbrgt4.js → PkToolShowContactForm-0OQRqT8m.js} +2 -2
  79. package/dist-vue/_chunks/{PkToolShowContactForm-BBTbrgt4.js.map → PkToolShowContactForm-0OQRqT8m.js.map} +1 -1
  80. package/dist-vue/_chunks/{PkToolShowDiagram-WyUnnDUn.js → PkToolShowDiagram-BGL27iHG.js} +2 -2
  81. package/dist-vue/_chunks/{PkToolShowDiagram-WyUnnDUn.js.map → PkToolShowDiagram-BGL27iHG.js.map} +1 -1
  82. package/dist-vue/_chunks/{PkToolShowEmail-C30K5kJA.js → PkToolShowEmail-BJJpS69F.js} +2 -2
  83. package/dist-vue/_chunks/{PkToolShowEmail-C30K5kJA.js.map → PkToolShowEmail-BJJpS69F.js.map} +1 -1
  84. package/dist-vue/_chunks/{PkToolShowForm-C9N_SSm8.js → PkToolShowForm-DDcPpOZ8.js} +4 -4
  85. package/dist-vue/_chunks/{PkToolShowForm-C9N_SSm8.js.map → PkToolShowForm-DDcPpOZ8.js.map} +1 -1
  86. package/dist-vue/_chunks/{PkToolShowMessage-DvkCRERv.js → PkToolShowMessage-BFGynf3p.js} +2 -2
  87. package/dist-vue/_chunks/{PkToolShowMessage-DvkCRERv.js.map → PkToolShowMessage-BFGynf3p.js.map} +1 -1
  88. package/dist-vue/_chunks/{PkToolShowProductList-cfjg3CmV.js → PkToolShowProductList-6t1Ir5CW.js} +2 -2
  89. package/dist-vue/_chunks/{PkToolShowProductList-cfjg3CmV.js.map → PkToolShowProductList-6t1Ir5CW.js.map} +1 -1
  90. package/dist-vue/_chunks/{PkToolShowSources-BItTltB5.js → PkToolShowSources-cOF0ZxOj.js} +4 -4
  91. package/dist-vue/_chunks/{PkToolShowSources-BItTltB5.js.map → PkToolShowSources-cOF0ZxOj.js.map} +1 -1
  92. package/dist-vue/_chunks/{PkToolShowSuggestedReply-qAWdCUhr.js → PkToolShowSuggestedReply-DA4NEjHB.js} +2 -2
  93. package/dist-vue/_chunks/{PkToolShowSuggestedReply-qAWdCUhr.js.map → PkToolShowSuggestedReply-DA4NEjHB.js.map} +1 -1
  94. package/dist-vue/_chunks/{PkToolShowWebPages-CkQ2NhRj.js → PkToolShowWebPages-OgaT1vYJ.js} +2 -2
  95. package/dist-vue/_chunks/{PkToolShowWebPages-CkQ2NhRj.js.map → PkToolShowWebPages-OgaT1vYJ.js.map} +1 -1
  96. package/dist-vue/_chunks/{PkUrl-BsD4Vby6.js → PkUrl-Cd69XP5z.js} +2 -2
  97. package/dist-vue/_chunks/{PkUrl-BsD4Vby6.js.map → PkUrl-Cd69XP5z.js.map} +1 -1
  98. package/dist-vue/_chunks/{createChatbotApiClient-BlWs282E.js → createChatbotApiClient-CaVLm5W9.js} +168 -137
  99. package/dist-vue/_chunks/createChatbotApiClient-CaVLm5W9.js.map +1 -0
  100. package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js → useChatbotStore-BwrBZJCq.js} +3 -3
  101. package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js.map → useChatbotStore-BwrBZJCq.js.map} +1 -1
  102. package/dist-vue/_chunks/utils-h4C7rRcu.js +177 -0
  103. package/dist-vue/_chunks/utils-h4C7rRcu.js.map +1 -0
  104. package/dist-vue/api.js +1 -1
  105. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
  106. package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +8 -54
  107. package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +0 -14
  108. package/dist-vue/composables.js +98 -402
  109. package/dist-vue/composables.js.map +1 -1
  110. package/dist-vue/index.js +3235 -3357
  111. package/dist-vue/index.js.map +1 -1
  112. package/dist-vue/locales.js +0 -42
  113. package/dist-vue/packages/ability/src/index.d.ts +14 -10
  114. package/dist-vue/packages/auth/src/social-redirect-plugin.d.ts +12 -18
  115. package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +0 -19
  116. package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -8
  117. package/dist-vue/packages/components/src/chat/PkChatbotSteps.d.ts +0 -1
  118. package/dist-vue/packages/components/src/chat/utils.d.ts +0 -9
  119. package/dist-vue/packages/components/src/index.d.ts +1 -2
  120. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +0 -60
  121. package/dist-vue/packages/models/src/schema/Chat.d.ts +0 -42
  122. package/dist-vue/packages/models/src/schema/Media.d.ts +1 -0
  123. package/dist-vue/packages/models/src/schema/Member.d.ts +0 -3
  124. package/dist-vue/packages/models/src/schema/Notification.d.ts +0 -2
  125. package/dist-vue/packages/models/src/schema/Organization.d.ts +0 -1
  126. package/dist-vue/packages/models/src/schema/User.d.ts +0 -1
  127. package/dist-vue/style.css +1 -1
  128. package/package.json +1 -1
  129. package/dist/_chunks/Agent-DK76k05_.js +0 -566
  130. package/dist/_chunks/Agent-DK76k05_.js.map +0 -1
  131. package/dist/_chunks/PkStreamingMarkdown-ZD0SROu1.js.map +0 -1
  132. package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js +0 -72
  133. package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js.map +0 -1
  134. package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js +0 -421
  135. package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +0 -1
  136. package/dist-vue/_chunks/PkChatbotMessages-Yaf_5xJV.js.map +0 -1
  137. package/dist-vue/_chunks/PkChatbotSteps-356rnZG5.js +0 -191
  138. package/dist-vue/_chunks/PkChatbotSteps-356rnZG5.js.map +0 -1
  139. package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js +0 -72
  140. package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +0 -1
  141. package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +0 -1
  142. package/dist-vue/_chunks/utils--8iNpBr_.js +0 -184
  143. package/dist-vue/_chunks/utils--8iNpBr_.js.map +0 -1
  144. package/dist-vue/packages/auth/src/additional-fields.d.ts +0 -48
  145. package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +0 -31
  146. package/dist-vue/packages/auth/src/passkey-policy-plugin.d.ts +0 -22
  147. package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +0 -60
  148. package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +0 -65
  149. package/dist-vue/packages/components/src/PkQrCode.d.ts +0 -14
  150. package/dist-vue/packages/components/src/chat/PkTurnEvaluation.d.ts +0 -8
@@ -305,7 +305,6 @@ var e = {
305
305
  toolApprovalBadge: "User confirm",
306
306
  calendarEvent: "Event",
307
307
  comparison: "Comparison",
308
- recommended: "Recommended",
309
308
  contactUs: "Contact us",
310
309
  phone: "Phone number",
311
310
  diagram: "Diagram",
@@ -471,18 +470,6 @@ var e = {
471
470
  untitled: "Untitled file",
472
471
  exclude: "Remove file"
473
472
  },
474
- twoFactor: {
475
- challengeBackup: "Enter one of the backup codes you saved.",
476
- challengeEmailSent: "We sent a 6-digit code to your email. It expires in 5 minutes.",
477
- challengeApp: "Enter the 6-digit code from your authenticator app.",
478
- challengeTitle: "Two-step verification",
479
- backupCode: "Backup code",
480
- code: "6-digit code",
481
- verify: "Verify",
482
- useBackupCode: "Use a backup code",
483
- useApp: "Use the authenticator app",
484
- sendAgain: "Send a new code"
485
- },
486
473
  auth: {
487
474
  signInTitle: "Sign in to your account",
488
475
  signUpTitle: "Create your account",
@@ -580,14 +567,6 @@ var e = {
580
567
  feelsLike: "Feels like",
581
568
  dailyForecast: "Daily forecast",
582
569
  airQuality: "Air quality"
583
- },
584
- turnEvaluation: {
585
- cost: "Cost, not charged to the organization: {cost}",
586
- title: "Evaluation after the reply",
587
- modeHint: "Recorded after the reply, with no effect: nothing reads these probabilities yet.",
588
- version: "Questions version {version}",
589
- leadFailed: "The evaluation failed or did not answer within {budget} ms: nothing was recorded.",
590
- probability: "Probability the evaluation model gives to the question: from 0.5 it leans towards yes"
591
570
  }
592
571
  }, t = {
593
572
  agentType: {
@@ -895,7 +874,6 @@ var e = {
895
874
  toolApprovalBadge: "Conferma utente",
896
875
  calendarEvent: "Evento",
897
876
  comparison: "Confronto",
898
- recommended: "Consigliato",
899
877
  contactUs: "Contattaci",
900
878
  phone: "Telefono",
901
879
  diagram: "Diagramma",
@@ -1061,18 +1039,6 @@ var e = {
1061
1039
  untitled: "File senza nome",
1062
1040
  exclude: "Rimuovi file"
1063
1041
  },
1064
- twoFactor: {
1065
- challengeBackup: "Scrivi uno dei codici di recupero che hai salvato.",
1066
- challengeEmailSent: "Ti abbiamo inviato un codice a 6 cifre via email. Scade fra 5 minuti.",
1067
- challengeApp: "Scrivi il codice a 6 cifre della tua app di autenticazione.",
1068
- challengeTitle: "Verifica in due passaggi",
1069
- backupCode: "Codice di recupero",
1070
- code: "Codice a 6 cifre",
1071
- verify: "Verifica",
1072
- useBackupCode: "Usa un codice di recupero",
1073
- useApp: "Usa l'app di autenticazione",
1074
- sendAgain: "Invia un nuovo codice"
1075
- },
1076
1042
  auth: {
1077
1043
  signInTitle: "Accedi al tuo account",
1078
1044
  signUpTitle: "Crea il tuo account",
@@ -1170,14 +1136,6 @@ var e = {
1170
1136
  feelsLike: "Percepita",
1171
1137
  dailyForecast: "Previsioni giornaliere",
1172
1138
  airQuality: "Qualità dell'aria"
1173
- },
1174
- turnEvaluation: {
1175
- cost: "Costo, non addebitato all'organizzazione: {cost}",
1176
- title: "Valutazione a fine turno",
1177
- modeHint: "Registrata dopo la risposta, senza effetti: per ora nessuno legge queste probabilità.",
1178
- version: "Versione delle domande: {version}",
1179
- leadFailed: "La valutazione non è riuscita o non ha risposto entro {budget} ms: non è stato registrato niente.",
1180
- probability: "Probabilità che il modello di valutazione dà alla domanda: da 0,5 in su propende per il sì"
1181
1139
  }
1182
1140
  };
1183
1141
  //#endregion
@@ -1,5 +1,6 @@
1
- import { MongoAbility, InferSubjects, ForcedSubject } from '@casl/ability';
1
+ import { MongoAbility, InferSubjects, ForcedSubject, Ability as PureAbility } from '@casl/ability';
2
2
  import { Action, Capability, Subject, Session } from './types';
3
+ import { MongoQueryTopLevelOperators } from '@ucast/mongo2js';
3
4
  import { Statements, RoleInput, Role, ExactRoleStatements } from 'better-auth/plugins';
4
5
  export declare const OrganizationRoles: {
5
6
  readonly admin: "admin";
@@ -12,20 +13,23 @@ export declare const UserRoles: {
12
13
  readonly user: "user";
13
14
  };
14
15
  export type AbilitySubject = InferSubjects<'all' | Subject, true> | ForcedSubject<InferSubjects<'all' | Subject, true>>;
15
- export type AppAbility = MongoAbility<[Action, AbilitySubject]>;
16
+ type Ability = MongoAbility<[Action, AbilitySubject]>;
17
+ export declare const ability: PureAbility<[Action, AbilitySubject], {
18
+ [x: string]: any;
19
+ [x: number]: any;
20
+ [x: symbol]: any;
21
+ } & MongoQueryTopLevelOperators<Record<PropertyKey, any>>>;
16
22
  export declare const isValidOrganizationRole: (role?: string | null) => role is keyof typeof OrganizationRoles;
17
23
  export declare const isValidUserRole: (role?: string | null) => role is keyof typeof UserRoles;
18
24
  export declare const getOrganizationRoleCapabilities: (currentSession?: Session | null) => Capability[];
19
25
  export declare const getUserRoleCapabilities: (currentSession?: Session | null) => Capability[];
20
26
  /**
21
- * Builds the ability of one caller: the session's roles, or the guest rules
22
- * when there is no session. Every call returns a new instance and this package
23
- * keeps none: a server judges many callers at once, so an instance shared
24
- * between them is judged by whoever wrote it last. The backend builds one per
25
- * request (`request.ability`), the Platform MCP one per tool call, and the
26
- * frontend keeps its own for the single user of the tab.
27
+ * Builds a standalone ability instance for a session, without touching the
28
+ * shared singleton. Use for per-call checks outside the HTTP request flow
29
+ * (e.g. MCP tool handlers).
27
30
  */
28
- export declare const buildAbilityForSession: (currentSession?: Session | null) => AppAbility;
31
+ export declare const buildAbilityForSession: (currentSession?: Session | null) => Ability;
32
+ export declare const updateAbilityFromSession: (currentSession?: Session | null) => void;
29
33
  export type PermissionMap = Partial<Record<Action, Subject>>;
30
34
  /**
31
35
  * Evaluates a route-style permission map ({ action: Subject }) against an
@@ -35,7 +39,7 @@ export type PermissionMap = Partial<Record<Action, Subject>>;
35
39
  * Single source of truth for both the HTTP preHandler and the Platform MCP
36
40
  * tool handlers.
37
41
  */
38
- export declare const findDeniedPermission: (abilityInstance: Pick<AppAbility, "can">, permissions: PermissionMap, payload?: unknown) => {
42
+ export declare const findDeniedPermission: (abilityInstance: Pick<Ability, "can">, permissions: PermissionMap, payload?: unknown) => {
39
43
  action: Action;
40
44
  subject: Subject;
41
45
  } | null;
@@ -1,28 +1,22 @@
1
1
  import { BetterAuthPlugin } from 'better-auth';
2
2
  /**
3
- * Whether `value` is exactly one of the trusted origins: a bare origin, listed
4
- * as it is. better-auth matches its trusted origins as patterns, so an agent
5
- * whose trusted origins hold `*` would let any page through; the CORS plugin
6
- * (apps/backend/src/plugins/fastifyCors.ts) compares them exactly, and a widget
7
- * whose host it refuses cannot run anyway.
8
- */
9
- export declare function isListedOrigin(value: string, trusted: string[]): boolean;
10
- /**
11
- * Backs the social sign-in that runs in a browser window on the backend origin.
3
+ * Backs the widget social-login OAuth popup flow end to end.
12
4
  *
13
5
  * `socialRedirect` initiates the flow through a top-level GET navigation instead
14
6
  * of the default `POST /sign-in/social` XHR call. Better-auth's social sign-in
15
7
  * sets a signed `state` cookie that the OAuth callback verifies (CSRF
16
- * protection). When the flow is started from an XHR on a different origin, that
17
- * `Set-Cookie` is a third-party cookie and modern browsers drop it, so the
18
- * callback fails with `state_mismatch`. By navigating the browser directly to
8
+ * protection). When the flow is started from an XHR on a different origin (e.g.
9
+ * the embeddable widget, or any cross-site context), that `Set-Cookie` is a
10
+ * third-party cookie and modern browsers drop it, so the callback fails with
11
+ * `state_mismatch`. By navigating the browser (popup or full page) directly to
19
12
  * this endpoint on the backend origin, the `state` cookie is set first-party and
20
- * survives. It mirrors the redirect branch of core `signInSocial`, reusing
21
- * `generateState` so the stored state stays compatible with the standard OAuth
22
- * callback. The frontend uses it; the widget's popup uses `oauthPopup`, whose
23
- * callback hands back the token of the session it just created, and only to the
24
- * origin that started it.
13
+ * survives, both in development and in production on customer domains. It mirrors
14
+ * the redirect branch of core `signInSocial`, reusing `generateState` so the
15
+ * stored state stays compatible with the standard OAuth callback.
25
16
  *
26
- * The before hook narrows the origin `oauthPopup` accepts to the listed ones.
17
+ * `widgetOAuthCallback` is the landing page the popup ends on after the OAuth
18
+ * callback completes (it's the `callbackURL` passed to `socialRedirect`). It runs
19
+ * on the backend origin so it can read the first-party session cookie and post the
20
+ * Bearer token back to the widget opener.
27
21
  */
28
22
  export declare function socialRedirect(): BetterAuthPlugin;
@@ -4,12 +4,6 @@ type __VLS_Props = {
4
4
  branding?: AgentBranding;
5
5
  authMethods?: AuthMethods;
6
6
  loading?: boolean;
7
- /**
8
- * Set while an email sign-in waits for its second factor: the
9
- * methods the account has (`totp`, `otp`). The code step replaces
10
- * the forms until it is answered or cancelled.
11
- */
12
- twoFactorMethods?: string[];
13
7
  };
14
8
  type __VLS_ModelProps = {
15
9
  'errorMessage'?: string | undefined;
@@ -49,12 +43,6 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, C
49
43
  email: string;
50
44
  }) => any;
51
45
  social: (provider: "google" | "microsoft") => any;
52
- "verify-two-factor": (payload: {
53
- kind: "totp" | "otp" | "backup";
54
- code: string;
55
- }) => any;
56
- "send-two-factor-code": () => any;
57
- "cancel-two-factor": () => any;
58
46
  }, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
59
47
  "onUpdate:errorMessage"?: ((message?: string | undefined) => any) | undefined;
60
48
  "onUpdate:success"?: ((value?: {
@@ -75,17 +63,10 @@ declare const __VLS_export: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, C
75
63
  email: string;
76
64
  }) => any) | undefined;
77
65
  onSocial?: ((provider: "google" | "microsoft") => any) | undefined;
78
- "onVerify-two-factor"?: ((payload: {
79
- kind: "totp" | "otp" | "backup";
80
- code: string;
81
- }) => any) | undefined;
82
- "onSend-two-factor-code"?: (() => any) | undefined;
83
- "onCancel-two-factor"?: (() => any) | undefined;
84
66
  }>, {
85
67
  branding: AgentBranding;
86
68
  authMethods: AuthMethods;
87
69
  loading: boolean;
88
- twoFactorMethods: string[];
89
70
  }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
90
71
  declare const _default: typeof __VLS_export;
91
72
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { ChatMessageActions, MessageFeedback, RevisedAnswer, UIChatMessage } from '../../../models/src';
2
- import { TextUIPart, CustomContentUIPart, ReasoningUIPart, DynamicToolUIPart, SourceUrlUIPart, SourceDocumentUIPart, ReasoningFileUIPart, StepStartUIPart, UIToolInvocation, UITool } from 'ai';
2
+ import { TextUIPart, UIToolInvocation, UITool } from 'ai';
3
3
  import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
4
4
  type __VLS_Props = {
5
5
  status?: 'submitted' | 'streaming' | 'ready' | 'error';
@@ -55,15 +55,11 @@ declare var __VLS_25: {
55
55
  part: TextUIPart;
56
56
  index: number;
57
57
  isLoading: boolean;
58
- }, __VLS_73: "custom" | "reasoning" | "text" | "dynamic-tool" | "source-url" | "source-document" | "reasoning-file" | "step-start" | `data-${string}` | `tool-${string}`, __VLS_74: {
58
+ }, __VLS_73: `tool-${string}`, __VLS_74: {
59
59
  message: UIChatMessage;
60
- part: TextUIPart | CustomContentUIPart | ReasoningUIPart | DynamicToolUIPart | SourceUrlUIPart | SourceDocumentUIPart | ReasoningFileUIPart | StepStartUIPart | ({
60
+ part: {
61
61
  type: `tool-${string}`;
62
- } & UIToolInvocation<UITool>) | {
63
- type: `data-${string}`;
64
- id?: string;
65
- data: unknown;
66
- };
62
+ } & UIToolInvocation<UITool>;
67
63
  index: number;
68
64
  isLoading: boolean;
69
65
  };
@@ -3,7 +3,6 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOp
3
3
  type __VLS_Props = {
4
4
  message: UIChatMessage;
5
5
  isStreaming?: boolean;
6
- hasContent?: boolean;
7
6
  isDark?: boolean;
8
7
  };
9
8
  declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
@@ -7,15 +7,6 @@ export { isTextPart, isFilePart, isToolPart, isReasoningPart, hasPartText, hasTe
7
7
  * that should logically be a single block of text.
8
8
  */
9
9
  export declare function mergeConsecutiveTextParts(parts: UIMessage['parts']): UIMessage['parts'];
10
- /**
11
- * Drops a widget call refused for its arguments when a later call of the same
12
- * widget in the message was drawn: the turn corrected it (the backend's
13
- * `correctableInputRefusals`), and the refusal would sit next to the working
14
- * widget, `showForm` drawing its render error above the form. A refusal with
15
- * nothing drawn after it stays. Only the feed reads this: the steps timeline
16
- * keeps every call, the refused one included.
17
- */
18
- export declare function dropCorrectedWidgetErrors(parts: UIMessage['parts']): UIMessage['parts'];
19
10
  export declare function isStreamingPart(part: UIMessage['parts'][number] | null | undefined): part is Extract<UIMessage['parts'][number], {
20
11
  streaming?: boolean;
21
12
  }>;
@@ -22,7 +22,6 @@ import { default as PkLoader } from './PkLoader';
22
22
  import { default as PkMedia } from './PkMedia';
23
23
  import { default as PkOfflineScreen } from './PkOfflineScreen';
24
24
  import { default as PkPwaNotices } from './PkPwaNotices';
25
- import { default as PkQrCode } from './PkQrCode';
26
25
  import { default as PkRelativeTime } from './PkRelativeTime';
27
26
  import { default as PkSkeleton } from './PkSkeleton';
28
27
  import { default as PkSvgViewer } from './PkSvgViewer';
@@ -33,4 +32,4 @@ export * from './chat';
33
32
  export * from './input';
34
33
  export * from './table';
35
34
  export * from './types';
36
- export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkCheckboxField, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkOfflineScreen, PkPwaNotices, PkQrCode, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
35
+ export { PkBadge, PkEditorAgentType, PkEditorDocumentType, PkEditorNotificationType, PkEditorCode, PkEditorJsonSchema, PkEditorMarkdown, PkEditorMedia, PkEditorPrompt, PkEditorRadioButtons, PkEditorCheckboxButtons, PkEditorRepeater, PkEditorWyswyg, PkCheckboxField, PkFieldset, PkInfobox, PkSchemaField, PkIntegrationProvider, PkLazyImg, PkLightbox, PkLoader, PkMedia, PkOfflineScreen, PkPwaNotices, PkRelativeTime, PkSkeleton, PkSvgViewer, PkUrl, };
@@ -633,16 +633,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
633
633
  failed?: boolean | undefined;
634
634
  } | undefined;
635
635
  } | undefined;
636
- turnEvaluation?: {
637
- version: number;
638
- mode: "shadow";
639
- probabilities: Record<string, number>;
640
- latencyMs: number;
641
- budgetMs: number;
642
- cost?: number | undefined;
643
- inputTokens?: number | undefined;
644
- failed?: true | undefined;
645
- } | undefined;
646
636
  } | undefined;
647
637
  parts: ({
648
638
  type: "text";
@@ -1149,16 +1139,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
1149
1139
  failed?: boolean | undefined;
1150
1140
  } | undefined;
1151
1141
  } | undefined;
1152
- turnEvaluation?: {
1153
- version: number;
1154
- mode: "shadow";
1155
- probabilities: Record<string, number>;
1156
- latencyMs: number;
1157
- budgetMs: number;
1158
- cost?: number | undefined;
1159
- inputTokens?: number | undefined;
1160
- failed?: true | undefined;
1161
- } | undefined;
1162
1142
  } | undefined;
1163
1143
  parts: ({
1164
1144
  type: "text";
@@ -2363,16 +2343,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
2363
2343
  failed?: boolean | undefined;
2364
2344
  } | undefined;
2365
2345
  } | undefined;
2366
- turnEvaluation?: {
2367
- version: number;
2368
- mode: "shadow";
2369
- probabilities: Record<string, number>;
2370
- latencyMs: number;
2371
- budgetMs: number;
2372
- cost?: number | undefined;
2373
- inputTokens?: number | undefined;
2374
- failed?: true | undefined;
2375
- } | undefined;
2376
2346
  } | undefined;
2377
2347
  parts: ({
2378
2348
  type: "text";
@@ -2879,16 +2849,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
2879
2849
  failed?: boolean | undefined;
2880
2850
  } | undefined;
2881
2851
  } | undefined;
2882
- turnEvaluation?: {
2883
- version: number;
2884
- mode: "shadow";
2885
- probabilities: Record<string, number>;
2886
- latencyMs: number;
2887
- budgetMs: number;
2888
- cost?: number | undefined;
2889
- inputTokens?: number | undefined;
2890
- failed?: true | undefined;
2891
- } | undefined;
2892
2852
  } | undefined;
2893
2853
  parts: ({
2894
2854
  type: "text";
@@ -4093,16 +4053,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
4093
4053
  failed?: boolean | undefined;
4094
4054
  } | undefined;
4095
4055
  } | undefined;
4096
- turnEvaluation?: {
4097
- version: number;
4098
- mode: "shadow";
4099
- probabilities: Record<string, number>;
4100
- latencyMs: number;
4101
- budgetMs: number;
4102
- cost?: number | undefined;
4103
- inputTokens?: number | undefined;
4104
- failed?: true | undefined;
4105
- } | undefined;
4106
4056
  } | undefined;
4107
4057
  parts: ({
4108
4058
  type: "text";
@@ -4609,16 +4559,6 @@ export declare function useChatbotStore(agentId: string): Store<`chatbot-${strin
4609
4559
  failed?: boolean | undefined;
4610
4560
  } | undefined;
4611
4561
  } | undefined;
4612
- turnEvaluation?: {
4613
- version: number;
4614
- mode: "shadow";
4615
- probabilities: Record<string, number>;
4616
- latencyMs: number;
4617
- budgetMs: number;
4618
- cost?: number | undefined;
4619
- inputTokens?: number | undefined;
4620
- failed?: true | undefined;
4621
- } | undefined;
4622
4562
  } | undefined;
4623
4563
  parts: ({
4624
4564
  type: "text";
@@ -492,52 +492,10 @@ export type UIChatMessageMetadata = {
492
492
  * organization ({@link withoutToolCatalogue}).
493
493
  */
494
494
  toolCatalogue?: ToolCatalogueRecord;
495
- /**
496
- * The evaluation of the turn after the reply (spec post-turn-evaluation):
497
- * a probability per question. Written after the answer, and removed from
498
- * a public read ({@link withoutTurnEvaluation}).
499
- */
500
- turnEvaluation?: TurnEvaluationRecord;
501
- };
502
- /**
503
- * The questions of the post-turn evaluation, in the order they are asked and
504
- * listed. The backend's questions are typed against it, so the two cannot
505
- * drift. A reader orders by this list and not by the record: jsonb keeps the
506
- * keys of an object sorted by length, not in the order they were written.
507
- */
508
- export declare const TURN_EVALUATION_QUESTION_IDS: readonly ["durableFact", "abusive", "manipulation", "asksHuman", "missingInfo", "informationGap"];
509
- export type TurnEvaluationQuestionId = (typeof TURN_EVALUATION_QUESTION_IDS)[number];
510
- /**
511
- * The evaluation model's answers on a finished turn (spec
512
- * post-turn-evaluation, F1). Recorded in shadow only: nothing reads it yet.
513
- */
514
- export type TurnEvaluationRecord = {
515
- /**
516
- * The wording of the questions: a threshold holds only for the wording
517
- * it was measured on, so a record says which one it answered.
518
- */
519
- version: number;
520
- mode: 'shadow';
521
- /** Probability per question, two decimals. Empty when the request failed. */
522
- probabilities: Record<string, number>;
523
- latencyMs: number;
524
- budgetMs: number;
525
- /** Market cost of the request in USD. */
526
- cost?: number;
527
- inputTokens?: number;
528
- /** The request failed or ran past its budget: no answer was recorded. */
529
- failed?: true;
530
495
  };
531
496
  export type UIChatMessage = UIMessage & {
532
497
  metadata?: UIChatMessageMetadata;
533
498
  };
534
- /**
535
- * The history without the turn evaluations, for a public read: a probability
536
- * of abuse on a user must not reach the widget. Kept apart from
537
- * {@link withoutToolCatalogue}, which the data export uses too, because
538
- * whether the export includes this judgment is still to be decided.
539
- */
540
- export declare function withoutTurnEvaluation(messages: UIChatMessage[]): UIChatMessage[];
541
499
  /**
542
500
  * The history without the tool catalogue records, for a reader outside the
543
501
  * organization (a public chat read, the data export): a record names every
@@ -2,6 +2,7 @@ import { z } from 'zod';
2
2
  export declare const MAX_FILE_SIZE: number;
3
3
  export declare const MIME_TYPE_REGEX: RegExp;
4
4
  export declare const SUPPORTED_IMAGE_TYPES: readonly ["image/jpeg", "image/png", "image/gif", "image/webp", "image/svg+xml"];
5
+ export declare const SUPPORTED_DOCUMENT_TYPES: readonly ["application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "text/plain", "text/markdown"];
5
6
  export declare const SUPPORTED_VIDEO_TYPES: readonly ["video/mp4", "video/webm", "video/ogg"];
6
7
  export declare const SUPPORTED_AUDIO_TYPES: readonly ["audio/mpeg", "audio/wav", "audio/ogg"];
7
8
  export declare enum StoragePolicy {
@@ -119,9 +119,6 @@ export declare const MemberSchema: z.ZodObject<{
119
119
  user: "user";
120
120
  admin: "admin";
121
121
  }>;
122
- twoFactorEnabled: z.ZodOptional<z.ZodBoolean>;
123
- hasPassword: z.ZodOptional<z.ZodBoolean>;
124
- hasPasskey: z.ZodOptional<z.ZodBoolean>;
125
122
  }, z.core.$strip>;
126
123
  }, z.core.$strip>;
127
124
  export type Member = z.infer<typeof MemberSchema>;
@@ -4,8 +4,6 @@ export declare const NotificationType: {
4
4
  readonly ApiKeyExpiring: "api_key_expiring";
5
5
  readonly Organization: "organization";
6
6
  readonly PasswordResetRequested: "password_reset_requested";
7
- /** Two-step verification turned on, off, or reset by an administrator. */
8
- readonly TwoFactor: "two_factor";
9
7
  /** A sync took documents out because the remote no longer has them. */
10
8
  readonly DocumentSyncRemoved: "document_sync_removed";
11
9
  readonly ChatWarning: "chat_warning";
@@ -106,7 +106,6 @@ export declare const OrganizationSchema: z.ZodObject<{
106
106
  deletedAt: z.ZodNullable<z.ZodCoercedDate<unknown>>;
107
107
  deletedBy: z.ZodNullable<z.ZodString>;
108
108
  metadata: z.ZodNullable<z.ZodString>;
109
- requireTwoFactor: z.ZodOptional<z.ZodBoolean>;
110
109
  }, z.core.$strip>;
111
110
  export type Organization = z.infer<typeof OrganizationSchema>;
112
111
  export declare const OrganizationDtoSchema: z.ZodObject<{
@@ -118,7 +118,6 @@ export declare const UserSchema: z.ZodObject<{
118
118
  user: "user";
119
119
  admin: "admin";
120
120
  }>;
121
- twoFactorEnabled: z.ZodOptional<z.ZodBoolean>;
122
121
  }, z.core.$strip>;
123
122
  export type User = z.infer<typeof UserSchema>;
124
123
  /**