@wabot-dev/framework 0.0.4 → 0.0.6
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/channels/cmd/@cmd.js +17 -0
- package/dist/src/index.d.ts +4 -2
- package/dist/src/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import '../../controller/channel/ChatResolver.js';
|
|
2
|
+
import { container } from '../../injection/index.js';
|
|
3
|
+
import { ControllerMetadataStore } from '../../controller/metadata/ControllerMetadataStore.js';
|
|
4
|
+
import { CmdChannel } from './CmdChannel.js';
|
|
5
|
+
|
|
6
|
+
function cmd() {
|
|
7
|
+
return function (target, propertyKey) {
|
|
8
|
+
const store = container.resolve(ControllerMetadataStore);
|
|
9
|
+
store.saveChannelMetadata({
|
|
10
|
+
channelConstructor: CmdChannel,
|
|
11
|
+
functionName: propertyKey.toString(),
|
|
12
|
+
controllerConstructor: target.constructor,
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { cmd };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -329,6 +329,8 @@ declare class OpenaiChatBotAdapter extends ChatBotAdapter {
|
|
|
329
329
|
private mapChatItems;
|
|
330
330
|
}
|
|
331
331
|
|
|
332
|
+
declare function cmd(): (target: object, propertyKey: string | symbol) => void;
|
|
333
|
+
|
|
332
334
|
interface IChatContext {
|
|
333
335
|
chatId: string;
|
|
334
336
|
message: IChatMessage;
|
|
@@ -382,7 +384,7 @@ interface IChannelMetadata {
|
|
|
382
384
|
controllerConstructor: IConstructor<any>;
|
|
383
385
|
functionName: string;
|
|
384
386
|
channelConstructor: IConstructor<IChatChannel>;
|
|
385
|
-
channelConfig
|
|
387
|
+
channelConfig?: object;
|
|
386
388
|
}
|
|
387
389
|
|
|
388
390
|
declare class ControllerMetadataStore {
|
|
@@ -442,4 +444,4 @@ interface IServerConfig {
|
|
|
442
444
|
}
|
|
443
445
|
declare function runServer(config: IServerConfig): void;
|
|
444
446
|
|
|
445
|
-
export { Chat, ChatBot, ChatBotAdapter, ChatBotMetadataStore, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Container, Context, ControllerMetadataStore, type IChannelMetadata, type IChatBot, type IChatBotAdapter, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatContext, type IChatControllerMetadata, type IChatData, type IChatDocument, type IChatFunctionCall, type IChatImage, type IChatItem, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatSender, type IChatType, type IConstructor, type IContext, type IMessageContext, type IMessageOrigin, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IParamDecoration, type IServerConfig, type ISystemFunctionCallItem, type ISystemMessageItem, type ITelegramChannelConfig, type IUserContext, type IUserMessageItem, type IchatControllerConfig, type IrunChannelProps, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mindset, MindsetMetadataStore, MindsetOperator, OpenaiChatBotAdapter, RamChatMemory, RamChatRepository, TelegramChannel, TelegramChannelConfig, chatBot, chatController, container, inject, injectable, isOptional, mindset, mindsetFunction, mindsetModule, param, prepareChatContainer, runChannel, runServer, singleton, telegram };
|
|
447
|
+
export { Chat, ChatBot, ChatBotAdapter, ChatBotMetadataStore, ChatMemory, ChatRepository, ChatResolver, CmdChannel, Container, Context, ControllerMetadataStore, type IChannelMetadata, type IChatBot, type IChatBotAdapter, type IChatBotMetadata, type IChatChannel, type IChatConnection, type IChatContext, type IChatControllerMetadata, type IChatData, type IChatDocument, type IChatFunctionCall, type IChatImage, type IChatItem, type IChatItemType, type IChatMemory, type IChatMessage, type IChatRepository, type IChatSender, type IChatType, type IConstructor, type IContext, type IMessageContext, type IMessageOrigin, type IMindset, type IMindsetDecoration, type IMindsetFunctionConfig, type IMindsetFunctionDecoration, type IMindsetFunctionMetadata, type IMindsetFunctionParamMetadata, type IMindsetIdentity, type IMindsetMetadata, type IMindsetModuleConfig, type IMindsetModuleDecoration, type IMindsetModuleMetadata, type IParamDecoration, type IServerConfig, type ISystemFunctionCallItem, type ISystemMessageItem, type ITelegramChannelConfig, type IUserContext, type IUserMessageItem, type IchatControllerConfig, type IrunChannelProps, MINDSET_DECORATION_MINDSET, MINDSET_FUNCTION_DECORATION_FUNCTION, MINDSET_MODULE_DECORATION_MODULE, Mindset, MindsetMetadataStore, MindsetOperator, OpenaiChatBotAdapter, RamChatMemory, RamChatRepository, TelegramChannel, TelegramChannelConfig, chatBot, chatController, cmd, container, inject, injectable, isOptional, mindset, mindsetFunction, mindsetModule, param, prepareChatContainer, runChannel, runServer, singleton, telegram };
|
package/dist/src/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { OpenaiChatBotAdapter } from './ai/openia/OpenaiChatBotAdapter.js';
|
|
2
|
+
export { cmd } from './channels/cmd/@cmd.js';
|
|
2
3
|
export { CmdChannel } from './channels/cmd/CmdChannel.js';
|
|
3
4
|
export { telegram } from './channels/telegram/@telegram.js';
|
|
4
5
|
export { TelegramChannelConfig } from './channels/telegram/TelegramChannelConfig.js';
|