@bernierllc/chat-suite 1.0.0

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 (105) hide show
  1. package/.eslintrc.js +26 -0
  2. package/README.md +542 -0
  3. package/__tests__/integration/ChatSuite.test.ts +235 -0
  4. package/__tests__/unit/ConfigManager.test.ts +122 -0
  5. package/__tests__/unit/MessageOrchestrator.test.ts +223 -0
  6. package/__tests__/unit/UserManager.test.ts +208 -0
  7. package/dist/ChatSuite.d.ts +76 -0
  8. package/dist/ChatSuite.d.ts.map +1 -0
  9. package/dist/ChatSuite.js +273 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +37 -0
  13. package/dist/neverhub/discovery.d.ts +40 -0
  14. package/dist/neverhub/discovery.d.ts.map +1 -0
  15. package/dist/neverhub/discovery.js +106 -0
  16. package/dist/neverhub/event-handlers.d.ts +38 -0
  17. package/dist/neverhub/event-handlers.d.ts.map +1 -0
  18. package/dist/neverhub/event-handlers.js +125 -0
  19. package/dist/neverhub/index.d.ts +4 -0
  20. package/dist/neverhub/index.d.ts.map +1 -0
  21. package/dist/neverhub/index.js +26 -0
  22. package/dist/neverhub/service-registration.d.ts +29 -0
  23. package/dist/neverhub/service-registration.d.ts.map +1 -0
  24. package/dist/neverhub/service-registration.js +66 -0
  25. package/dist/providers/ChatKitProvider.d.ts +53 -0
  26. package/dist/providers/ChatKitProvider.d.ts.map +1 -0
  27. package/dist/providers/ChatKitProvider.js +167 -0
  28. package/dist/providers/ExternalProviders.d.ts +101 -0
  29. package/dist/providers/ExternalProviders.d.ts.map +1 -0
  30. package/dist/providers/ExternalProviders.js +153 -0
  31. package/dist/providers/index.d.ts +3 -0
  32. package/dist/providers/index.d.ts.map +1 -0
  33. package/dist/providers/index.js +25 -0
  34. package/dist/services/ConfigManager.d.ts +50 -0
  35. package/dist/services/ConfigManager.d.ts.map +1 -0
  36. package/dist/services/ConfigManager.js +95 -0
  37. package/dist/services/HealthMonitor.d.ts +58 -0
  38. package/dist/services/HealthMonitor.d.ts.map +1 -0
  39. package/dist/services/HealthMonitor.js +148 -0
  40. package/dist/services/MessageOrchestrator.d.ts +63 -0
  41. package/dist/services/MessageOrchestrator.d.ts.map +1 -0
  42. package/dist/services/MessageOrchestrator.js +212 -0
  43. package/dist/services/ProviderManager.d.ts +83 -0
  44. package/dist/services/ProviderManager.d.ts.map +1 -0
  45. package/dist/services/ProviderManager.js +204 -0
  46. package/dist/services/UserManager.d.ts +61 -0
  47. package/dist/services/UserManager.d.ts.map +1 -0
  48. package/dist/services/UserManager.js +141 -0
  49. package/dist/services/index.d.ts +6 -0
  50. package/dist/services/index.d.ts.map +1 -0
  51. package/dist/services/index.js +28 -0
  52. package/dist/types/index.d.ts +4 -0
  53. package/dist/types/index.d.ts.map +1 -0
  54. package/dist/types/index.js +26 -0
  55. package/dist/types/message-types.d.ts +80 -0
  56. package/dist/types/message-types.d.ts.map +1 -0
  57. package/dist/types/message-types.js +32 -0
  58. package/dist/types/provider-types.d.ts +96 -0
  59. package/dist/types/provider-types.d.ts.map +1 -0
  60. package/dist/types/provider-types.js +9 -0
  61. package/dist/types/suite-types.d.ts +101 -0
  62. package/dist/types/suite-types.d.ts.map +1 -0
  63. package/dist/types/suite-types.js +9 -0
  64. package/dist/utils/config-inheritance.d.ts +24 -0
  65. package/dist/utils/config-inheritance.d.ts.map +1 -0
  66. package/dist/utils/config-inheritance.js +167 -0
  67. package/dist/utils/error-handling.d.ts +37 -0
  68. package/dist/utils/error-handling.d.ts.map +1 -0
  69. package/dist/utils/error-handling.js +102 -0
  70. package/dist/utils/index.d.ts +5 -0
  71. package/dist/utils/index.d.ts.map +1 -0
  72. package/dist/utils/index.js +27 -0
  73. package/dist/utils/message-bridge.d.ts +68 -0
  74. package/dist/utils/message-bridge.d.ts.map +1 -0
  75. package/dist/utils/message-bridge.js +126 -0
  76. package/dist/utils/user-mapping.d.ts +63 -0
  77. package/dist/utils/user-mapping.d.ts.map +1 -0
  78. package/dist/utils/user-mapping.js +110 -0
  79. package/jest.config.cjs +30 -0
  80. package/package.json +67 -0
  81. package/src/ChatSuite.ts +347 -0
  82. package/src/index.ts +25 -0
  83. package/src/neverhub/discovery.ts +137 -0
  84. package/src/neverhub/event-handlers.ts +141 -0
  85. package/src/neverhub/index.ts +11 -0
  86. package/src/neverhub/service-registration.ts +89 -0
  87. package/src/providers/ChatKitProvider.ts +193 -0
  88. package/src/providers/ExternalProviders.ts +171 -0
  89. package/src/providers/index.ts +10 -0
  90. package/src/services/ConfigManager.ts +112 -0
  91. package/src/services/HealthMonitor.ts +169 -0
  92. package/src/services/MessageOrchestrator.ts +271 -0
  93. package/src/services/ProviderManager.ts +247 -0
  94. package/src/services/UserManager.ts +176 -0
  95. package/src/services/index.ts +13 -0
  96. package/src/types/index.ts +11 -0
  97. package/src/types/message-types.ts +94 -0
  98. package/src/types/provider-types.ts +116 -0
  99. package/src/types/suite-types.ts +117 -0
  100. package/src/utils/config-inheritance.ts +189 -0
  101. package/src/utils/error-handling.ts +114 -0
  102. package/src/utils/index.ts +12 -0
  103. package/src/utils/message-bridge.ts +164 -0
  104. package/src/utils/user-mapping.ts +132 -0
  105. package/tsconfig.json +31 -0
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.UserManager = void 0;
11
+ const user_mapping_1 = require("../utils/user-mapping");
12
+ /**
13
+ * Manages users across all chat providers
14
+ */
15
+ class UserManager {
16
+ constructor() {
17
+ this.mapper = new user_mapping_1.UserMapper();
18
+ }
19
+ /**
20
+ * Register a new user or update existing user
21
+ */
22
+ registerUser(registration) {
23
+ try {
24
+ // Check if user already exists
25
+ const existingId = this.mapper.getUnifiedId(registration.provider, registration.platformUserId);
26
+ if (existingId) {
27
+ // Update existing user
28
+ const identity = this.mapper.getIdentity(existingId);
29
+ if (identity) {
30
+ if (registration.displayName) {
31
+ identity.displayName = registration.displayName;
32
+ }
33
+ if (registration.email) {
34
+ identity.email = registration.email;
35
+ }
36
+ if (registration.metadata) {
37
+ identity.metadata = { ...identity.metadata, ...registration.metadata };
38
+ }
39
+ this.mapper.mapUser(identity);
40
+ return { success: true, data: identity };
41
+ }
42
+ }
43
+ // Create new user
44
+ const platformIds = new Map();
45
+ platformIds.set(registration.provider, registration.platformUserId);
46
+ const newIdentity = {
47
+ unifiedId: (0, user_mapping_1.createUnifiedId)(),
48
+ platformIds,
49
+ displayName: registration.displayName,
50
+ email: registration.email,
51
+ metadata: registration.metadata
52
+ };
53
+ this.mapper.mapUser(newIdentity);
54
+ return { success: true, data: newIdentity };
55
+ }
56
+ catch (error) {
57
+ return {
58
+ success: false,
59
+ error: error instanceof Error ? error.message : 'Failed to register user'
60
+ };
61
+ }
62
+ }
63
+ /**
64
+ * Link a platform account to an existing user
65
+ */
66
+ linkPlatform(unifiedId, provider, platformUserId) {
67
+ try {
68
+ const success = this.mapper.addPlatformId(unifiedId, provider, platformUserId);
69
+ if (!success) {
70
+ return { success: false, error: 'User not found' };
71
+ }
72
+ const identity = this.mapper.getIdentity(unifiedId);
73
+ return { success: true, data: identity };
74
+ }
75
+ catch (error) {
76
+ return {
77
+ success: false,
78
+ error: error instanceof Error ? error.message : 'Failed to link platform'
79
+ };
80
+ }
81
+ }
82
+ /**
83
+ * Get unified user ID from platform-specific ID
84
+ */
85
+ getUnifiedId(provider, platformUserId) {
86
+ return this.mapper.getUnifiedId(provider, platformUserId);
87
+ }
88
+ /**
89
+ * Get platform-specific user ID
90
+ */
91
+ getPlatformId(unifiedId, provider) {
92
+ return this.mapper.getPlatformId(unifiedId, provider);
93
+ }
94
+ /**
95
+ * Get complete user identity
96
+ */
97
+ getUser(unifiedId) {
98
+ const identity = this.mapper.getIdentity(unifiedId);
99
+ if (!identity) {
100
+ return { success: false, error: 'User not found' };
101
+ }
102
+ return { success: true, data: identity };
103
+ }
104
+ /**
105
+ * Get all users
106
+ */
107
+ getAllUsers() {
108
+ return this.mapper.getAllUsers();
109
+ }
110
+ /**
111
+ * Remove a user
112
+ */
113
+ removeUser(unifiedId) {
114
+ const success = this.mapper.removeUser(unifiedId);
115
+ if (!success) {
116
+ return { success: false, error: 'User not found' };
117
+ }
118
+ return { success: true };
119
+ }
120
+ /**
121
+ * Get user count
122
+ */
123
+ getUserCount() {
124
+ return this.mapper.size();
125
+ }
126
+ /**
127
+ * Search users by display name or email
128
+ */
129
+ searchUsers(query) {
130
+ const lowerQuery = query.toLowerCase();
131
+ return this.mapper.getAllUsers().filter(user => user.displayName?.toLowerCase().includes(lowerQuery) ||
132
+ user.email?.toLowerCase().includes(lowerQuery));
133
+ }
134
+ /**
135
+ * Clear all users
136
+ */
137
+ clear() {
138
+ this.mapper.clear();
139
+ }
140
+ }
141
+ exports.UserManager = UserManager;
@@ -0,0 +1,6 @@
1
+ export * from './ConfigManager';
2
+ export * from './UserManager';
3
+ export * from './HealthMonitor';
4
+ export * from './ProviderManager';
5
+ export * from './MessageOrchestrator';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAQA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ __exportStar(require("./ConfigManager"), exports);
25
+ __exportStar(require("./UserManager"), exports);
26
+ __exportStar(require("./HealthMonitor"), exports);
27
+ __exportStar(require("./ProviderManager"), exports);
28
+ __exportStar(require("./MessageOrchestrator"), exports);
@@ -0,0 +1,4 @@
1
+ export * from './provider-types';
2
+ export * from './message-types';
3
+ export * from './suite-types';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAQA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ var desc = Object.getOwnPropertyDescriptor(m, k);
12
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
+ desc = { enumerable: true, get: function() { return m[k]; } };
14
+ }
15
+ Object.defineProperty(o, k2, desc);
16
+ }) : (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ o[k2] = m[k];
19
+ }));
20
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
+ };
23
+ Object.defineProperty(exports, "__esModule", { value: true });
24
+ __exportStar(require("./provider-types"), exports);
25
+ __exportStar(require("./message-types"), exports);
26
+ __exportStar(require("./suite-types"), exports);
@@ -0,0 +1,80 @@
1
+ import type { ProviderType, ProviderAttachment } from './provider-types';
2
+ /**
3
+ * Message priority levels
4
+ */
5
+ export declare enum MessagePriority {
6
+ LOW = "low",
7
+ NORMAL = "normal",
8
+ HIGH = "high",
9
+ URGENT = "urgent"
10
+ }
11
+ /**
12
+ * Message status
13
+ */
14
+ export declare enum MessageStatus {
15
+ PENDING = "pending",
16
+ ROUTING = "routing",
17
+ SENDING = "sending",
18
+ SENT = "sent",
19
+ FAILED = "failed",
20
+ RETRYING = "retrying"
21
+ }
22
+ /**
23
+ * Orchestrated message that will be routed through the suite
24
+ */
25
+ export interface OrchestratedMessage {
26
+ id: string;
27
+ content: string;
28
+ userId?: string;
29
+ channelId?: string;
30
+ threadId?: string;
31
+ attachments?: ProviderAttachment[];
32
+ priority: MessagePriority;
33
+ status: MessageStatus;
34
+ targetProviders?: ProviderType[];
35
+ metadata?: Record<string, unknown>;
36
+ createdAt: Date;
37
+ updatedAt: Date;
38
+ }
39
+ /**
40
+ * Message routing decision
41
+ */
42
+ export interface RoutingDecision {
43
+ provider: ProviderType;
44
+ confidence: number;
45
+ reasoning?: string;
46
+ fallbackProviders?: ProviderType[];
47
+ }
48
+ /**
49
+ * Message broadcast configuration
50
+ */
51
+ export interface BroadcastConfig {
52
+ content: string;
53
+ platforms: ProviderType[];
54
+ channels?: string[];
55
+ priority?: MessagePriority;
56
+ metadata?: Record<string, unknown>;
57
+ }
58
+ /**
59
+ * Message bridge configuration for cross-platform sync
60
+ */
61
+ export interface MessageBridgeConfig {
62
+ enabled: boolean;
63
+ sourceProviders: ProviderType[];
64
+ targetProviders: ProviderType[];
65
+ channelMappings?: Map<string, string>;
66
+ syncReactions?: boolean;
67
+ syncEdits?: boolean;
68
+ syncDeletions?: boolean;
69
+ }
70
+ /**
71
+ * Message event data
72
+ */
73
+ export interface MessageEvent {
74
+ type: 'message.sent' | 'message.received' | 'message.failed' | 'message.bridged';
75
+ messageId: string;
76
+ provider: ProviderType;
77
+ timestamp: Date;
78
+ data: Record<string, unknown>;
79
+ }
80
+ //# sourceMappingURL=message-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message-types.d.ts","sourceRoot":"","sources":["../../src/types/message-types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEzE;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,QAAQ,EAAE,eAAe,CAAC;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,eAAe,CAAC,EAAE,YAAY,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,MA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-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.MessageStatus = exports.MessagePriority = void 0;
11
+ /**
12
+ * Message priority levels
13
+ */
14
+ var MessagePriority;
15
+ (function (MessagePriority) {
16
+ MessagePriority["LOW"] = "low";
17
+ MessagePriority["NORMAL"] = "normal";
18
+ MessagePriority["HIGH"] = "high";
19
+ MessagePriority["URGENT"] = "urgent";
20
+ })(MessagePriority || (exports.MessagePriority = MessagePriority = {}));
21
+ /**
22
+ * Message status
23
+ */
24
+ var MessageStatus;
25
+ (function (MessageStatus) {
26
+ MessageStatus["PENDING"] = "pending";
27
+ MessageStatus["ROUTING"] = "routing";
28
+ MessageStatus["SENDING"] = "sending";
29
+ MessageStatus["SENT"] = "sent";
30
+ MessageStatus["FAILED"] = "failed";
31
+ MessageStatus["RETRYING"] = "retrying";
32
+ })(MessageStatus || (exports.MessageStatus = MessageStatus = {}));
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Provider type identifiers
3
+ */
4
+ export type ProviderType = 'chatkit' | 'slack' | 'discord' | 'teams';
5
+ /**
6
+ * Provider health status
7
+ */
8
+ export type ProviderHealthStatus = 'healthy' | 'degraded' | 'unhealthy' | 'unknown';
9
+ /**
10
+ * Provider configuration
11
+ */
12
+ export interface ProviderConfig {
13
+ enabled: boolean;
14
+ priority: number;
15
+ config: Record<string, unknown>;
16
+ }
17
+ /**
18
+ * Provider health information
19
+ */
20
+ export interface ProviderHealth {
21
+ status: ProviderHealthStatus;
22
+ lastCheck: Date;
23
+ latency?: number;
24
+ errorCount: number;
25
+ uptime?: number;
26
+ details?: Record<string, unknown>;
27
+ }
28
+ /**
29
+ * Provider interface that all providers must implement
30
+ */
31
+ export interface Provider {
32
+ readonly type: ProviderType;
33
+ readonly name: string;
34
+ /**
35
+ * Initialize the provider
36
+ */
37
+ initialize(): Promise<void>;
38
+ /**
39
+ * Check if the provider is initialized
40
+ */
41
+ isInitialized(): boolean;
42
+ /**
43
+ * Send a message through this provider
44
+ */
45
+ sendMessage(message: ProviderMessage): Promise<ProviderMessageResult>;
46
+ /**
47
+ * Get health status of this provider
48
+ */
49
+ getHealth(): Promise<ProviderHealth>;
50
+ /**
51
+ * Shutdown the provider
52
+ */
53
+ shutdown(): Promise<void>;
54
+ }
55
+ /**
56
+ * Message to be sent through a provider
57
+ */
58
+ export interface ProviderMessage {
59
+ content: string;
60
+ userId?: string;
61
+ channelId?: string;
62
+ threadId?: string;
63
+ attachments?: ProviderAttachment[];
64
+ metadata?: Record<string, unknown>;
65
+ }
66
+ /**
67
+ * File attachment
68
+ */
69
+ export interface ProviderAttachment {
70
+ filename: string;
71
+ contentType: string;
72
+ data: Buffer | string;
73
+ size: number;
74
+ }
75
+ /**
76
+ * Result from sending a message
77
+ */
78
+ export interface ProviderMessageResult {
79
+ success: boolean;
80
+ messageId?: string;
81
+ timestamp?: Date;
82
+ error?: string;
83
+ provider: ProviderType;
84
+ }
85
+ /**
86
+ * Provider capabilities
87
+ */
88
+ export interface ProviderCapabilities {
89
+ streaming: boolean;
90
+ attachments: boolean;
91
+ threads: boolean;
92
+ reactions: boolean;
93
+ editing: boolean;
94
+ deletion: boolean;
95
+ }
96
+ //# sourceMappingURL=provider-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-types.d.ts","sourceRoot":"","sources":["../../src/types/provider-types.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAA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AM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,OAAO,CAAC;IACnB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,101 @@
1
+ import type { ProviderType, ProviderConfig } from './provider-types';
2
+ import type { MessageBridgeConfig } from './message-types';
3
+ /**
4
+ * AI routing configuration
5
+ */
6
+ export interface AIRoutingConfig {
7
+ enabled: boolean;
8
+ serviceName?: string;
9
+ fallbackToHuman?: boolean;
10
+ intentThreshold?: number;
11
+ }
12
+ /**
13
+ * Analytics configuration
14
+ */
15
+ export interface AnalyticsConfig {
16
+ enabled: boolean;
17
+ serviceName?: string;
18
+ metricsInterval?: number;
19
+ }
20
+ /**
21
+ * NeverHub capability definition
22
+ */
23
+ export interface NeverHubCapability {
24
+ type: string;
25
+ name: string;
26
+ version: string;
27
+ }
28
+ /**
29
+ * NeverHub configuration
30
+ */
31
+ export interface NeverHubConfig {
32
+ enabled: boolean;
33
+ serviceName: string;
34
+ capabilities: NeverHubCapability[];
35
+ dependencies: string[];
36
+ }
37
+ /**
38
+ * Provider configurations map
39
+ */
40
+ export interface ProviderConfigs {
41
+ chatkit?: ProviderConfig;
42
+ slack?: ProviderConfig;
43
+ discord?: ProviderConfig;
44
+ teams?: ProviderConfig;
45
+ }
46
+ /**
47
+ * Complete chat suite configuration
48
+ */
49
+ export interface ChatSuiteConfig {
50
+ enabled: boolean;
51
+ providers: ProviderConfigs;
52
+ aiRouting?: AIRoutingConfig;
53
+ analytics?: AnalyticsConfig;
54
+ neverhub?: NeverHubConfig;
55
+ messageBridge?: MessageBridgeConfig;
56
+ }
57
+ /**
58
+ * Chat suite health status
59
+ */
60
+ export interface ChatSuiteHealth {
61
+ status: 'healthy' | 'degraded' | 'unhealthy';
62
+ providers: Record<ProviderType, {
63
+ status: string;
64
+ latency?: number;
65
+ errorCount: number;
66
+ }>;
67
+ aiRouting?: {
68
+ enabled: boolean;
69
+ status: string;
70
+ };
71
+ analytics?: {
72
+ enabled: boolean;
73
+ status: string;
74
+ };
75
+ neverhub?: {
76
+ enabled: boolean;
77
+ connected: boolean;
78
+ };
79
+ timestamp: Date;
80
+ }
81
+ /**
82
+ * Suite initialization result
83
+ */
84
+ export interface SuiteInitResult {
85
+ success: boolean;
86
+ providersInitialized: ProviderType[];
87
+ providersFailed: ProviderType[];
88
+ aiRoutingEnabled: boolean;
89
+ analyticsEnabled: boolean;
90
+ neverhubConnected: boolean;
91
+ error?: string;
92
+ }
93
+ /**
94
+ * Suite operation result
95
+ */
96
+ export interface SuiteResult<T = unknown> {
97
+ success: boolean;
98
+ data?: T;
99
+ error?: string;
100
+ }
101
+ //# sourceMappingURL=suite-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"suite-types.d.ts","sourceRoot":"","sources":["../../src/types/suite-types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACrE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAE3D;;GA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C;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC,CAAC;IACH,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,SAAS,CAAC,EAAE;QACV,OAAO,EAAE,OAAO,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,OAAO,EAAE,OAAO,CAAC;QACjB,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,SAAS,EAAE,IAAI,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,oBAAoB,EAAE,YAAY,EAAE,CAAC;IACrC,eAAe,EAAE,YAAY,EAAE,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,CAAC,EAAE,CAAC,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ Copyright (c) 2025 Bernier LLC
4
+
5
+ This file is licensed to the client under a limited-use license.
6
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
7
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import type { ChatSuiteConfig } from '../types';
2
+ /**
3
+ * Default chat suite configuration
4
+ */
5
+ export declare const DEFAULT_SUITE_CONFIG: ChatSuiteConfig;
6
+ /**
7
+ * Merge configurations with inheritance
8
+ */
9
+ export declare function mergeConfigs(baseConfig: ChatSuiteConfig, overrideConfig: Partial<ChatSuiteConfig>): ChatSuiteConfig;
10
+ /**
11
+ * Validate configuration
12
+ */
13
+ export declare function validateConfig(config: ChatSuiteConfig): {
14
+ valid: boolean;
15
+ errors: string[];
16
+ };
17
+ /**
18
+ * Get active providers from configuration
19
+ */
20
+ export declare function getActiveProviders(config: ChatSuiteConfig): Array<{
21
+ name: string;
22
+ priority: number;
23
+ }>;
24
+ //# sourceMappingURL=config-inheritance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-inheritance.d.ts","sourceRoot":"","sources":["../../src/utils/config-inheritance.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAmC,MAAM,UAAU,CAAC;AAWjF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAiClC,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EAAE,eAAe,EAC3B,cAAc,EAAE,OAAO,CAAC,eAAe,CAAC,GACvC,eAAe,CAkBjB;AA+CD;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,eAAe,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE,CAuC5F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,eAAe,GAAG,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAarG"}