@burtson-labs/bandit-engine 2.0.166 → 2.0.168

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 (48) hide show
  1. package/dist/chat-7LOFYEWE.mjs +15 -0
  2. package/dist/chat-provider.js +154 -38
  3. package/dist/chat-provider.js.map +1 -1
  4. package/dist/chat-provider.mjs +5 -5
  5. package/dist/{chunk-M4DWPNZZ.mjs → chunk-4SXXEGEK.mjs} +145 -30
  6. package/dist/chunk-4SXXEGEK.mjs.map +1 -0
  7. package/dist/{chunk-Q2DINRIU.mjs → chunk-62IYSU3I.mjs} +5 -4
  8. package/dist/chunk-62IYSU3I.mjs.map +1 -0
  9. package/dist/{chunk-6KRAPGXE.mjs → chunk-CABOLDNR.mjs} +2 -2
  10. package/dist/{chunk-MM3NRLVR.mjs → chunk-E5WMDLE3.mjs} +2 -2
  11. package/dist/{chunk-IB2LPSQQ.mjs → chunk-JD6C64CT.mjs} +2 -2
  12. package/dist/{chunk-33OSALGS.mjs → chunk-KAXUI5H7.mjs} +155 -41
  13. package/dist/chunk-KAXUI5H7.mjs.map +1 -0
  14. package/dist/{chunk-A6W6XIDD.mjs → chunk-QI67R5F6.mjs} +5 -5
  15. package/dist/{chunk-75OBTJPN.mjs → chunk-R3NOM2DG.mjs} +4 -4
  16. package/dist/{chunk-YH5YWK4K.mjs → chunk-SZJB5FLZ.mjs} +2 -2
  17. package/dist/{chunk-YH5YWK4K.mjs.map → chunk-SZJB5FLZ.mjs.map} +1 -1
  18. package/dist/{chunk-WSZE3DDJ.mjs → chunk-YGOLNWXJ.mjs} +9 -6
  19. package/dist/chunk-YGOLNWXJ.mjs.map +1 -0
  20. package/dist/index.d.mts +56 -4
  21. package/dist/index.d.ts +56 -4
  22. package/dist/index.js +309 -68
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +10 -10
  25. package/dist/management/management.js +308 -68
  26. package/dist/management/management.js.map +1 -1
  27. package/dist/management/management.mjs +8 -8
  28. package/dist/modals/chat-modal/chat-modal.js +159 -42
  29. package/dist/modals/chat-modal/chat-modal.js.map +1 -1
  30. package/dist/modals/chat-modal/chat-modal.mjs +4 -4
  31. package/dist/{modelStore-F6JQUXGG.mjs → modelStore-TFNX4GEC.mjs} +2 -2
  32. package/dist/{public-0EYmtpGD.d.ts → public-DJa4Db00.d.mts} +9 -0
  33. package/dist/{public-0EYmtpGD.d.mts → public-DJa4Db00.d.ts} +9 -0
  34. package/dist/public-types.d.mts +1 -1
  35. package/dist/public-types.d.ts +1 -1
  36. package/package.json +1 -1
  37. package/dist/chat-RCMZYACB.mjs +0 -15
  38. package/dist/chunk-33OSALGS.mjs.map +0 -1
  39. package/dist/chunk-M4DWPNZZ.mjs.map +0 -1
  40. package/dist/chunk-Q2DINRIU.mjs.map +0 -1
  41. package/dist/chunk-WSZE3DDJ.mjs.map +0 -1
  42. /package/dist/{chat-RCMZYACB.mjs.map → chat-7LOFYEWE.mjs.map} +0 -0
  43. /package/dist/{chunk-6KRAPGXE.mjs.map → chunk-CABOLDNR.mjs.map} +0 -0
  44. /package/dist/{chunk-MM3NRLVR.mjs.map → chunk-E5WMDLE3.mjs.map} +0 -0
  45. /package/dist/{chunk-IB2LPSQQ.mjs.map → chunk-JD6C64CT.mjs.map} +0 -0
  46. /package/dist/{chunk-A6W6XIDD.mjs.map → chunk-QI67R5F6.mjs.map} +0 -0
  47. /package/dist/{chunk-75OBTJPN.mjs.map → chunk-R3NOM2DG.mjs.map} +0 -0
  48. /package/dist/{modelStore-F6JQUXGG.mjs.map → modelStore-TFNX4GEC.mjs.map} +0 -0
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-0EYmtpGD.mjs';
2
- export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-0EYmtpGD.mjs';
1
+ import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-DJa4Db00.mjs';
2
+ export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-DJa4Db00.mjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React, { ReactNode } from 'react';
5
5
  import { Theme } from '@mui/material/styles';
