@wabot-dev/framework 0.6.0 → 0.7.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.
- package/dist/src/addon/chat-bot/pg/PgChatRepository.js +9 -1
- package/dist/src/addon/chat-bot/ram/RamChatRepository.js +13 -0
- package/dist/src/feature/chat-bot/Chat.js +23 -3
- package/dist/src/feature/chat-bot/ChatOperator.js +54 -0
- package/dist/src/feature/chat-bot/ChatRepository.js +3 -0
- package/dist/src/index.d.ts +26 -2
- package/dist/src/index.js +1 -0
- package/package.json +2 -2
|
@@ -10,6 +10,7 @@ import '../../../feature/pg/withPgClient.js';
|
|
|
10
10
|
import '../../../feature/pg/pgStorage.js';
|
|
11
11
|
import { Chat } from '../../../feature/chat-bot/Chat.js';
|
|
12
12
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
13
|
+
import { ChatOperator } from '../../../feature/chat-bot/ChatOperator.js';
|
|
13
14
|
import 'uuid';
|
|
14
15
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
15
16
|
import '../../../core/error/setupErrorHandlers.js';
|
|
@@ -25,7 +26,7 @@ let PgChatRepository = class PgChatRepository extends PgCrudRepository {
|
|
|
25
26
|
async findByConnection(query) {
|
|
26
27
|
const sql = `
|
|
27
28
|
SELECT ${this.columns}
|
|
28
|
-
FROM ${this.table}
|
|
29
|
+
FROM ${this.table}
|
|
29
30
|
WHERE data->'connections' @> $1::jsonb
|
|
30
31
|
LIMIT 1
|
|
31
32
|
`;
|
|
@@ -35,6 +36,13 @@ let PgChatRepository = class PgChatRepository extends PgCrudRepository {
|
|
|
35
36
|
async findMemory(chatId) {
|
|
36
37
|
return new PgChatMemory(this.pool, chatId);
|
|
37
38
|
}
|
|
39
|
+
async findOperator(chatId) {
|
|
40
|
+
const chat = await this.find(chatId);
|
|
41
|
+
if (!chat)
|
|
42
|
+
return null;
|
|
43
|
+
const memory = new PgChatMemory(this.pool, chatId);
|
|
44
|
+
return new ChatOperator(chat, memory, this);
|
|
45
|
+
}
|
|
38
46
|
};
|
|
39
47
|
PgChatRepository = __decorate([
|
|
40
48
|
singleton(),
|
|
@@ -2,6 +2,10 @@ import { __decorate } from 'tslib';
|
|
|
2
2
|
import { v4 } from 'uuid';
|
|
3
3
|
import { RamChatMemory } from './RamChatMemory.js';
|
|
4
4
|
import { singleton } from '../../../core/injection/index.js';
|
|
5
|
+
import '../../../feature/chat-bot/ChatBot.js';
|
|
6
|
+
import { ChatOperator } from '../../../feature/chat-bot/ChatOperator.js';
|
|
7
|
+
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
8
|
+
import '../../../core/error/setupErrorHandlers.js';
|
|
5
9
|
|
|
6
10
|
let RamChatRepository = class RamChatRepository {
|
|
7
11
|
items = [];
|
|
@@ -36,6 +40,15 @@ let RamChatRepository = class RamChatRepository {
|
|
|
36
40
|
}
|
|
37
41
|
return Promise.resolve(memory.memory);
|
|
38
42
|
}
|
|
43
|
+
async findOperator(chatId) {
|
|
44
|
+
const chat = this.items.find((item) => item.id === chatId) ?? null;
|
|
45
|
+
if (!chat)
|
|
46
|
+
return null;
|
|
47
|
+
const memory = this.getMemory(chatId);
|
|
48
|
+
if (!memory)
|
|
49
|
+
return null;
|
|
50
|
+
return new ChatOperator(chat, memory.memory, this);
|
|
51
|
+
}
|
|
39
52
|
getMemory(chatId) {
|
|
40
53
|
return this.memories.find((r) => r.chatId === chatId) ?? null;
|
|
41
54
|
}
|
|
@@ -33,20 +33,40 @@ class Chat extends Entity {
|
|
|
33
33
|
}
|
|
34
34
|
this.data.connections.push(connection);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
removeConnection(connection) {
|
|
37
|
+
const index = this.data.connections.findIndex((c) => c.channelName === connection.channelName && c.id === connection.id);
|
|
38
|
+
if (index === -1) {
|
|
39
|
+
throw new Error('Connection does not exist');
|
|
40
|
+
}
|
|
41
|
+
this.data.connections.splice(index, 1);
|
|
42
|
+
}
|
|
43
|
+
hasAssociation(association) {
|
|
44
|
+
return this.data.associations?.some((a) => a.type === association.type && a.id === association.id) ?? false;
|
|
45
|
+
}
|
|
46
|
+
hasAssociations(type) {
|
|
47
|
+
return this.data.associations?.some((a) => a.type === type) ?? false;
|
|
38
48
|
}
|
|
39
49
|
getAssociationsByType(type) {
|
|
40
50
|
return this.data.associations?.filter((a) => a.type === type) ?? [];
|
|
41
51
|
}
|
|
42
52
|
addAssociation(association) {
|
|
43
|
-
if (this.hasAssociation(association
|
|
53
|
+
if (this.hasAssociation(association)) {
|
|
44
54
|
throw new Error('Association already exists');
|
|
45
55
|
}
|
|
46
56
|
if (!this.data.associations)
|
|
47
57
|
this.data.associations = [];
|
|
48
58
|
this.data.associations.push(association);
|
|
49
59
|
}
|
|
60
|
+
removeAssociation(association) {
|
|
61
|
+
if (!this.data.associations) {
|
|
62
|
+
throw new Error('Association does not exist');
|
|
63
|
+
}
|
|
64
|
+
const index = this.data.associations.findIndex((a) => a.type === association.type && a.id === association.id);
|
|
65
|
+
if (index === -1) {
|
|
66
|
+
throw new Error('Association does not exist');
|
|
67
|
+
}
|
|
68
|
+
this.data.associations.splice(index, 1);
|
|
69
|
+
}
|
|
50
70
|
validatePrivateChat() {
|
|
51
71
|
if (this.data.connections.length < 1) {
|
|
52
72
|
throw new Error('PRIVATE chat should have one or more connections');
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ChatItem } from './ChatItem.js';
|
|
2
|
+
|
|
3
|
+
class ChatOperator {
|
|
4
|
+
chat;
|
|
5
|
+
memory;
|
|
6
|
+
repository;
|
|
7
|
+
constructor(chat, memory, repository) {
|
|
8
|
+
this.chat = chat;
|
|
9
|
+
this.memory = memory;
|
|
10
|
+
this.repository = repository;
|
|
11
|
+
}
|
|
12
|
+
async saveHumanMessage(message) {
|
|
13
|
+
const item = new ChatItem({ type: 'humanMessage', humanMessage: message });
|
|
14
|
+
await this.memory.create(item);
|
|
15
|
+
return item;
|
|
16
|
+
}
|
|
17
|
+
async saveBotMessage(message) {
|
|
18
|
+
const item = new ChatItem({ type: 'botMessage', botMessage: message });
|
|
19
|
+
await this.memory.create(item);
|
|
20
|
+
return item;
|
|
21
|
+
}
|
|
22
|
+
getConnections() {
|
|
23
|
+
return this.chat.connections;
|
|
24
|
+
}
|
|
25
|
+
async addConnection(connection) {
|
|
26
|
+
this.chat.addConnection(connection);
|
|
27
|
+
await this.repository.update(this.chat);
|
|
28
|
+
}
|
|
29
|
+
async removeConnection(connection) {
|
|
30
|
+
this.chat.removeConnection(connection);
|
|
31
|
+
await this.repository.update(this.chat);
|
|
32
|
+
}
|
|
33
|
+
hasAssociations(type) {
|
|
34
|
+
return this.chat.hasAssociations(type);
|
|
35
|
+
}
|
|
36
|
+
hasAssociation(association) {
|
|
37
|
+
return this.chat.hasAssociation(association);
|
|
38
|
+
}
|
|
39
|
+
findAssociations(type) {
|
|
40
|
+
if (type === undefined)
|
|
41
|
+
return this.chat.associations;
|
|
42
|
+
return this.chat.getAssociationsByType(type);
|
|
43
|
+
}
|
|
44
|
+
async addAssociation(association) {
|
|
45
|
+
this.chat.addAssociation(association);
|
|
46
|
+
await this.repository.update(this.chat);
|
|
47
|
+
}
|
|
48
|
+
async removeAssociation(association) {
|
|
49
|
+
this.chat.removeAssociation(association);
|
|
50
|
+
await this.repository.update(this.chat);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { ChatOperator };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -678,12 +678,15 @@ declare class Chat extends Entity<IChatData> {
|
|
|
678
678
|
id: string;
|
|
679
679
|
} | null;
|
|
680
680
|
addConnection(connection: IChatConnection): void;
|
|
681
|
-
|
|
681
|
+
removeConnection(connection: IChatConnection): void;
|
|
682
|
+
hasAssociation(association: IChatAssociation): boolean;
|
|
683
|
+
hasAssociations(type: string): boolean;
|
|
682
684
|
getAssociationsByType(type: string): {
|
|
683
685
|
type: string;
|
|
684
686
|
id: string;
|
|
685
687
|
}[];
|
|
686
688
|
addAssociation(association: IChatAssociation): void;
|
|
689
|
+
removeAssociation(association: IChatAssociation): void;
|
|
687
690
|
private validatePrivateChat;
|
|
688
691
|
private validateGroupChat;
|
|
689
692
|
validate(): void;
|
|
@@ -944,6 +947,24 @@ interface IChatRepository {
|
|
|
944
947
|
update(chat: Chat): Promise<void>;
|
|
945
948
|
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
946
949
|
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
950
|
+
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
declare class ChatOperator {
|
|
954
|
+
private chat;
|
|
955
|
+
private memory;
|
|
956
|
+
private repository;
|
|
957
|
+
constructor(chat: Chat, memory: IChatMemory, repository: IChatRepository);
|
|
958
|
+
saveHumanMessage(message: IChatMessage): Promise<ChatItem>;
|
|
959
|
+
saveBotMessage(message: IChatMessage): Promise<ChatItem>;
|
|
960
|
+
getConnections(): IChatConnection[];
|
|
961
|
+
addConnection(connection: IChatConnection): Promise<void>;
|
|
962
|
+
removeConnection(connection: IChatConnection): Promise<void>;
|
|
963
|
+
hasAssociations(type: string): boolean;
|
|
964
|
+
hasAssociation(association: IChatAssociation): boolean;
|
|
965
|
+
findAssociations(type?: string): IChatAssociation[];
|
|
966
|
+
addAssociation(association: IChatAssociation): Promise<void>;
|
|
967
|
+
removeAssociation(association: IChatAssociation): Promise<void>;
|
|
947
968
|
}
|
|
948
969
|
|
|
949
970
|
declare class ChatRepository implements IChatRepository {
|
|
@@ -951,6 +972,7 @@ declare class ChatRepository implements IChatRepository {
|
|
|
951
972
|
update(chat: Chat): Promise<void>;
|
|
952
973
|
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
953
974
|
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
975
|
+
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
954
976
|
}
|
|
955
977
|
|
|
956
978
|
declare function chatBot(mindset: IConstructor<IMindset>): (target: object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
@@ -1593,6 +1615,7 @@ declare class PgChatRepository extends PgCrudRepository<Chat> implements IChatRe
|
|
|
1593
1615
|
constructor(pool: Pool);
|
|
1594
1616
|
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
1595
1617
|
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
1618
|
+
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
1596
1619
|
}
|
|
1597
1620
|
|
|
1598
1621
|
declare class PgChatMemory extends PgCrudRepository<ChatItem> implements IChatMemory {
|
|
@@ -1615,6 +1638,7 @@ declare class RamChatRepository implements IChatRepository {
|
|
|
1615
1638
|
create(chat: Chat): Promise<void>;
|
|
1616
1639
|
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
1617
1640
|
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
1641
|
+
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
1618
1642
|
private getMemory;
|
|
1619
1643
|
}
|
|
1620
1644
|
|
|
@@ -2193,4 +2217,4 @@ declare function HtmlModule(options: IHtmlModuleOptions): {
|
|
|
2193
2217
|
new (): {};
|
|
2194
2218
|
};
|
|
2195
2219
|
|
|
2196
|
-
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatRepository, ChatResolver, type ClientMap, CmdChannel, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatMessageDocument, type IChatMessageFile, type IChatMessageImage, type IChatMessagesPrivateFile, type IChatMessagesPublicFile, type IChatRepository, type IChatType, type ICmdChannelMessage, type ICmdReceivedMessage, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronJobData, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IExtractChatMessageTextOptions, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendByWasenderRequest, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelMessage, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type ISocketReceivedMessage, type IStorableData, type ITelegramChannelConfig, type ITelegramChannelMessage, type ITelegramReceivedMessage, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppByWasenderChannelConfig, type IWhatsAppByWasenderReceivedMessage, type IWhatsAppChannelMessage, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppReceivedMessage, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenRouterChatAdapter, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WasenderWebhookController, WhatsApp, WhatsAppByWasenderChannel, WhatsAppByWasenderChannelConfig, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppReceiverByWasender, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppSenderByWasender, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, cmdChannelName, command, commandHandler, container, cron, description, errorToPlainObject, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isChatMessageEmpty, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, pgStorage, readJsonFromFile, restController, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, telegram, telegramChannelName, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, whatsAppByWasenderChannelName, whatsAppChannelName, withPgClient, withPgTransaction, writeJsonToFile };
|
|
2220
|
+
export { AnthropicChatAdapter, ApiKey, ApiKeyGuardMiddleware, ApiKeyHandshakeGuardMiddleware, ApiKeyRepository, Async, AsyncMetadataStore, Auth, Chat, ChatAdapter, ChatBot, ChatBotMetadataStore, ChatItem, ChatMemory, ChatOperator, ChatRepository, ChatResolver, type ClientMap, CmdChannel, Container, ControllerMetadataStore, CronJob, CronJobRepository, CustomError, DeepSeekChatAdapter, DescriptionMetadataStore, EXPRESS_REQ, EXPRESS_RES, Entity, Env, EnvWhatsAppRepository, type ErrorSeverity, ExpressProvider, GoogleChatAdapter, type GoogleChatAdapterV2Options, HtmlModule, HttpServerProvider, type IApiKeyData, type IApiKeyRepository, type IArrayValidationError, type IArrayValidationResult, type IBotMessageItem, type IChannelMessage, type IChannelMetadata, type IChatAdapter, type IChatAdapterNextItemsReq, type IChatAdapterNextItemsRes, type IChatAssociation, type IChatBot, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatControllerMetadata, type IChatData, type IChatItem, type IChatItemData, type IChatItemType, type IChatMemory, type IChatMessage, type IChatMessageDocument, type IChatMessageFile, type IChatMessageImage, type IChatMessagesPrivateFile, type IChatMessagesPublicFile, type IChatRepository, type IChatType, type ICmdChannelMessage, type ICmdReceivedMessage, type ICommandConfig, type ICommandHandler, type ICommandHandlerConfig, type IConstructor, type ICronConfig, type ICronJobData, type ICrudRepository, type ICustomErrorData, type IDescriptionMetadata, type IEndPointConfig, type IEndPointMetadata, type IEntityData, type IEnvType, type IErrorHandlersConfig, type IErrorMonitor, type IErrorMonitorContext, type IExtractChatMessageTextOptions, type IFunctionCall, type IFunctionCallItem, type IGenerateApiKeyReq, type IGenerateApiKeyRes, type IGetWhatsAppTemplateRequest, type IHandshakeMiddleware, type IHandshakeMiddlewareMetadata, type IHtmlModuleOptions, type IHumanMessageItem, type IJobData, type IJobRepository, type IJwtRefreshTokenData, type IJwtRefreshTokenRepository, type ILanguageModelUsage, type IListenWhatsAppMessageRequest, type ILockKey, type ILocker, type ILockerKey, type IMessageContext, type IMiddleware, type IMiddlewareMetadata, type IMindset, type IMindsetConfig, type IMindsetIdentity, type IMindsetLlm, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleMetadata, type IMindsetTool, type IMindsetToolParameter, type IModelValidationError, type IModelValidationResult, type IModelValidatorsInfo, type IMoneyData, type IPersistentData, type IPgRepositoryConfig, type IPropertyValidatorInfo, type IReceivedMessage, type IRemoteApiKeyFetcher, type IRestControllerConfig, type IRestControllerMetadata, type IScheduleAt, type IScheduleDelay, type ISendByWasenderRequest, type ISendWhatsAppRequest, type ISendWhatsAppTemplateRequest, type ISocketChannelConfig, type ISocketChannelMessage, type ISocketChannelReceivedMessage, type ISocketControllerConfig, type ISocketControllerMetadata, type ISocketEventConfig, type ISocketEventMetadata, type ISocketReceivedMessage, type IStorableData, type ITelegramChannelConfig, type ITelegramChannelMessage, type ITelegramReceivedMessage, type IValidateArrayOptions, type IValidateArrayOptionsWithItemsValidators, type IValidateInputShape, type IValidateIsInOptions, type IValidateIsRecordOptions, type IValidateMaxOptions, type IValidateMinOptions, type IValidationError, type IValidationResult, type IValidator, type IValidatorMetadata, type IWasenderChannelMessageListener, type IWasenderDeviceListMetadata, type IWasenderEvent, type IWasenderMessageContent, type IWasenderMessageContextInfo, type IWasenderMessageKey, type IWasenderMessageReceivedData, type IWasenderMessageReceivedEvent, type IWasenderQrUpdatedEvent, type IWhatsAppBusinessAccount, type IWhatsAppBusinessNumber, type IWhatsAppByWasenderChannelConfig, type IWhatsAppByWasenderReceivedMessage, type IWhatsAppChannelMessage, type IWhatsAppCloudContact, type IWhatsAppCloudMessage, type IWhatsAppCloudMessageMetadata, type IWhatsAppCloudTemplate, type IWhatsAppCloudTemplateComponent, type IWhatsAppCloudTemplateMessage, type IWhatsAppCloudTemplateParameter, type IWhatsAppCloudTemplateResponse, type IWhatsAppCloudWebhookPayload, type IWhatsAppData, type IWhatsAppMessageListener, type IWhatsAppProxyListenMessageEventData, type IWhatsAppProxyListenMessageEventReq, type IWhatsAppProxyMessage, type IWhatsAppProxyMessageContent, type IWhatsAppProxyMessageEventReq, type IWhatsAppProxySendMessageEventReq, type IWhatsAppReceivedMessage, type IWhatsAppRepository, type IWhatsAppSenderOptions, type IWhatsappChannelConfig, type IchatControllerConfig, Job, JobRepository, JobRunner, Jwt, JwtAccessAndRefreshTokenDto, JwtConfig, JwtGuardMiddleware, JwtHandshakeGuardMiddleware, JwtRefreshToken, JwtRefreshTokenRepository, JwtSigner, JwtTokenDto, Lifecycle, Locker, Logger, Mapper, Mindset, MindsetMetadataStore, MindsetOperator, Money, MoneyDto, OpenRouterChatAdapter, OpenaiChatAdapter, Password, type PasswordHashOptions, Persistent, PgApiKeyRepository, PgChatMemory, PgChatRepository, PgCronJobRepository, PgCrudRepository, PgJobRepository, PgJwtRefreshTokenRepository, PgLockKey, PgLocker, PgRepositoryBase, PgWhatsAppRepository, RamChatMemory, RamChatRepository, Random, RemoteApiKeyRepository, RestControllerMetadataStore, RestRequest, SocketChannel, SocketChannelConfig, SocketChannelReceivedMessage, SocketControllerMetadataStore, SocketServerConfig, SocketServerProvider, Storable, TelegramChannel, TelegramChannelConfig, ValidationMetadataStore, WHATSAPP_MESSAGE_EVENT, WHATSAPP_PROXY_LISTEN_MESSAGE_EVENT, WHATSAPP_PROXY_SEND_MESSAGE_EVENT, WabotChatAdapter, WasenderWebhookController, WhatsApp, WhatsAppByWasenderChannel, WhatsAppByWasenderChannelConfig, WhatsAppChannel, WhatsAppReceiver, WhatsAppReceiverByCloudApi, WhatsAppReceiverByWabotProxy, WhatsAppReceiverByWasender, WhatsAppRepository, WhatsAppSender, WhatsAppSenderByCloudApi, WhatsAppSenderByWabotProxy, WhatsAppSenderByWasender, WhatsAppWabotProxyConnection, WhatsappChannelConfig, apiKeyGuard, apiKeyHandshakeGuard, chatBot, chatController, chatItemTypeOptions, cmd, cmdChannelName, command, commandHandler, container, cron, description, errorToPlainObject, extractChatMessageText, extractNumberFromWasenderMessageKey, getClientMap, getPgClient, handshakeMiddlewares, inject, injectable, isArray, isBoolean, isChatMessageEmpty, isDate, isIn, isModel, isNotEmpty, isNumber, isOptional, isPresent, isRecord, isString, jwtGuard, jwtHandshakeGuard, max, middleware, min, mindset, mindsetModule, modelInfo, onDelete, onGet, onPost, onPut, onSocketEvent, pgStorage, readJsonFromFile, restController, runChatControllers, runCommandHandlers, runCronHandlers, runRestControllers, runSocketControllers, safeJsonParse, scoped, setupErrorHandlers, singleton, socket, socketChannelName, socketController, stopCommandHandlers, stopCronHandlers, telegram, telegramChannelName, validateAndTransform, validateArray, validateIsBoolean, validateIsDate, validateIsIn, validateIsNotEmpty, validateIsNumber, validateIsPresent, validateIsRecord, validateIsString, validateMax, validateMin, validateModel, whatsApp, whatsAppByWasender, whatsAppByWasenderChannelName, whatsAppChannelName, withPgClient, withPgTransaction, writeJsonToFile };
|
package/dist/src/index.js
CHANGED
|
@@ -57,6 +57,7 @@ export { ChatAdapter } from './feature/chat-bot/ChatAdapter.js';
|
|
|
57
57
|
export { ChatBot } from './feature/chat-bot/ChatBot.js';
|
|
58
58
|
export { ChatItem } from './feature/chat-bot/ChatItem.js';
|
|
59
59
|
export { ChatMemory } from './feature/chat-bot/ChatMemory.js';
|
|
60
|
+
export { ChatOperator } from './feature/chat-bot/ChatOperator.js';
|
|
60
61
|
export { ChatRepository } from './feature/chat-bot/ChatRepository.js';
|
|
61
62
|
export { chatItemTypeOptions } from './feature/chat-bot/IChatItem.js';
|
|
62
63
|
export { chatBot } from './feature/chat-bot/metadata/@chatBot.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wabot-dev/framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Framework for IA Chat Bots",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"prettier": "^3.5.3",
|
|
36
36
|
"rollup": "^4.60.0",
|
|
37
37
|
"tsup": "^8.4.0",
|
|
38
|
-
"typescript": "
|
|
38
|
+
"typescript": "^6.0.3"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"@anthropic-ai/sdk": "^0.60.0",
|