botbuilder-dialogs
Version:
A dialog stack based conversation manager for Microsoft BotBuilder.
29 lines • 1.74 kB
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
Object.defineProperty(exports, "__esModule", { value: true });
exports.DialogsBotComponent = void 0;
const z = require("zod");
const botbuilder_core_1 = require("botbuilder-core");
const scopes_1 = require("./memory/scopes");
const pathResolvers_1 = require("./memory/pathResolvers");
const InitialSettings = z.record(z.unknown());
/**
* Bot component for bot Dialogs.
*/
class DialogsBotComponent extends botbuilder_core_1.BotComponent {
/**
* @param services Services Collection to register.
* @param configuration Configuration for the bot component.
*/
configureServices(services, configuration) {
services.composeFactory('memoryScopes', (memoryScopes) => {
const rootConfiguration = configuration.get();
const initialSettings = InitialSettings.check(rootConfiguration) ? rootConfiguration : undefined;
return memoryScopes.concat(new scopes_1.TurnMemoryScope(), new scopes_1.SettingsMemoryScope(initialSettings), new scopes_1.DialogMemoryScope(), new scopes_1.DialogContextMemoryScope(), new scopes_1.DialogClassMemoryScope(), new scopes_1.ClassMemoryScope(), new scopes_1.ThisMemoryScope(), new scopes_1.ConversationMemoryScope(), new scopes_1.UserMemoryScope());
});
services.composeFactory('pathResolvers', (pathResolvers) => pathResolvers.concat(new pathResolvers_1.DollarPathResolver(), new pathResolvers_1.HashPathResolver(), new pathResolvers_1.AtAtPathResolver(), new pathResolvers_1.AtPathResolver(), new pathResolvers_1.PercentPathResolver()));
}
}
exports.DialogsBotComponent = DialogsBotComponent;
//# sourceMappingURL=dialogsBotComponent.js.map
;