@wabot-dev/framework 0.7.0 → 0.7.1
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/anthropic/AnthropicChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/deepseek/DeepSeekChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/google/GoogleChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/openia/OpenaiChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/openrouter/OpenRouterChatAdapter.js +1 -0
- package/dist/src/addon/chat-bot/pg/PgChatMemory.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/WhatsAppSender.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/cloud-api/WhatsAppSenderByCloudApi.js +1 -0
- package/dist/src/addon/chat-controller/whatsapp/proxy/WhatsAppSenderByWabotProxy.js +1 -0
- package/dist/src/feature/chat-bot/ChatOperator.js +13 -2
- package/dist/src/feature/chat-controller/ChatResolver.js +1 -0
- package/dist/src/feature/chat-controller/runChatControllers.js +1 -0
- package/dist/src/index.d.ts +9 -9
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ import { Env } from '../../../core/env/Env.js';
|
|
|
3
3
|
import { singleton } from '../../../core/injection/index.js';
|
|
4
4
|
import { Logger } from '../../../core/logger/Logger.js';
|
|
5
5
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
6
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
6
7
|
import 'uuid';
|
|
7
8
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
8
9
|
import { safeJsonParse } from '../../../feature/chat-bot/safeJsonParse.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Logger } from '../../../core/logger/Logger.js';
|
|
2
2
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
3
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
3
4
|
import '../../../core/injection/index.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -4,6 +4,7 @@ import { singleton } from '../../../core/injection/index.js';
|
|
|
4
4
|
import { Logger } from '../../../core/logger/Logger.js';
|
|
5
5
|
import { Random } from '../../../core/random/Random.js';
|
|
6
6
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
7
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
7
8
|
import 'uuid';
|
|
8
9
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
9
10
|
import { safeJsonParse } from '../../../feature/chat-bot/safeJsonParse.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { __decorate } from 'tslib';
|
|
2
2
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
3
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
3
4
|
import { singleton } from '../../../core/injection/index.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -3,6 +3,7 @@ import { Env } from '../../../core/env/Env.js';
|
|
|
3
3
|
import { singleton } from '../../../core/injection/index.js';
|
|
4
4
|
import { Logger } from '../../../core/logger/Logger.js';
|
|
5
5
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
6
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
6
7
|
import 'uuid';
|
|
7
8
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
8
9
|
import '../../../core/error/setupErrorHandlers.js';
|
|
@@ -6,6 +6,7 @@ import '../../../feature/pg/withPgClient.js';
|
|
|
6
6
|
import '../../../feature/pg/pgStorage.js';
|
|
7
7
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
8
8
|
import { ChatItem } from '../../../feature/chat-bot/ChatItem.js';
|
|
9
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
9
10
|
import '../../../core/injection/index.js';
|
|
10
11
|
import 'uuid';
|
|
11
12
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import '../../../feature/chat-bot/ChatBot.js';
|
|
2
2
|
import { ChatItem } from '../../../feature/chat-bot/ChatItem.js';
|
|
3
|
+
import '../../../feature/chat-bot/ChatOperator.js';
|
|
3
4
|
import '../../../core/injection/index.js';
|
|
4
5
|
import 'uuid';
|
|
5
6
|
import '../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -6,6 +6,7 @@ import '../../../../feature/chat-controller/metadata/ControllerMetadataStore.js'
|
|
|
6
6
|
import { ChatResolver } from '../../../../feature/chat-controller/ChatResolver.js';
|
|
7
7
|
import '../../../../feature/chat-controller/runChatControllers.js';
|
|
8
8
|
import '../../../../feature/chat-bot/ChatBot.js';
|
|
9
|
+
import '../../../../feature/chat-bot/ChatOperator.js';
|
|
9
10
|
import { ChatRepository } from '../../../../feature/chat-bot/ChatRepository.js';
|
|
10
11
|
import 'uuid';
|
|
11
12
|
import '../../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -3,6 +3,7 @@ import { WhatsAppSender } from '../WhatsAppSender.js';
|
|
|
3
3
|
import { singleton } from '../../../../core/injection/index.js';
|
|
4
4
|
import { Logger } from '../../../../core/logger/Logger.js';
|
|
5
5
|
import '../../../../feature/chat-bot/ChatBot.js';
|
|
6
|
+
import '../../../../feature/chat-bot/ChatOperator.js';
|
|
6
7
|
import { ChatRepository } from '../../../../feature/chat-bot/ChatRepository.js';
|
|
7
8
|
import 'uuid';
|
|
8
9
|
import '../../../../feature/chat-bot/metadata/ChatBotMetadataStore.js';
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import { injectable } from '../../core/injection/index.js';
|
|
3
|
+
import { Chat } from './Chat.js';
|
|
1
4
|
import { ChatItem } from './ChatItem.js';
|
|
5
|
+
import { ChatMemory } from './ChatMemory.js';
|
|
6
|
+
import { ChatRepository } from './ChatRepository.js';
|
|
2
7
|
|
|
3
|
-
class ChatOperator {
|
|
8
|
+
let ChatOperator = class ChatOperator {
|
|
4
9
|
chat;
|
|
5
10
|
memory;
|
|
6
11
|
repository;
|
|
@@ -49,6 +54,12 @@ class ChatOperator {
|
|
|
49
54
|
this.chat.removeAssociation(association);
|
|
50
55
|
await this.repository.update(this.chat);
|
|
51
56
|
}
|
|
52
|
-
}
|
|
57
|
+
};
|
|
58
|
+
ChatOperator = __decorate([
|
|
59
|
+
injectable(),
|
|
60
|
+
__metadata("design:paramtypes", [Chat,
|
|
61
|
+
ChatMemory,
|
|
62
|
+
ChatRepository])
|
|
63
|
+
], ChatOperator);
|
|
53
64
|
|
|
54
65
|
export { ChatOperator };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { __decorate, __metadata } from 'tslib';
|
|
2
2
|
import { Chat } from '../chat-bot/Chat.js';
|
|
3
3
|
import '../chat-bot/ChatBot.js';
|
|
4
|
+
import '../chat-bot/ChatOperator.js';
|
|
4
5
|
import { ChatRepository } from '../chat-bot/ChatRepository.js';
|
|
5
6
|
import { injectable } from '../../core/injection/index.js';
|
|
6
7
|
import 'uuid';
|
|
@@ -4,6 +4,7 @@ import { Logger } from '../../core/logger/Logger.js';
|
|
|
4
4
|
import { Chat } from '../chat-bot/Chat.js';
|
|
5
5
|
import { ChatBot } from '../chat-bot/ChatBot.js';
|
|
6
6
|
import { ChatMemory } from '../chat-bot/ChatMemory.js';
|
|
7
|
+
import '../chat-bot/ChatOperator.js';
|
|
7
8
|
import { ChatRepository } from '../chat-bot/ChatRepository.js';
|
|
8
9
|
import 'uuid';
|
|
9
10
|
import { ChatBotMetadataStore } from '../chat-bot/metadata/ChatBotMetadataStore.js';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -950,11 +950,19 @@ interface IChatRepository {
|
|
|
950
950
|
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
951
951
|
}
|
|
952
952
|
|
|
953
|
+
declare class ChatRepository implements IChatRepository {
|
|
954
|
+
create(chat: Chat): Promise<void>;
|
|
955
|
+
update(chat: Chat): Promise<void>;
|
|
956
|
+
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
957
|
+
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
958
|
+
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
959
|
+
}
|
|
960
|
+
|
|
953
961
|
declare class ChatOperator {
|
|
954
962
|
private chat;
|
|
955
963
|
private memory;
|
|
956
964
|
private repository;
|
|
957
|
-
constructor(chat: Chat, memory:
|
|
965
|
+
constructor(chat: Chat, memory: ChatMemory, repository: ChatRepository);
|
|
958
966
|
saveHumanMessage(message: IChatMessage): Promise<ChatItem>;
|
|
959
967
|
saveBotMessage(message: IChatMessage): Promise<ChatItem>;
|
|
960
968
|
getConnections(): IChatConnection[];
|
|
@@ -967,14 +975,6 @@ declare class ChatOperator {
|
|
|
967
975
|
removeAssociation(association: IChatAssociation): Promise<void>;
|
|
968
976
|
}
|
|
969
977
|
|
|
970
|
-
declare class ChatRepository implements IChatRepository {
|
|
971
|
-
create(chat: Chat): Promise<void>;
|
|
972
|
-
update(chat: Chat): Promise<void>;
|
|
973
|
-
findByConnection(query: IChatConnection): Promise<Chat | null>;
|
|
974
|
-
findMemory(chatId: string): Promise<IChatMemory | null>;
|
|
975
|
-
findOperator(chatId: string): Promise<ChatOperator | null>;
|
|
976
|
-
}
|
|
977
|
-
|
|
978
978
|
declare function chatBot(mindset: IConstructor<IMindset>): (target: object, propertyKey: string | symbol | undefined, parameterIndex: number) => void;
|
|
979
979
|
|
|
980
980
|
interface IChatBotMetadata {
|