@microsoft/agents-hosting-dialogs 0.1.49
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/index.js +20 -0
- package/dist/src/agentComponent.d.ts +18 -0
- package/dist/src/agentComponent.js +55 -0
- package/dist/src/agentComponent.js.map +1 -0
- package/dist/src/agentStateSet.d.ts +48 -0
- package/dist/src/agentStateSet.js +66 -0
- package/dist/src/agentStateSet.js.map +1 -0
- package/dist/src/choices/choice.d.ts +14 -0
- package/dist/src/choices/choice.js +7 -0
- package/dist/src/choices/choice.js.map +1 -0
- package/dist/src/choices/choiceFactory.d.ts +81 -0
- package/dist/src/choices/choiceFactory.js +133 -0
- package/dist/src/choices/choiceFactory.js.map +1 -0
- package/dist/src/choices/findChoices.d.ts +28 -0
- package/dist/src/choices/findChoices.js +46 -0
- package/dist/src/choices/findChoices.js.map +1 -0
- package/dist/src/choices/findValues.d.ts +36 -0
- package/dist/src/choices/findValues.js +129 -0
- package/dist/src/choices/findValues.js.map +1 -0
- package/dist/src/choices/index.d.ts +11 -0
- package/dist/src/choices/index.js +28 -0
- package/dist/src/choices/index.js.map +1 -0
- package/dist/src/choices/modelResult.d.ts +11 -0
- package/dist/src/choices/modelResult.js +3 -0
- package/dist/src/choices/modelResult.js.map +1 -0
- package/dist/src/choices/recognizeChoices.d.ts +16 -0
- package/dist/src/choices/recognizeChoices.js +81 -0
- package/dist/src/choices/recognizeChoices.js.map +1 -0
- package/dist/src/choices/tokenizer.d.ts +25 -0
- package/dist/src/choices/tokenizer.js +73 -0
- package/dist/src/choices/tokenizer.js.map +1 -0
- package/dist/src/componentDialog.d.ts +178 -0
- package/dist/src/componentDialog.js +252 -0
- package/dist/src/componentDialog.js.map +1 -0
- package/dist/src/componentRegistration.d.ts +22 -0
- package/dist/src/componentRegistration.js +32 -0
- package/dist/src/componentRegistration.js.map +1 -0
- package/dist/src/configurable.d.ts +22 -0
- package/dist/src/configurable.js +60 -0
- package/dist/src/configurable.js.map +1 -0
- package/dist/src/configuration.d.ts +11 -0
- package/dist/src/configuration.js +17 -0
- package/dist/src/configuration.js.map +1 -0
- package/dist/src/converter.d.ts +13 -0
- package/dist/src/converter.js +7 -0
- package/dist/src/converter.js.map +1 -0
- package/dist/src/dialog.d.ts +184 -0
- package/dist/src/dialog.js +201 -0
- package/dist/src/dialog.js.map +1 -0
- package/dist/src/dialogContainer.d.ts +61 -0
- package/dist/src/dialogContainer.js +82 -0
- package/dist/src/dialogContainer.js.map +1 -0
- package/dist/src/dialogContext.d.ts +272 -0
- package/dist/src/dialogContext.js +444 -0
- package/dist/src/dialogContext.js.map +1 -0
- package/dist/src/dialogContextError.d.ts +27 -0
- package/dist/src/dialogContextError.js +39 -0
- package/dist/src/dialogContextError.js.map +1 -0
- package/dist/src/dialogEvent.d.ts +20 -0
- package/dist/src/dialogEvent.js +3 -0
- package/dist/src/dialogEvent.js.map +1 -0
- package/dist/src/dialogEvents.d.ts +15 -0
- package/dist/src/dialogEvents.js +20 -0
- package/dist/src/dialogEvents.js.map +1 -0
- package/dist/src/dialogHelper.d.ts +32 -0
- package/dist/src/dialogHelper.js +116 -0
- package/dist/src/dialogHelper.js.map +1 -0
- package/dist/src/dialogInstance.d.ts +30 -0
- package/dist/src/dialogInstance.js +3 -0
- package/dist/src/dialogInstance.js.map +1 -0
- package/dist/src/dialogManager.d.ts +73 -0
- package/dist/src/dialogManager.js +156 -0
- package/dist/src/dialogManager.js.map +1 -0
- package/dist/src/dialogReason.d.ts +35 -0
- package/dist/src/dialogReason.js +40 -0
- package/dist/src/dialogReason.js.map +1 -0
- package/dist/src/dialogSet.d.ts +85 -0
- package/dist/src/dialogSet.js +138 -0
- package/dist/src/dialogSet.js.map +1 -0
- package/dist/src/dialogTurnResult.d.ts +34 -0
- package/dist/src/dialogTurnResult.js +3 -0
- package/dist/src/dialogTurnResult.js.map +1 -0
- package/dist/src/dialogTurnStateConstants.d.ts +12 -0
- package/dist/src/dialogTurnStateConstants.js +17 -0
- package/dist/src/dialogTurnStateConstants.js.map +1 -0
- package/dist/src/dialogTurnStatus.d.ts +34 -0
- package/dist/src/dialogTurnStatus.js +39 -0
- package/dist/src/dialogTurnStatus.js.map +1 -0
- package/dist/src/dialogsAgentComponent.d.ts +17 -0
- package/dist/src/dialogsAgentComponent.js +65 -0
- package/dist/src/dialogsAgentComponent.js.map +1 -0
- package/dist/src/dialogsComponentRegistration.d.ts +28 -0
- package/dist/src/dialogsComponentRegistration.js +45 -0
- package/dist/src/dialogsComponentRegistration.js.map +1 -0
- package/dist/src/i18n.d.ts +15 -0
- package/dist/src/i18n.js +28 -0
- package/dist/src/i18n.js.map +1 -0
- package/dist/src/index.d.ts +29 -0
- package/dist/src/index.js +48 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/intentScore.d.ts +11 -0
- package/dist/src/intentScore.js +3 -0
- package/dist/src/intentScore.js.map +1 -0
- package/dist/src/memory/componentMemoryScopes.d.ts +18 -0
- package/dist/src/memory/componentMemoryScopes.js +54 -0
- package/dist/src/memory/componentMemoryScopes.js.map +1 -0
- package/dist/src/memory/componentPathResolvers.d.ts +18 -0
- package/dist/src/memory/componentPathResolvers.js +52 -0
- package/dist/src/memory/componentPathResolvers.js.map +1 -0
- package/dist/src/memory/dialogPath.d.ts +17 -0
- package/dist/src/memory/dialogPath.js +30 -0
- package/dist/src/memory/dialogPath.js.map +1 -0
- package/dist/src/memory/dialogStateManager.d.ts +156 -0
- package/dist/src/memory/dialogStateManager.js +598 -0
- package/dist/src/memory/dialogStateManager.js.map +1 -0
- package/dist/src/memory/index.d.ts +12 -0
- package/dist/src/memory/index.js +29 -0
- package/dist/src/memory/index.js.map +1 -0
- package/dist/src/memory/pathResolvers/aliasPathResolver.d.ts +25 -0
- package/dist/src/memory/pathResolvers/aliasPathResolver.js +37 -0
- package/dist/src/memory/pathResolvers/aliasPathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/atAtPathResolver.d.ts +11 -0
- package/dist/src/memory/pathResolvers/atAtPathResolver.js +18 -0
- package/dist/src/memory/pathResolvers/atAtPathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/atPathResolver.d.ts +20 -0
- package/dist/src/memory/pathResolvers/atPathResolver.js +46 -0
- package/dist/src/memory/pathResolvers/atPathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/dollarPathResolver.d.ts +11 -0
- package/dist/src/memory/pathResolvers/dollarPathResolver.js +18 -0
- package/dist/src/memory/pathResolvers/dollarPathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/hashPathResolver.d.ts +11 -0
- package/dist/src/memory/pathResolvers/hashPathResolver.js +18 -0
- package/dist/src/memory/pathResolvers/hashPathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/index.d.ts +11 -0
- package/dist/src/memory/pathResolvers/index.js +28 -0
- package/dist/src/memory/pathResolvers/index.js.map +1 -0
- package/dist/src/memory/pathResolvers/pathResolver.d.ts +13 -0
- package/dist/src/memory/pathResolvers/pathResolver.js +7 -0
- package/dist/src/memory/pathResolvers/pathResolver.js.map +1 -0
- package/dist/src/memory/pathResolvers/percentPathResolver.d.ts +11 -0
- package/dist/src/memory/pathResolvers/percentPathResolver.js +18 -0
- package/dist/src/memory/pathResolvers/percentPathResolver.js.map +1 -0
- package/dist/src/memory/scopePath.d.ts +18 -0
- package/dist/src/memory/scopePath.js +23 -0
- package/dist/src/memory/scopePath.js.map +1 -0
- package/dist/src/memory/scopes/agentStateMemoryScope.d.ts +53 -0
- package/dist/src/memory/scopes/agentStateMemoryScope.js +82 -0
- package/dist/src/memory/scopes/agentStateMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/classMemoryScope.d.ts +29 -0
- package/dist/src/memory/scopes/classMemoryScope.js +65 -0
- package/dist/src/memory/scopes/classMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/conversationMemoryScope.d.ts +15 -0
- package/dist/src/memory/scopes/conversationMemoryScope.js +23 -0
- package/dist/src/memory/scopes/conversationMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/dialogClassMemoryScope.d.ts +19 -0
- package/dist/src/memory/scopes/dialogClassMemoryScope.js +42 -0
- package/dist/src/memory/scopes/dialogClassMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/dialogContextMemoryScope.d.ts +19 -0
- package/dist/src/memory/scopes/dialogContextMemoryScope.js +48 -0
- package/dist/src/memory/scopes/dialogContextMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/dialogMemoryScope.d.ts +32 -0
- package/dist/src/memory/scopes/dialogMemoryScope.js +74 -0
- package/dist/src/memory/scopes/dialogMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/index.d.ts +15 -0
- package/dist/src/memory/scopes/index.js +32 -0
- package/dist/src/memory/scopes/index.js.map +1 -0
- package/dist/src/memory/scopes/memoryScope.d.ts +52 -0
- package/dist/src/memory/scopes/memoryScope.js +54 -0
- package/dist/src/memory/scopes/memoryScope.js.map +1 -0
- package/dist/src/memory/scopes/settingsMemoryScope.d.ts +68 -0
- package/dist/src/memory/scopes/settingsMemoryScope.js +216 -0
- package/dist/src/memory/scopes/settingsMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/thisMemoryScope.d.ts +26 -0
- package/dist/src/memory/scopes/thisMemoryScope.js +43 -0
- package/dist/src/memory/scopes/thisMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/turnMemoryScope.d.ts +29 -0
- package/dist/src/memory/scopes/turnMemoryScope.js +52 -0
- package/dist/src/memory/scopes/turnMemoryScope.js.map +1 -0
- package/dist/src/memory/scopes/userMemoryScope.d.ts +15 -0
- package/dist/src/memory/scopes/userMemoryScope.js +23 -0
- package/dist/src/memory/scopes/userMemoryScope.js.map +1 -0
- package/dist/src/memory/turnPath.d.ts +21 -0
- package/dist/src/memory/turnPath.js +38 -0
- package/dist/src/memory/turnPath.js.map +1 -0
- package/dist/src/prompts/activityPrompt.d.ts +101 -0
- package/dist/src/prompts/activityPrompt.js +166 -0
- package/dist/src/prompts/activityPrompt.js.map +1 -0
- package/dist/src/prompts/attachmentPrompt.d.ts +37 -0
- package/dist/src/prompts/attachmentPrompt.js +55 -0
- package/dist/src/prompts/attachmentPrompt.js.map +1 -0
- package/dist/src/prompts/choicePrompt.d.ts +83 -0
- package/dist/src/prompts/choicePrompt.js +116 -0
- package/dist/src/prompts/choicePrompt.js.map +1 -0
- package/dist/src/prompts/confirmPrompt.d.ts +82 -0
- package/dist/src/prompts/confirmPrompt.js +163 -0
- package/dist/src/prompts/confirmPrompt.js.map +1 -0
- package/dist/src/prompts/datetimePrompt.d.ts +65 -0
- package/dist/src/prompts/datetimePrompt.js +109 -0
- package/dist/src/prompts/datetimePrompt.js.map +1 -0
- package/dist/src/prompts/index.d.ts +13 -0
- package/dist/src/prompts/index.js +30 -0
- package/dist/src/prompts/index.js.map +1 -0
- package/dist/src/prompts/numberPrompt.d.ts +55 -0
- package/dist/src/prompts/numberPrompt.js +134 -0
- package/dist/src/prompts/numberPrompt.js.map +1 -0
- package/dist/src/prompts/prompt.d.ts +256 -0
- package/dist/src/prompts/prompt.js +260 -0
- package/dist/src/prompts/prompt.js.map +1 -0
- package/dist/src/prompts/promptCultureModels.d.ts +72 -0
- package/dist/src/prompts/promptCultureModels.js +123 -0
- package/dist/src/prompts/promptCultureModels.js.map +1 -0
- package/dist/src/prompts/textPrompt.d.ts +54 -0
- package/dist/src/prompts/textPrompt.js +72 -0
- package/dist/src/prompts/textPrompt.js.map +1 -0
- package/dist/src/recognizer.d.ts +43 -0
- package/dist/src/recognizer.js +104 -0
- package/dist/src/recognizer.js.map +1 -0
- package/dist/src/recognizerResult.d.ts +19 -0
- package/dist/src/recognizerResult.js +24 -0
- package/dist/src/recognizerResult.js.map +1 -0
- package/dist/src/serviceCollection.d.ts +112 -0
- package/dist/src/serviceCollection.js +209 -0
- package/dist/src/serviceCollection.js.map +1 -0
- package/dist/src/stringUtils.d.ts +36 -0
- package/dist/src/stringUtils.js +62 -0
- package/dist/src/stringUtils.js.map +1 -0
- package/dist/src/template.d.ts +18 -0
- package/dist/src/template.js +7 -0
- package/dist/src/template.js.map +1 -0
- package/dist/src/waterfallDialog.d.ts +101 -0
- package/dist/src/waterfallDialog.js +179 -0
- package/dist/src/waterfallDialog.js.map +1 -0
- package/dist/src/waterfallStepContext.d.ts +71 -0
- package/dist/src/waterfallStepContext.js +78 -0
- package/dist/src/waterfallStepContext.js.map +1 -0
- package/package.json +49 -0
- package/src/agentComponent.ts +23 -0
- package/src/agentStateSet.ts +75 -0
- package/src/choices/choice.ts +16 -0
- package/src/choices/choiceFactory.ts +189 -0
- package/src/choices/findChoices.ts +70 -0
- package/src/choices/findValues.ts +179 -0
- package/src/choices/index.ts +11 -0
- package/src/choices/modelResult.ts +11 -0
- package/src/choices/recognizeChoices.ts +94 -0
- package/src/choices/tokenizer.ts +93 -0
- package/src/componentDialog.ts +306 -0
- package/src/componentRegistration.ts +30 -0
- package/src/configurable.ts +55 -0
- package/src/configuration.ts +22 -0
- package/src/converter.ts +15 -0
- package/src/dialog.ts +243 -0
- package/src/dialogContainer.ts +90 -0
- package/src/dialogContext.ts +607 -0
- package/src/dialogContextError.ts +50 -0
- package/src/dialogEvent.ts +23 -0
- package/src/dialogEvents.ts +16 -0
- package/src/dialogHelper.ts +154 -0
- package/src/dialogInstance.ts +32 -0
- package/src/dialogManager.ts +202 -0
- package/src/dialogReason.ts +40 -0
- package/src/dialogSet.ts +168 -0
- package/src/dialogTurnResult.ts +37 -0
- package/src/dialogTurnStateConstants.ts +13 -0
- package/src/dialogTurnStatus.ts +38 -0
- package/src/dialogsAgentComponent.ts +71 -0
- package/src/dialogsComponentRegistration.ts +49 -0
- package/src/i18n.ts +17 -0
- package/src/index.ts +31 -0
- package/src/intentScore.ts +11 -0
- package/src/memory/componentMemoryScopes.ts +28 -0
- package/src/memory/componentPathResolvers.ts +29 -0
- package/src/memory/dialogPath.ts +33 -0
- package/src/memory/dialogStateManager.ts +661 -0
- package/src/memory/index.ts +12 -0
- package/src/memory/pathResolvers/aliasPathResolver.ts +44 -0
- package/src/memory/pathResolvers/atAtPathResolver.ts +14 -0
- package/src/memory/pathResolvers/atPathResolver.ts +45 -0
- package/src/memory/pathResolvers/dollarPathResolver.ts +14 -0
- package/src/memory/pathResolvers/hashPathResolver.ts +14 -0
- package/src/memory/pathResolvers/index.ts +11 -0
- package/src/memory/pathResolvers/pathResolver.ts +14 -0
- package/src/memory/pathResolvers/percentPathResolver.ts +14 -0
- package/src/memory/scopePath.ts +19 -0
- package/src/memory/scopes/agentStateMemoryScope.ts +92 -0
- package/src/memory/scopes/classMemoryScope.ts +71 -0
- package/src/memory/scopes/conversationMemoryScope.ts +19 -0
- package/src/memory/scopes/dialogClassMemoryScope.ts +43 -0
- package/src/memory/scopes/dialogContextMemoryScope.ts +51 -0
- package/src/memory/scopes/dialogMemoryScope.ts +79 -0
- package/src/memory/scopes/index.ts +15 -0
- package/src/memory/scopes/memoryScope.ts +70 -0
- package/src/memory/scopes/settingsMemoryScope.ts +239 -0
- package/src/memory/scopes/thisMemoryScope.ts +44 -0
- package/src/memory/scopes/turnMemoryScope.ts +54 -0
- package/src/memory/scopes/userMemoryScope.ts +19 -0
- package/src/memory/turnPath.ts +45 -0
- package/src/prompts/activityPrompt.ts +202 -0
- package/src/prompts/attachmentPrompt.ts +62 -0
- package/src/prompts/choicePrompt.ts +176 -0
- package/src/prompts/confirmPrompt.ts +182 -0
- package/src/prompts/datetimePrompt.ts +110 -0
- package/src/prompts/index.ts +13 -0
- package/src/prompts/numberPrompt.ts +117 -0
- package/src/prompts/prompt.ts +459 -0
- package/src/prompts/promptCultureModels.ts +178 -0
- package/src/prompts/textPrompt.ts +82 -0
- package/src/recognizer.ts +127 -0
- package/src/recognizerResult.ts +37 -0
- package/src/serviceCollection.ts +305 -0
- package/src/stringUtils.ts +62 -0
- package/src/template.ts +20 -0
- package/src/waterfallDialog.ts +215 -0
- package/src/waterfallStepContext.ts +96 -0
- package/vendor/cldr-data/README.md +5 -0
- package/vendor/cldr-data/main/de/numbers.json +156 -0
- package/vendor/cldr-data/main/en/numbers.json +159 -0
- package/vendor/cldr-data/main/es/numbers.json +156 -0
- package/vendor/cldr-data/main/fr/numbers.json +157 -0
- package/vendor/cldr-data/main/ja/numbers.json +120 -0
- package/vendor/cldr-data/main/nl/numbers.json +156 -0
- package/vendor/cldr-data/main/pt/numbers.json +156 -0
- package/vendor/cldr-data/main/zh/numbers.json +214 -0
- package/vendor/cldr-data/supplemental/likelySubtags.json +1844 -0
- package/vendor/cldr-data/supplemental/numberingSystems.json +343 -0
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT License.
|
|
4
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
5
|
+
if (k2 === undefined) k2 = k;
|
|
6
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
7
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
8
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
9
|
+
}
|
|
10
|
+
Object.defineProperty(o, k2, desc);
|
|
11
|
+
}) : (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
o[k2] = m[k];
|
|
14
|
+
}));
|
|
15
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
+
}) : function(o, v) {
|
|
18
|
+
o["default"] = v;
|
|
19
|
+
});
|
|
20
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
21
|
+
var ownKeys = function(o) {
|
|
22
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
23
|
+
var ar = [];
|
|
24
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
return ownKeys(o);
|
|
28
|
+
};
|
|
29
|
+
return function (mod) {
|
|
30
|
+
if (mod && mod.__esModule) return mod;
|
|
31
|
+
var result = {};
|
|
32
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
+
exports.ServiceCollection = void 0;
|
|
39
|
+
const assert_1 = __importStar(require("assert"));
|
|
40
|
+
const dependency_graph_1 = require("dependency-graph");
|
|
41
|
+
/**
|
|
42
|
+
* ServiceCollection is an interface that describes a set of methods to register services. This, in a lighter way,
|
|
43
|
+
* mimics the .NET dependency injection service collection functionality, except for instances rather than types.
|
|
44
|
+
*/
|
|
45
|
+
class ServiceCollection {
|
|
46
|
+
/**
|
|
47
|
+
* Construct a Providers instance
|
|
48
|
+
*
|
|
49
|
+
* @template S services interface
|
|
50
|
+
* @param defaultServices default set of services
|
|
51
|
+
*/
|
|
52
|
+
constructor(defaultServices = {}) {
|
|
53
|
+
// We store the full set of dependencies as a workaround to the fact that `DepGraph` throws an error if you
|
|
54
|
+
// attempt to register a dependency to a node that does not yet exist.
|
|
55
|
+
this.dependencies = new Map();
|
|
56
|
+
/**
|
|
57
|
+
* `DepGraph` is a dependency graph data structure. In our case, the services we support are encoded as a
|
|
58
|
+
* dependency graph where nodes are named with a key and store a list of factory methods.
|
|
59
|
+
*/
|
|
60
|
+
this.graph = new dependency_graph_1.DepGraph();
|
|
61
|
+
/**
|
|
62
|
+
* Cache constructed instances for reuse
|
|
63
|
+
*/
|
|
64
|
+
this.cache = {};
|
|
65
|
+
Object.entries(defaultServices).forEach(([key, instance]) => {
|
|
66
|
+
this.addInstance(key, instance);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Register an instance by key. This will overwrite existing instances.
|
|
71
|
+
*
|
|
72
|
+
* @param key key of the instance being provided
|
|
73
|
+
* @param instance instance to provide
|
|
74
|
+
* @returns this for chaining
|
|
75
|
+
*/
|
|
76
|
+
addInstance(key, instance) {
|
|
77
|
+
if (this.graph.hasNode(key)) {
|
|
78
|
+
this.graph.removeNode(key);
|
|
79
|
+
}
|
|
80
|
+
this.graph.addNode(key, [() => instance]);
|
|
81
|
+
return this;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*/
|
|
86
|
+
addFactory(key, depsOrFactory, maybeFactory) {
|
|
87
|
+
const dependencies = Array.isArray(depsOrFactory) ? depsOrFactory : undefined;
|
|
88
|
+
let factory = maybeFactory;
|
|
89
|
+
if (!factory && typeof depsOrFactory === 'function') {
|
|
90
|
+
factory = (_services, value) => depsOrFactory(value);
|
|
91
|
+
}
|
|
92
|
+
// Asserts factory is not undefined
|
|
93
|
+
(0, assert_1.ok)(factory, 'illegal invocation with undefined factory');
|
|
94
|
+
if (dependencies) {
|
|
95
|
+
this.dependencies.set(key, dependencies);
|
|
96
|
+
}
|
|
97
|
+
// If the graph already has this key, fetch its data and remove it (to be replaced)
|
|
98
|
+
let factories = [];
|
|
99
|
+
if (this.graph.hasNode(key)) {
|
|
100
|
+
factories = this.graph.getNodeData(key);
|
|
101
|
+
this.graph.removeNode(key);
|
|
102
|
+
}
|
|
103
|
+
this.graph.addNode(key, factories.concat(factory));
|
|
104
|
+
return this;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
composeFactory(key, depsOrFactory, maybeFactory) {
|
|
110
|
+
if (maybeFactory) {
|
|
111
|
+
return this.addFactory(key, Array.isArray(depsOrFactory) ? depsOrFactory : [], (dependencies, value) => {
|
|
112
|
+
(0, assert_1.ok)(value, `unable to create ${key}, initial value undefined`);
|
|
113
|
+
return maybeFactory(dependencies, value);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
(0, assert_1.ok)(typeof depsOrFactory === 'function', 'illegal invocation with undefined factory');
|
|
118
|
+
return this.addFactory(key, (value) => {
|
|
119
|
+
(0, assert_1.ok)(value, `unable to create ${key}, initial value undefined`);
|
|
120
|
+
return depsOrFactory(value);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Register dependencies and then build nodes. Note: `nodes` is a function because ordering may
|
|
125
|
+
// depend on results of dependency registration
|
|
126
|
+
buildNodes(generateNodes, reuseServices = {}) {
|
|
127
|
+
// Consume all dependencies and then reset so updating registrations without re-registering
|
|
128
|
+
// dependencies works
|
|
129
|
+
this.dependencies.forEach((dependencies, node) => dependencies.forEach((dependency) => this.graph.addDependency(node, dependency)));
|
|
130
|
+
// Generate nodes after registering dependencies so ordering is correct
|
|
131
|
+
const nodes = generateNodes();
|
|
132
|
+
const services = nodes.reduce((services, service) => {
|
|
133
|
+
// Extra precaution
|
|
134
|
+
if (!this.graph.hasNode(service)) {
|
|
135
|
+
return services;
|
|
136
|
+
}
|
|
137
|
+
// Helper to generate return value
|
|
138
|
+
const assignValue = (value) => ({
|
|
139
|
+
...services,
|
|
140
|
+
[service]: value,
|
|
141
|
+
});
|
|
142
|
+
// Optionally reuse existing service
|
|
143
|
+
const reusedService = reuseServices[service];
|
|
144
|
+
if (reusedService !== undefined) {
|
|
145
|
+
return assignValue(reusedService);
|
|
146
|
+
}
|
|
147
|
+
// Each node stores a list of factory methods.
|
|
148
|
+
const factories = this.graph.getNodeData(service);
|
|
149
|
+
// Produce the instance by reducing those factories, passing the instance along for composition.
|
|
150
|
+
const instance = factories.reduce((value, factory) => factory(services, value), services[service]);
|
|
151
|
+
return assignValue(instance);
|
|
152
|
+
}, {});
|
|
153
|
+
// Cache results for subsequent invocations that may desire pre-constructed instances
|
|
154
|
+
Object.assign(this.cache, services);
|
|
155
|
+
return services;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Build a single service.
|
|
159
|
+
*
|
|
160
|
+
* @param key service to build
|
|
161
|
+
* @param deep reconstruct all dependencies
|
|
162
|
+
* @returns the service instance, or undefined
|
|
163
|
+
*/
|
|
164
|
+
makeInstance(key, deep = false) {
|
|
165
|
+
// If this is not a deep reconstruction, reuse any services that `key` depends on
|
|
166
|
+
let initialServices;
|
|
167
|
+
if (!deep) {
|
|
168
|
+
const { [key]: _, ...cached } = this.cache;
|
|
169
|
+
initialServices = cached;
|
|
170
|
+
}
|
|
171
|
+
const services = this.buildNodes(() => this.graph.dependenciesOf(key).concat(key), initialServices);
|
|
172
|
+
return services[key];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build a single service and assert that it is not undefined.
|
|
176
|
+
*
|
|
177
|
+
* @param key service to build
|
|
178
|
+
* @param deep reconstruct all dependencies
|
|
179
|
+
* @returns the service instance
|
|
180
|
+
*/
|
|
181
|
+
mustMakeInstance(key, deep = false) {
|
|
182
|
+
const instance = this.makeInstance(key, deep);
|
|
183
|
+
assert_1.default.ok(instance, `\`${key}\` instance undefined!`);
|
|
184
|
+
return instance;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Build the full set of services.
|
|
188
|
+
*
|
|
189
|
+
* @returns all resolved services
|
|
190
|
+
*/
|
|
191
|
+
makeInstances() {
|
|
192
|
+
return this.buildNodes(() => this.graph.overallOrder());
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Build the full set of services, asserting that the specified keys are not undefined.
|
|
196
|
+
*
|
|
197
|
+
* @param keys instances that must be not undefined
|
|
198
|
+
* @returns all resolve services
|
|
199
|
+
*/
|
|
200
|
+
mustMakeInstances(...keys) {
|
|
201
|
+
const instances = this.makeInstances();
|
|
202
|
+
keys.forEach((key) => {
|
|
203
|
+
assert_1.default.ok(instances[key], `\`${key}\` instance undefined!`);
|
|
204
|
+
});
|
|
205
|
+
return instances;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.ServiceCollection = ServiceCollection;
|
|
209
|
+
//# sourceMappingURL=serviceCollection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serviceCollection.js","sourceRoot":"","sources":["../../src/serviceCollection.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElC,iDAAmC;AACnC,uDAA2C;AAyB3C;;;GAGG;AACH,MAAa,iBAAiB;IAgB5B;;;;;SAKK;IACL,YAAa,kBAA2C,EAAE;QArB1D,2GAA2G;QAC3G,sEAAsE;QACrD,iBAAY,GAA0B,IAAI,GAAG,EAAoB,CAAA;QAElF;;;aAGK;QACY,UAAK,GAAG,IAAI,2BAAQ,EAAoE,CAAA;QAEzG;;aAEK;QACG,UAAK,GAA4B,EAAE,CAAA;QASzC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE,EAAE;YAC1D,IAAI,CAAC,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;SAMK;IACL,WAAW,CAAe,GAAW,EAAE,QAAsB;QAC3D,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAC5B,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;QAC5B,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;QACzC,OAAO,IAAI,CAAA;IACb,CAAC;IAyBD;;SAEK;IACL,UAAU,CACR,GAAW,EACX,aAAsD,EACtD,YAAmE;QAEnE,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC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AAwB,CAAC,CAAA;QAErD,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED;;;;SAIK;IACL,aAAa;QACX,OAAO,IAAI,CAAC,UAAU,CAAgB,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAA;IACxE,CAAC;IAED;;;;;SAKK;IACL,iBAAiB,CACf,GAAG,IAAc;QAEjB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,EAAiB,CAAA;QAErD,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,gBAAM,CAAC,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,KAAK,GAAG,wBAAwB,CAAC,CAAA;QAC7D,CAAC,CAAC,CAAA;QAEF,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AA/QD,8CA+QC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Helper class containing string utility methods.
|
|
7
|
+
*/
|
|
8
|
+
export declare class StringUtils {
|
|
9
|
+
/**
|
|
10
|
+
* Truncate string with ...
|
|
11
|
+
*
|
|
12
|
+
* @param text Text.
|
|
13
|
+
* @param length Length to truncate text.
|
|
14
|
+
* @returns Original string modified.
|
|
15
|
+
*/
|
|
16
|
+
static ellipsis(text: string, length: number): string;
|
|
17
|
+
/**
|
|
18
|
+
* UniqueHash - create a unique hash from a string.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* The source for this function was derived from the following article:
|
|
22
|
+
*
|
|
23
|
+
* https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
|
|
24
|
+
* @param text Text to hash.
|
|
25
|
+
* @returns A string which is an unique hash.
|
|
26
|
+
*/
|
|
27
|
+
static hash(text: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* EllipsisHash - create truncated string with unique hash for the truncated part.
|
|
30
|
+
*
|
|
31
|
+
* @param text Text to truncate.
|
|
32
|
+
* @param length Length to truncate at.
|
|
33
|
+
* @returns The truncated string with unique hash for the truncated part.
|
|
34
|
+
*/
|
|
35
|
+
static ellipsisHash(text: string, length: number): string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
|
+
* Licensed under the MIT License.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.StringUtils = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Helper class containing string utility methods.
|
|
10
|
+
*/
|
|
11
|
+
class StringUtils {
|
|
12
|
+
/**
|
|
13
|
+
* Truncate string with ...
|
|
14
|
+
*
|
|
15
|
+
* @param text Text.
|
|
16
|
+
* @param length Length to truncate text.
|
|
17
|
+
* @returns Original string modified.
|
|
18
|
+
*/
|
|
19
|
+
static ellipsis(text, length) {
|
|
20
|
+
text = text || '';
|
|
21
|
+
if (text.length <= length) {
|
|
22
|
+
return text;
|
|
23
|
+
}
|
|
24
|
+
return `${text.substr(0, length)}...`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* UniqueHash - create a unique hash from a string.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* The source for this function was derived from the following article:
|
|
31
|
+
*
|
|
32
|
+
* https://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
|
|
33
|
+
* @param text Text to hash.
|
|
34
|
+
* @returns A string which is an unique hash.
|
|
35
|
+
*/
|
|
36
|
+
static hash(text) {
|
|
37
|
+
const length = text.length;
|
|
38
|
+
let hash = 0;
|
|
39
|
+
for (let i = 0; i < length; i++) {
|
|
40
|
+
const chr = text.charCodeAt(i);
|
|
41
|
+
hash = (hash << 5) - hash + chr;
|
|
42
|
+
hash |= 0; // Convert to 32 bit integer
|
|
43
|
+
}
|
|
44
|
+
return hash.toString();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* EllipsisHash - create truncated string with unique hash for the truncated part.
|
|
48
|
+
*
|
|
49
|
+
* @param text Text to truncate.
|
|
50
|
+
* @param length Length to truncate at.
|
|
51
|
+
* @returns The truncated string with unique hash for the truncated part.
|
|
52
|
+
*/
|
|
53
|
+
static ellipsisHash(text, length) {
|
|
54
|
+
text = text || '';
|
|
55
|
+
if (text.length <= length) {
|
|
56
|
+
return text;
|
|
57
|
+
}
|
|
58
|
+
return `${this.ellipsis(text, length)}${this.hash(text)}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.StringUtils = StringUtils;
|
|
62
|
+
//# sourceMappingURL=stringUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringUtils.js","sourceRoot":"","sources":["../../src/stringUtils.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;GAEG;AACH,MAAa,WAAW;IACtB;;;;;;SAMK;IACL,MAAM,CAAC,QAAQ,CAAE,IAAY,EAAE,MAAc;QAC3C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACjB,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAA;IACvC,CAAC;IAED;;;;;;;;;SASK;IACL,MAAM,CAAC,IAAI,CAAE,IAAY;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QAC1B,IAAI,IAAI,GAAG,CAAC,CAAA;QACZ,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAChC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;YAC9B,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,CAAA;YAC/B,IAAI,IAAI,CAAC,CAAA,CAAC,4BAA4B;QACxC,CAAC;QACD,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAA;IACxB,CAAC;IAED;;;;;;SAMK;IACL,MAAM,CAAC,YAAY,CAAE,IAAY,EAAE,MAAc;QAC/C,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;QACjB,IAAI,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;IAC3D,CAAC;CACF;AArDD,kCAqDC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
import { DialogContext } from './dialogContext';
|
|
6
|
+
/**
|
|
7
|
+
* Defines Template interface for binding data to T.
|
|
8
|
+
*/
|
|
9
|
+
export interface TemplateInterface<T, D = Record<string, unknown>> {
|
|
10
|
+
/**
|
|
11
|
+
* Given the turn context bind to the data to create the object
|
|
12
|
+
*
|
|
13
|
+
* @param dialogContext DialogContext.
|
|
14
|
+
* @param data Data to bind to.
|
|
15
|
+
* @returns Instance of T.
|
|
16
|
+
*/
|
|
17
|
+
bind(dialogContext: DialogContext, data?: D): Promise<T>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/template.ts"],"names":[],"mappings":";AAAA;;;GAGG"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Dialog } from './dialog';
|
|
2
|
+
import { DialogContext } from './dialogContext';
|
|
3
|
+
import { WaterfallStepContext } from './waterfallStepContext';
|
|
4
|
+
import { DialogTurnResult } from './dialogTurnResult';
|
|
5
|
+
import { DialogReason } from './dialogReason';
|
|
6
|
+
/**
|
|
7
|
+
* Function signature of an individual waterfall step.
|
|
8
|
+
*
|
|
9
|
+
* @param O (Optional) type of dialog options passed into the step.
|
|
10
|
+
* @param WaterfallStep.step Contextual information for the current step being executed.
|
|
11
|
+
*/
|
|
12
|
+
export type WaterfallStep<O extends object = {}> = (step: WaterfallStepContext<O>) => Promise<DialogTurnResult>;
|
|
13
|
+
/**
|
|
14
|
+
* A waterfall is a dialog that's optimized for prompting a user with a series of questions.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
|
|
18
|
+
private readonly steps;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new waterfall dialog containing the given array of steps.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* See the addstep function for details on creating a valid step function.
|
|
24
|
+
* @param dialogId Unique ID of the dialog within the component or set its being added to.
|
|
25
|
+
* @param steps (Optional) array of asynchronous waterfall step functions.
|
|
26
|
+
*/
|
|
27
|
+
constructor(dialogId: string, steps?: WaterfallStep<O>[]);
|
|
28
|
+
/**
|
|
29
|
+
* Gets the dialog version, composed of the ID and number of steps.
|
|
30
|
+
*
|
|
31
|
+
* @returns Dialog version, composed of the ID and number of steps.
|
|
32
|
+
*/
|
|
33
|
+
getVersion(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Adds a new step to the waterfall.
|
|
36
|
+
*
|
|
37
|
+
* @param step Asynchronous step function to call.
|
|
38
|
+
* @returns Waterfall dialog for fluent calls to `addStep()`.
|
|
39
|
+
*/
|
|
40
|
+
addStep(step: WaterfallStep<O>): this;
|
|
41
|
+
/**
|
|
42
|
+
* Called when the WaterfallDialog is started and pushed onto the dialog stack.
|
|
43
|
+
*
|
|
44
|
+
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
45
|
+
* @param options Optional, initial information to pass to the Dialog.
|
|
46
|
+
* @returns A Promise representing the asynchronous operation.
|
|
47
|
+
* @remarks
|
|
48
|
+
* If the task is successful, the result indicates whether the Dialog is still
|
|
49
|
+
* active after the turn has been processed by the dialog.
|
|
50
|
+
*/
|
|
51
|
+
beginDialog(dialogContext: DialogContext, options?: O): Promise<DialogTurnResult>;
|
|
52
|
+
/**
|
|
53
|
+
* Called when the WaterfallDialog is _continued_, where it is the active dialog and the
|
|
54
|
+
* user replies with a new Activity.
|
|
55
|
+
*
|
|
56
|
+
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
57
|
+
* @returns A Promise representing the asynchronous operation.
|
|
58
|
+
* @remarks
|
|
59
|
+
* If the task is successful, the result indicates whether the dialog is still
|
|
60
|
+
* active after the turn has been processed by the dialog. The result may also contain a
|
|
61
|
+
* return value.
|
|
62
|
+
*/
|
|
63
|
+
continueDialog(dialogContext: DialogContext): Promise<DialogTurnResult>;
|
|
64
|
+
/**
|
|
65
|
+
* Called when a child WaterfallDialog completed its turn, returning control to this dialog.
|
|
66
|
+
*
|
|
67
|
+
* @param dc The DialogContext for the current turn of the conversation.
|
|
68
|
+
* @param reason DialogReason why the dialog resumed.
|
|
69
|
+
* @param result Optional, value returned from the dialog that was called. The type
|
|
70
|
+
* of the value returned is dependent on the child dialog.
|
|
71
|
+
* @returns A Promise representing the asynchronous operation.
|
|
72
|
+
*/
|
|
73
|
+
resumeDialog(dc: DialogContext, reason: DialogReason, result?: any): Promise<DialogTurnResult>;
|
|
74
|
+
/**
|
|
75
|
+
* Called when an individual waterfall step is being executed.
|
|
76
|
+
*
|
|
77
|
+
* @remarks
|
|
78
|
+
* SHOULD be overridden by derived class that want to add custom logging semantics.
|
|
79
|
+
*
|
|
80
|
+
* @param step Context object for the waterfall step to execute.
|
|
81
|
+
* @returns A promise with the DialogTurnResult.
|
|
82
|
+
*/
|
|
83
|
+
protected onStep(step: WaterfallStepContext<O>): Promise<DialogTurnResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Executes a step of the WaterfallDialog.
|
|
86
|
+
*
|
|
87
|
+
* @param dc The DialogContext for the current turn of conversation.
|
|
88
|
+
* @param index The index of the current waterfall step to execute.
|
|
89
|
+
* @param reason The DialogReason the waterfall step is being executed.
|
|
90
|
+
* @param result Optional, result returned by a dialog called in the previous waterfall step.
|
|
91
|
+
* @returns A Promise that represents the work queued to execute.
|
|
92
|
+
*/
|
|
93
|
+
protected runStep(dc: DialogContext, index: number, reason: DialogReason, result?: any): Promise<DialogTurnResult>;
|
|
94
|
+
/**
|
|
95
|
+
* Identifies the step name by its position index.
|
|
96
|
+
*
|
|
97
|
+
* @param index Step position
|
|
98
|
+
* @returns A string that identifies the step name.
|
|
99
|
+
*/
|
|
100
|
+
private waterfallStepName;
|
|
101
|
+
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WaterfallDialog = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6
|
+
* Licensed under the MIT License.
|
|
7
|
+
*/
|
|
8
|
+
const uuid_1 = require("uuid");
|
|
9
|
+
const agents_hosting_1 = require("@microsoft/agents-hosting");
|
|
10
|
+
const dialog_1 = require("./dialog");
|
|
11
|
+
const waterfallStepContext_1 = require("./waterfallStepContext");
|
|
12
|
+
const dialogReason_1 = require("./dialogReason");
|
|
13
|
+
/**
|
|
14
|
+
* A waterfall is a dialog that's optimized for prompting a user with a series of questions.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
class WaterfallDialog extends dialog_1.Dialog {
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new waterfall dialog containing the given array of steps.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* See the addstep function for details on creating a valid step function.
|
|
23
|
+
* @param dialogId Unique ID of the dialog within the component or set its being added to.
|
|
24
|
+
* @param steps (Optional) array of asynchronous waterfall step functions.
|
|
25
|
+
*/
|
|
26
|
+
constructor(dialogId, steps) {
|
|
27
|
+
super(dialogId);
|
|
28
|
+
this.steps = [];
|
|
29
|
+
if (steps) {
|
|
30
|
+
this.steps = steps.slice(0);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Gets the dialog version, composed of the ID and number of steps.
|
|
35
|
+
*
|
|
36
|
+
* @returns Dialog version, composed of the ID and number of steps.
|
|
37
|
+
*/
|
|
38
|
+
getVersion() {
|
|
39
|
+
// Simply return the id + number of steps to help detect when new steps have
|
|
40
|
+
// been added to a given waterfall.
|
|
41
|
+
return `${this.id}:${this.steps.length}`;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new step to the waterfall.
|
|
45
|
+
*
|
|
46
|
+
* @param step Asynchronous step function to call.
|
|
47
|
+
* @returns Waterfall dialog for fluent calls to `addStep()`.
|
|
48
|
+
*/
|
|
49
|
+
addStep(step) {
|
|
50
|
+
this.steps.push(step);
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Called when the WaterfallDialog is started and pushed onto the dialog stack.
|
|
55
|
+
*
|
|
56
|
+
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
57
|
+
* @param options Optional, initial information to pass to the Dialog.
|
|
58
|
+
* @returns A Promise representing the asynchronous operation.
|
|
59
|
+
* @remarks
|
|
60
|
+
* If the task is successful, the result indicates whether the Dialog is still
|
|
61
|
+
* active after the turn has been processed by the dialog.
|
|
62
|
+
*/
|
|
63
|
+
async beginDialog(dialogContext, options) {
|
|
64
|
+
const state = dialogContext.activeDialog.state;
|
|
65
|
+
state.options = options || {};
|
|
66
|
+
state.values = {
|
|
67
|
+
instanceId: (0, uuid_1.v4)(),
|
|
68
|
+
};
|
|
69
|
+
// Run the first step
|
|
70
|
+
return await this.runStep(dialogContext, 0, dialogReason_1.DialogReason.beginCalled);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Called when the WaterfallDialog is _continued_, where it is the active dialog and the
|
|
74
|
+
* user replies with a new Activity.
|
|
75
|
+
*
|
|
76
|
+
* @param dialogContext The DialogContext for the current turn of conversation.
|
|
77
|
+
* @returns A Promise representing the asynchronous operation.
|
|
78
|
+
* @remarks
|
|
79
|
+
* If the task is successful, the result indicates whether the dialog is still
|
|
80
|
+
* active after the turn has been processed by the dialog. The result may also contain a
|
|
81
|
+
* return value.
|
|
82
|
+
*/
|
|
83
|
+
async continueDialog(dialogContext) {
|
|
84
|
+
// Don't do anything for non-message activities
|
|
85
|
+
if (dialogContext.context.activity.type !== agents_hosting_1.ActivityTypes.Message) {
|
|
86
|
+
return dialog_1.Dialog.EndOfTurn;
|
|
87
|
+
}
|
|
88
|
+
// Run next step with the message text as the result.
|
|
89
|
+
return await this.resumeDialog(dialogContext, dialogReason_1.DialogReason.continueCalled, dialogContext.context.activity.text);
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Called when a child WaterfallDialog completed its turn, returning control to this dialog.
|
|
93
|
+
*
|
|
94
|
+
* @param dc The DialogContext for the current turn of the conversation.
|
|
95
|
+
* @param reason DialogReason why the dialog resumed.
|
|
96
|
+
* @param result Optional, value returned from the dialog that was called. The type
|
|
97
|
+
* of the value returned is dependent on the child dialog.
|
|
98
|
+
* @returns A Promise representing the asynchronous operation.
|
|
99
|
+
*/
|
|
100
|
+
async resumeDialog(dc, reason, result) {
|
|
101
|
+
// Increment step index and run step
|
|
102
|
+
const state = dc.activeDialog.state;
|
|
103
|
+
return await this.runStep(dc, state.stepIndex + 1, reason, result);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Called when an individual waterfall step is being executed.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* SHOULD be overridden by derived class that want to add custom logging semantics.
|
|
110
|
+
*
|
|
111
|
+
* @param step Context object for the waterfall step to execute.
|
|
112
|
+
* @returns A promise with the DialogTurnResult.
|
|
113
|
+
*/
|
|
114
|
+
async onStep(step) {
|
|
115
|
+
return await this.steps[step.index](step);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Executes a step of the WaterfallDialog.
|
|
119
|
+
*
|
|
120
|
+
* @param dc The DialogContext for the current turn of conversation.
|
|
121
|
+
* @param index The index of the current waterfall step to execute.
|
|
122
|
+
* @param reason The DialogReason the waterfall step is being executed.
|
|
123
|
+
* @param result Optional, result returned by a dialog called in the previous waterfall step.
|
|
124
|
+
* @returns A Promise that represents the work queued to execute.
|
|
125
|
+
*/
|
|
126
|
+
async runStep(dc, index, reason, result) {
|
|
127
|
+
if (index < this.steps.length) {
|
|
128
|
+
// Update persisted step index
|
|
129
|
+
const state = dc.activeDialog.state;
|
|
130
|
+
state.stepIndex = index;
|
|
131
|
+
// Create step context
|
|
132
|
+
let nextCalled = false;
|
|
133
|
+
const step = new waterfallStepContext_1.WaterfallStepContext(dc, {
|
|
134
|
+
index,
|
|
135
|
+
options: state.options,
|
|
136
|
+
reason,
|
|
137
|
+
result,
|
|
138
|
+
values: state.values,
|
|
139
|
+
onNext: async (stepResult) => {
|
|
140
|
+
if (nextCalled) {
|
|
141
|
+
throw new Error(`WaterfallStepContext.next(): method already called for dialog and step '${this.id}[${index}]'.`);
|
|
142
|
+
}
|
|
143
|
+
nextCalled = true;
|
|
144
|
+
return await this.resumeDialog(dc, dialogReason_1.DialogReason.nextCalled, stepResult);
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
// Execute step
|
|
148
|
+
return await this.onStep(step);
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// End of waterfall so just return to parent
|
|
152
|
+
return await dc.endDialog(result);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Identifies the step name by its position index.
|
|
157
|
+
*
|
|
158
|
+
* @param index Step position
|
|
159
|
+
* @returns A string that identifies the step name.
|
|
160
|
+
*/
|
|
161
|
+
waterfallStepName(index) {
|
|
162
|
+
// Log Waterfall Step event. Each event has a distinct name to hook up
|
|
163
|
+
// to the Application Insights funnel.
|
|
164
|
+
let stepName = '';
|
|
165
|
+
if (this.steps[index]) {
|
|
166
|
+
try {
|
|
167
|
+
stepName = this.steps[index].name;
|
|
168
|
+
}
|
|
169
|
+
finally {
|
|
170
|
+
if (stepName === undefined || stepName === '') {
|
|
171
|
+
stepName = 'Step' + (index + 1) + 'of' + this.steps.length;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return stepName;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.WaterfallDialog = WaterfallDialog;
|
|
179
|
+
//# sourceMappingURL=waterfallDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"waterfallDialog.js","sourceRoot":"","sources":["../../src/waterfallDialog.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,+BAAmC;AACnC,8DAAyD;AACzD,qCAAiC;AAEjC,iEAA6D;AAE7D,iDAA6C;AAU7C;;;GAGG;AACH,MAAa,eAAuC,SAAQ,eAAS;IAGnE;;;;;;;SAOK;IACL,YAAa,QAAgB,EAAE,KAA0B;QACvD,KAAK,CAAC,QAAQ,CAAC,CAAA;QACf,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;QACf,IAAI,KAAK,EAAE,CAAC;YACV,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC7B,CAAC;IACH,CAAC;IAED;;;;SAIK;IACL,UAAU;QACR,4EAA4E;QAC5E,mCAAmC;QACnC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;IAC1C,CAAC;IAED;;;;;SAKK;IACL,OAAO,CAAE,IAAsB;QAC7B,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAA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