@@ -1007,6 +1007,39 @@ declare function getCriticalConfig(): {
1007
1007
  timestamp: string;
1008
1008
  };
1009
1009
 
1010
+ /**
1011
+ * Knowledge file listing (GET {gateway}/embedding/files).
1012
+ *
1013
+ * The gateway's file store is shared with every Burtson Labs product that keeps files in the
1014
+ * account: Drive uploads, attachments pulled out of email (Outlook's image001.png, Word's
1015
+ * ~WRD0548.jpg), app assets, Image Studio output. Knowledge should show only the documents that
1016
+ * are indexed for Knowledge search.
1017
+ *
1018
+ * Current gateways scope the list on the server (`scope=knowledge`, the default: files with a
1019
+ * vector in the documents index) and answer with a paged envelope:
1020
+ * { files, total, skip, limit, hasMore, scope, knowledgeFilterUnavailable }
1021
+ * Older gateways answer with a bare array of every file. For those, `knowledge` scope falls back
1022
+ * to a client-side filter that drops images, media and temporary files (Knowledge uploads only
1023
+ * accept documents, code and data), and the page reports how many it hid so the UI can offer
1024
+ * "All workspace files".
1025
+ */
1026
+ type KnowledgeFileScope = 'knowledge' | 'all';
1027
+ type RawFileRecord = Record<string, unknown>;
1028
+ interface KnowledgeFilePage {
1029
+ files: RawFileRecord[];
1030
+ /** Files matching the scope in total (server count), or the filtered count of this page on old gateways. */
1031
+ total: number;
1032
+ hasMore: boolean;
1033
+ /** The scope the listing actually has. */
1034
+ scope: KnowledgeFileScope;
1035
+ /** The server applied the scope (current gateway). False: old gateway, client-side filter. */
1036
+ serverScoped: boolean;
1037
+ /** Knowledge was asked for but the index couldn't be checked, so this is every workspace file. */
1038
+ knowledgeFilterUnavailable: boolean;
1039
+ /** Files hidden by the client-side filter on this page (old gateways only). */
1040
+ hiddenCount: number;
1041
+ }
1042
+
1010
1043
  interface VectorMemory {
1011
1044
  id: string;
1012
1045
  content: string;
@@ -1040,6 +1073,13 @@ interface VectorDocument {
1040
1073
  isUserContent: boolean;
1041
1074
  isTeamContent: boolean;
1042
1075
  contentSource: 'user' | 'team';
1076
+ /** File size in bytes, when the listing reports it. */
1077
+ size?: number;
1078
+ bucket?: string;
1079
+ teamSid?: string;
1080
+ userEmail?: string;
1081
+ /** Short text preview extracted when the file was indexed. */
1082
+ preview?: string;
1043
1083
  }
1044
1084
  interface SearchResult {
1045
1085
  memories: VectorMemory[];
@@ -1047,7 +1087,6 @@ interface SearchResult {
1047
1087
  success: boolean;
1048
1088
  message?: string;
1049
1089
  }
1050
- type RawFileRecord = Record<string, unknown>;
1051
1090
  interface MemorySearchFilters {
1052
1091
  includePinned?: boolean;
1053
1092
  topics?: string[];
@@ -1232,7 +1271,15 @@ declare class VectorDatabaseService {
1232
1271
  */
1233
1272
  getAvailableFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1234
1273
  /**
1235
- * Get user's files - tries both Gateway API and file storage API
1274
+ * One page of the Knowledge file list from the gateway (see ./knowledgeFiles).
1275
+ *
1276
+ * No fallback to the file storage API here: its listing is the whole Drive (every product's
1277
+ * files), which is exactly what Knowledge must not show. A failure surfaces to the caller.
1278
+ */
1279
+ listKnowledgeFiles(skip?: number, limit?: number, scope?: KnowledgeFileScope): Promise<KnowledgeFilePage>;
1280
+ /**
1281
+ * Get the user's Knowledge files (first page, knowledge scope). Kept for existing callers;
1282
+ * prefer listKnowledgeFiles for totals and paging.
1236
1283
  */
1237
1284
  getUserFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1238
1285
  /**
@@ -1403,6 +1450,10 @@ interface SearchOptions {
1403
1450
  useVector?: boolean;
1404
1451
  filters?: MemorySearchFilters;
1405
1452
  }
1453
+ /** One page of Knowledge documents, ready for the Knowledge view. */
1454
+ interface KnowledgeDocumentPage extends Omit<KnowledgeFilePage, 'files'> {
1455
+ documents: VectorDocument[];
1456
+ }
1406
1457
  /**
1407
1458
  * Advanced Vector Storage Hook
1408
1459
  *
@@ -1517,6 +1568,7 @@ declare const useVectorStore: () => {
1517
1568
  }>;
1518
1569
  searchDocuments: (query: string, options?: SearchOptions) => Promise<VectorDocument[]>;
1519
1570
  getUserDocuments: (skip?: number, limit?: number) => Promise<VectorDocument[]>;
1571
+ getKnowledgeDocumentsPage: (skip?: number, limit?: number, scope?: KnowledgeFileScope) => Promise<KnowledgeDocumentPage>;
1520
1572
  deleteDocument: (fileId: string) => Promise<{
1521
1573
  success: boolean;
1522
1574
  error?: string;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-0EYmtpGD.js';
2
- export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-0EYmtpGD.js';
1
+ import { F as FeatureKey, a as FeatureEvaluation, S as SubscriptionTier, b as FeatureFlagConfig, T as TrialUsage } from './public-DJa4Db00.js';
2
+ export { A as AIChatRequest, c as AIChatResponse, d as AIGenerateRequest, e as AIGenerateResponse, f as AIMessage, g as AIModel, h as AIProviderConfig, C as ChatConfig, i as ChatModal, j as ChatModalProps, k as ChatProvider, D as DEFAULT_TIER_FEATURES, l as FeatureMatrix, O as OSS_DEFAULT_FEATURES, P as PackageSettings, V as VoiceModelsResponse, m as VoiceService, v as voiceService } from './public-DJa4Db00.js';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import React, { ReactNode } from 'react';
5
5
  import { Theme } from '@mui/material/styles';
@@ -1007,6 +1007,39 @@ declare function getCriticalConfig(): {
1007
1007
  timestamp: string;
1008
1008
  };
1009
1009
 
1010
+ /**
1011
+ * Knowledge file listing (GET {gateway}/embedding/files).
1012
+ *
1013
+ * The gateway's file store is shared with every Burtson Labs product that keeps files in the
1014
+ * account: Drive uploads, attachments pulled out of email (Outlook's image001.png, Word's
1015
+ * ~WRD0548.jpg), app assets, Image Studio output. Knowledge should show only the documents that
1016
+ * are indexed for Knowledge search.
1017
+ *
1018
+ * Current gateways scope the list on the server (`scope=knowledge`, the default: files with a
1019
+ * vector in the documents index) and answer with a paged envelope:
1020
+ * { files, total, skip, limit, hasMore, scope, knowledgeFilterUnavailable }
1021
+ * Older gateways answer with a bare array of every file. For those, `knowledge` scope falls back
1022
+ * to a client-side filter that drops images, media and temporary files (Knowledge uploads only
1023
+ * accept documents, code and data), and the page reports how many it hid so the UI can offer
1024
+ * "All workspace files".
1025
+ */
1026
+ type KnowledgeFileScope = 'knowledge' | 'all';
1027
+ type RawFileRecord = Record<string, unknown>;
1028
+ interface KnowledgeFilePage {
1029
+ files: RawFileRecord[];
1030
+ /** Files matching the scope in total (server count), or the filtered count of this page on old gateways. */
1031
+ total: number;
1032
+ hasMore: boolean;
1033
+ /** The scope the listing actually has. */
1034
+ scope: KnowledgeFileScope;
1035
+ /** The server applied the scope (current gateway). False: old gateway, client-side filter. */
1036
+ serverScoped: boolean;
1037
+ /** Knowledge was asked for but the index couldn't be checked, so this is every workspace file. */
1038
+ knowledgeFilterUnavailable: boolean;
1039
+ /** Files hidden by the client-side filter on this page (old gateways only). */
1040
+ hiddenCount: number;
1041
+ }
1042
+
1010
1043
  interface VectorMemory {
1011
1044
  id: string;
1012
1045
  content: string;
@@ -1040,6 +1073,13 @@ interface VectorDocument {
1040
1073
  isUserContent: boolean;
1041
1074
  isTeamContent: boolean;
1042
1075
  contentSource: 'user' | 'team';
1076
+ /** File size in bytes, when the listing reports it. */
1077
+ size?: number;
1078
+ bucket?: string;
1079
+ teamSid?: string;
1080
+ userEmail?: string;
1081
+ /** Short text preview extracted when the file was indexed. */
1082
+ preview?: string;
1043
1083
  }
1044
1084
  interface SearchResult {
1045
1085
  memories: VectorMemory[];
@@ -1047,7 +1087,6 @@ interface SearchResult {
1047
1087
  success: boolean;
1048
1088
  message?: string;
1049
1089
  }
1050
- type RawFileRecord = Record<string, unknown>;
1051
1090
  interface MemorySearchFilters {
1052
1091
  includePinned?: boolean;
1053
1092
  topics?: string[];
@@ -1232,7 +1271,15 @@ declare class VectorDatabaseService {
1232
1271
  */
1233
1272
  getAvailableFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1234
1273
  /**
1235
- * Get user's files - tries both Gateway API and file storage API
1274
+ * One page of the Knowledge file list from the gateway (see ./knowledgeFiles).
1275
+ *
1276
+ * No fallback to the file storage API here: its listing is the whole Drive (every product's
1277
+ * files), which is exactly what Knowledge must not show. A failure surfaces to the caller.
1278
+ */
1279
+ listKnowledgeFiles(skip?: number, limit?: number, scope?: KnowledgeFileScope): Promise<KnowledgeFilePage>;
1280
+ /**
1281
+ * Get the user's Knowledge files (first page, knowledge scope). Kept for existing callers;
1282
+ * prefer listKnowledgeFiles for totals and paging.
1236
1283
  */
1237
1284
  getUserFiles(skip?: number, limit?: number): Promise<RawFileRecord[]>;
1238
1285
  /**
@@ -1403,6 +1450,10 @@ interface SearchOptions {
1403
1450
  useVector?: boolean;
1404
1451
  filters?: MemorySearchFilters;
1405
1452
  }
1453
+ /** One page of Knowledge documents, ready for the Knowledge view. */
1454
+ interface KnowledgeDocumentPage extends Omit<KnowledgeFilePage, 'files'> {
1455
+ documents: VectorDocument[];
1456
+ }
1406
1457
  /**
1407
1458
  * Advanced Vector Storage Hook
1408
1459
  *
@@ -1517,6 +1568,7 @@ declare const useVectorStore: () => {
1517
1568
  }>;
1518
1569
  searchDocuments: (query: string, options?: SearchOptions) => Promise<VectorDocument[]>;
1519
1570
  getUserDocuments: (skip?: number, limit?: number) => Promise<VectorDocument[]>;
1571
+ getKnowledgeDocumentsPage: (skip?: number, limit?: number, scope?: KnowledgeFileScope) => Promise<KnowledgeDocumentPage>;
1520
1572
  deleteDocument: (fileId: string) => Promise<{
1521
1573
  success: boolean;
1522
1574
  error?: string;