@microsoft/agents-hosting-dialogs 0.2.10-g3ac88ff25e → 0.3.5

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.
Files changed (167) hide show
  1. package/dist/src/agentComponent.d.ts +18 -4
  2. package/dist/src/agentComponent.js +12 -4
  3. package/dist/src/agentComponent.js.map +1 -1
  4. package/dist/src/agentStateSet.d.ts +2 -2
  5. package/dist/src/agentStateSet.js +2 -2
  6. package/dist/src/choices/choice.d.ts +9 -0
  7. package/dist/src/choices/findChoices.d.ts +12 -0
  8. package/dist/src/choices/findChoices.js.map +1 -1
  9. package/dist/src/choices/findValues.d.ts +27 -0
  10. package/dist/src/choices/findValues.js.map +1 -1
  11. package/dist/src/choices/modelResult.d.ts +20 -0
  12. package/dist/src/choices/modelResult.js +4 -0
  13. package/dist/src/choices/modelResult.js.map +1 -1
  14. package/dist/src/choices/tokenizer.d.ts +15 -0
  15. package/dist/src/choices/tokenizer.js +4 -0
  16. package/dist/src/choices/tokenizer.js.map +1 -1
  17. package/dist/src/configurable.d.ts +1 -0
  18. package/dist/src/configurable.js +1 -0
  19. package/dist/src/configurable.js.map +1 -1
  20. package/dist/src/converter.d.ts +10 -1
  21. package/dist/src/dialog.d.ts +14 -13
  22. package/dist/src/dialog.js +11 -10
  23. package/dist/src/dialog.js.map +1 -1
  24. package/dist/src/dialogContext.d.ts +31 -32
  25. package/dist/src/dialogContext.js +22 -23
  26. package/dist/src/dialogContext.js.map +1 -1
  27. package/dist/src/dialogEvent.d.ts +3 -0
  28. package/dist/src/dialogEvents.d.ts +20 -0
  29. package/dist/src/dialogEvents.js +20 -0
  30. package/dist/src/dialogEvents.js.map +1 -1
  31. package/dist/src/dialogHelper.js +14 -0
  32. package/dist/src/dialogHelper.js.map +1 -1
  33. package/dist/src/dialogManager.d.ts +0 -1
  34. package/dist/src/dialogManager.js +0 -1
  35. package/dist/src/dialogManager.js.map +1 -1
  36. package/dist/src/dialogSet.d.ts +4 -8
  37. package/dist/src/dialogSet.js +4 -8
  38. package/dist/src/dialogSet.js.map +1 -1
  39. package/dist/src/dialogTurnStateConstants.d.ts +13 -1
  40. package/dist/src/dialogTurnStateConstants.js +13 -1
  41. package/dist/src/dialogTurnStateConstants.js.map +1 -1
  42. package/dist/src/index.d.ts +5 -0
  43. package/dist/src/index.js +5 -0
  44. package/dist/src/index.js.map +1 -1
  45. package/dist/src/intentScore.d.ts +6 -0
  46. package/dist/src/memory/dialogPath.d.ts +40 -8
  47. package/dist/src/memory/dialogPath.js +32 -8
  48. package/dist/src/memory/dialogPath.js.map +1 -1
  49. package/dist/src/memory/dialogStateManager.d.ts +2 -2
  50. package/dist/src/memory/dialogStateManager.js +2 -2
  51. package/dist/src/memory/pathResolvers/aliasPathResolver.d.ts +4 -0
  52. package/dist/src/memory/pathResolvers/aliasPathResolver.js +4 -0
  53. package/dist/src/memory/pathResolvers/aliasPathResolver.js.map +1 -1
  54. package/dist/src/memory/pathResolvers/atAtPathResolver.d.ts +6 -2
  55. package/dist/src/memory/pathResolvers/atAtPathResolver.js +6 -2
  56. package/dist/src/memory/pathResolvers/atAtPathResolver.js.map +1 -1
  57. package/dist/src/memory/pathResolvers/atPathResolver.d.ts +13 -7
  58. package/dist/src/memory/pathResolvers/atPathResolver.js +13 -7
  59. package/dist/src/memory/pathResolvers/atPathResolver.js.map +1 -1
  60. package/dist/src/memory/pathResolvers/dollarPathResolver.d.ts +7 -2
  61. package/dist/src/memory/pathResolvers/dollarPathResolver.js +7 -2
  62. package/dist/src/memory/pathResolvers/dollarPathResolver.js.map +1 -1
  63. package/dist/src/memory/pathResolvers/hashPathResolver.d.ts +7 -2
  64. package/dist/src/memory/pathResolvers/hashPathResolver.js +7 -2
  65. package/dist/src/memory/pathResolvers/hashPathResolver.js.map +1 -1
  66. package/dist/src/memory/pathResolvers/pathResolver.d.ts +10 -5
  67. package/dist/src/memory/pathResolvers/percentPathResolver.d.ts +7 -2
  68. package/dist/src/memory/pathResolvers/percentPathResolver.js +7 -2
  69. package/dist/src/memory/pathResolvers/percentPathResolver.js.map +1 -1
  70. package/dist/src/memory/scopePath.d.ts +27 -0
  71. package/dist/src/memory/scopePath.js +27 -0
  72. package/dist/src/memory/scopePath.js.map +1 -1
  73. package/dist/src/memory/scopes/classMemoryScope.d.ts +18 -14
  74. package/dist/src/memory/scopes/classMemoryScope.js +18 -14
  75. package/dist/src/memory/scopes/classMemoryScope.js.map +1 -1
  76. package/dist/src/memory/scopes/dialogClassMemoryScope.d.ts +12 -6
  77. package/dist/src/memory/scopes/dialogClassMemoryScope.js +12 -6
  78. package/dist/src/memory/scopes/dialogClassMemoryScope.js.map +1 -1
  79. package/dist/src/memory/scopes/dialogContextMemoryScope.d.ts +11 -7
  80. package/dist/src/memory/scopes/dialogContextMemoryScope.js +11 -7
  81. package/dist/src/memory/scopes/dialogContextMemoryScope.js.map +1 -1
  82. package/dist/src/memory/scopes/dialogMemoryScope.d.ts +23 -16
  83. package/dist/src/memory/scopes/dialogMemoryScope.js +23 -16
  84. package/dist/src/memory/scopes/dialogMemoryScope.js.map +1 -1
  85. package/dist/src/memory/scopes/turnMemoryScope.d.ts +14 -13
  86. package/dist/src/memory/scopes/turnMemoryScope.js +14 -13
  87. package/dist/src/memory/scopes/turnMemoryScope.js.map +1 -1
  88. package/dist/src/memory/turnPath.d.ts +61 -13
  89. package/dist/src/memory/turnPath.js +49 -13
  90. package/dist/src/memory/turnPath.js.map +1 -1
  91. package/dist/src/prompts/attachmentPrompt.d.ts +1 -1
  92. package/dist/src/prompts/attachmentPrompt.js +1 -1
  93. package/dist/src/prompts/choicePrompt.d.ts +18 -5
  94. package/dist/src/prompts/choicePrompt.js +1 -1
  95. package/dist/src/prompts/choicePrompt.js.map +1 -1
  96. package/dist/src/prompts/confirmPrompt.d.ts +7 -8
  97. package/dist/src/prompts/confirmPrompt.js +3 -3
  98. package/dist/src/prompts/datetimePrompt.d.ts +6 -6
  99. package/dist/src/prompts/datetimePrompt.js +3 -3
  100. package/dist/src/prompts/numberPrompt.d.ts +6 -6
  101. package/dist/src/prompts/numberPrompt.js +6 -6
  102. package/dist/src/prompts/prompt.d.ts +7 -7
  103. package/dist/src/prompts/prompt.js +2 -2
  104. package/dist/src/prompts/promptCultureModels.d.ts +38 -3
  105. package/dist/src/prompts/promptCultureModels.js +38 -3
  106. package/dist/src/prompts/promptCultureModels.js.map +1 -1
  107. package/dist/src/recognizer.d.ts +8 -1
  108. package/dist/src/recognizer.js +5 -1
  109. package/dist/src/recognizer.js.map +1 -1
  110. package/dist/src/recognizerResult.d.ts +15 -0
  111. package/dist/src/recognizerResult.js.map +1 -1
  112. package/dist/src/serviceCollection.d.ts +22 -23
  113. package/dist/src/serviceCollection.js +11 -11
  114. package/dist/src/serviceCollection.js.map +1 -1
  115. package/dist/src/waterfallDialog.d.ts +5 -5
  116. package/dist/src/waterfallDialog.js +5 -5
  117. package/dist/src/waterfallStepContext.d.ts +21 -0
  118. package/dist/src/waterfallStepContext.js.map +1 -1
  119. package/package.json +2 -2
  120. package/src/agentComponent.ts +18 -4
  121. package/src/agentStateSet.ts +2 -2
  122. package/src/choices/choice.ts +11 -0
  123. package/src/choices/findChoices.ts +15 -0
  124. package/src/choices/findValues.ts +33 -0
  125. package/src/choices/modelResult.ts +25 -0
  126. package/src/choices/tokenizer.ts +19 -0
  127. package/src/configurable.ts +1 -0
  128. package/src/converter.ts +10 -1
  129. package/src/dialog.ts +14 -13
  130. package/src/dialogContext.ts +37 -38
  131. package/src/dialogEvent.ts +3 -0
  132. package/src/dialogEvents.ts +25 -0
  133. package/src/dialogHelper.ts +14 -1
  134. package/src/dialogManager.ts +0 -1
  135. package/src/dialogSet.ts +4 -8
  136. package/src/dialogTurnStateConstants.ts +15 -1
  137. package/src/index.ts +5 -0
  138. package/src/intentScore.ts +9 -2
  139. package/src/memory/dialogPath.ts +47 -23
  140. package/src/memory/dialogStateManager.ts +2 -2
  141. package/src/memory/pathResolvers/aliasPathResolver.ts +4 -0
  142. package/src/memory/pathResolvers/atAtPathResolver.ts +6 -2
  143. package/src/memory/pathResolvers/atPathResolver.ts +13 -7
  144. package/src/memory/pathResolvers/dollarPathResolver.ts +7 -2
  145. package/src/memory/pathResolvers/hashPathResolver.ts +7 -2
  146. package/src/memory/pathResolvers/pathResolver.ts +10 -5
  147. package/src/memory/pathResolvers/percentPathResolver.ts +7 -2
  148. package/src/memory/scopePath.ts +35 -0
  149. package/src/memory/scopes/classMemoryScope.ts +18 -14
  150. package/src/memory/scopes/dialogClassMemoryScope.ts +12 -6
  151. package/src/memory/scopes/dialogContextMemoryScope.ts +11 -7
  152. package/src/memory/scopes/dialogMemoryScope.ts +23 -16
  153. package/src/memory/scopes/turnMemoryScope.ts +14 -13
  154. package/src/memory/turnPath.ts +61 -25
  155. package/src/prompts/attachmentPrompt.ts +1 -1
  156. package/src/prompts/choicePrompt.ts +19 -4
  157. package/src/prompts/confirmPrompt.ts +7 -7
  158. package/src/prompts/datetimePrompt.ts +6 -6
  159. package/src/prompts/numberPrompt.ts +6 -6
  160. package/src/prompts/prompt.ts +7 -7
  161. package/src/prompts/promptCultureModels.ts +38 -3
  162. package/src/recognizer.ts +8 -1
  163. package/src/recognizerResult.ts +24 -5
  164. package/src/serviceCollection.ts +22 -23
  165. package/src/waterfallDialog.ts +5 -5
  166. package/src/waterfallStepContext.ts +32 -6
  167. package/dist/index.js +0 -20
@@ -7,18 +7,21 @@ const recognizers_text_suite_1 = require("@microsoft/recognizers-text-suite");
7
7
  */
8
8
  class PromptCultureModels {
9
9
  /**
10
+ * Retrieves a list of supported culture codes.
11
+ *
12
+ * @returns An array of supported locale strings.
10
13
  * @private
11
14
  */
12
15
  static getSupportedCultureCodes() {
13
16
  return this.getSupportedCultures().map((c) => c.locale);
14
17
  }
15
18
  /**
16
- * Use Recognizers-Text to normalize various potential Locale strings to a standard.
19
+ * Normalizes a given locale string to the nearest supported language.
17
20
  *
21
+ * @param cultureCode The locale string to normalize (e.g., "en-US").
22
+ * @returns The normalized locale string.
18
23
  * @remarks This is mostly a copy/paste from https://github.com/microsoft/Recognizers-Text/blob/master/JavaScript/packages/recognizers-text/src/culture.ts#L39
19
24
  * This doesn't directly use Recognizers-Text's MapToNearestLanguage because if they add language support before we do, it will break our prompts.
20
- * @param cultureCode Represents locale. Examples: "en-US, en-us, EN".
21
- * @returns Normalized locale.
22
25
  */
23
26
  static mapToNearestLanguage(cultureCode) {
24
27
  if (cultureCode) {
@@ -37,6 +40,9 @@ class PromptCultureModels {
37
40
  }
38
41
  }
39
42
  exports.PromptCultureModels = PromptCultureModels;
43
+ /**
44
+ * Represents the Chinese culture model with locale and language-specific settings.
45
+ */
40
46
  PromptCultureModels.Chinese = {
41
47
  locale: recognizers_text_suite_1.Culture.Chinese,
42
48
  separator: ', ',
@@ -45,6 +51,9 @@ PromptCultureModels.Chinese = {
45
51
  yesInLanguage: '是的',
46
52
  noInLanguage: '不',
47
53
  };
54
+ /**
55
+ * Represents the Dutch culture model with locale and language-specific settings.
56
+ */
48
57
  PromptCultureModels.Dutch = {
49
58
  locale: recognizers_text_suite_1.Culture.Dutch,
50
59
  separator: ', ',
@@ -53,6 +62,9 @@ PromptCultureModels.Dutch = {
53
62
  yesInLanguage: 'Ja',
54
63
  noInLanguage: 'Nee',
55
64
  };
65
+ /**
66
+ * Represents the English culture model with locale and language-specific settings.
67
+ */
56
68
  PromptCultureModels.English = {
57
69
  locale: recognizers_text_suite_1.Culture.English,
58
70
  separator: ', ',
@@ -61,6 +73,9 @@ PromptCultureModels.English = {
61
73
  yesInLanguage: 'Yes',
62
74
  noInLanguage: 'No',
63
75
  };
76
+ /**
77
+ * Represents the French culture model with locale and language-specific settings.
78
+ */
64
79
  PromptCultureModels.French = {
65
80
  locale: recognizers_text_suite_1.Culture.French,
66
81
  separator: ', ',
@@ -69,6 +84,9 @@ PromptCultureModels.French = {
69
84
  yesInLanguage: 'Oui',
70
85
  noInLanguage: 'Non',
71
86
  };
87
+ /**
88
+ * Represents the German culture model with locale and language-specific settings.
89
+ */
72
90
  PromptCultureModels.German = {
73
91
  locale: recognizers_text_suite_1.Culture.German,
74
92
  separator: ', ',
@@ -77,6 +95,9 @@ PromptCultureModels.German = {
77
95
  yesInLanguage: 'Ja',
78
96
  noInLanguage: 'Nein',
79
97
  };
98
+ /**
99
+ * Represents the Italian culture model with locale and language-specific settings.
100
+ */
80
101
  PromptCultureModels.Italian = {
81
102
  locale: recognizers_text_suite_1.Culture.Italian,
82
103
  separator: ', ',
@@ -85,6 +106,9 @@ PromptCultureModels.Italian = {
85
106
  yesInLanguage: 'Si',
86
107
  noInLanguage: 'No',
87
108
  };
109
+ /**
110
+ * Represents the Japanese culture model with locale and language-specific settings.
111
+ */
88
112
  PromptCultureModels.Japanese = {
89
113
  locale: recognizers_text_suite_1.Culture.Japanese,
90
114
  separator: '、 ',
@@ -93,6 +117,9 @@ PromptCultureModels.Japanese = {
93
117
  yesInLanguage: 'はい',
94
118
  noInLanguage: 'いいえ',
95
119
  };
120
+ /**
121
+ * Represents the Portuguese culture model with locale and language-specific settings.
122
+ */
96
123
  PromptCultureModels.Portuguese = {
97
124
  locale: recognizers_text_suite_1.Culture.Portuguese,
98
125
  separator: ', ',
@@ -101,6 +128,9 @@ PromptCultureModels.Portuguese = {
101
128
  yesInLanguage: 'Sim',
102
129
  noInLanguage: 'Não',
103
130
  };
131
+ /**
132
+ * Represents the Spanish culture model with locale and language-specific settings.
133
+ */
104
134
  PromptCultureModels.Spanish = {
105
135
  locale: recognizers_text_suite_1.Culture.Spanish,
106
136
  separator: ', ',
@@ -109,6 +139,11 @@ PromptCultureModels.Spanish = {
109
139
  yesInLanguage: 'Sí',
110
140
  noInLanguage: 'No',
111
141
  };
142
+ /**
143
+ * Retrieves a list of supported culture models.
144
+ *
145
+ * @returns An array of `PromptCultureModel` objects representing supported cultures.
146
+ */
112
147
  PromptCultureModels.getSupportedCultures = () => [
113
148
  PromptCultureModels.Chinese,
114
149
  PromptCultureModels.Dutch,
@@ -1 +1 @@
1
- {"version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AuB;IACnC,MAAM,EAAE,gCAAO,CAAC,OAAO;IACvB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,KAAK;IACnB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;CACnB,CAAA;AAED;;GAEG;AACI,4BAAQ,GAAuB;IACpC,MAAM,EAAE,gCAAO,CAAC,QAAQ;IACxB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,OAAO;IACjB,YAAY,EAAE,QAAQ;IACtB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,KAAK;CACpB,CAAA;AAED;;GAEG;AACI,8BAAU,GAAuB;IACtC,MAAM,EAAE,gCAAO,CAAC,UAAU;IAC1B,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,MAAM;IAChB,YAAY,EAAE,OAAO;IACrB,aAAa,EAAE,KAAK;IACpB,YAAY,EAAE,KAAK;CACpB,CAAA;AAED;;GAEG;AACI,2BAAO,GAAuB;IACnC,MAAM,EAAE,gCAAO,CAAC,OAAO;IACvB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,IAAI;IACnB,YAAY,EAAE,IAAI;CACnB,CAAA;AAuCD;;;;KAIK;AACE,wCAAoB,GAAG,GAAyB,EAAE,CAAC;IACxD,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,KAAK;IACzB,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,MAAM;IAC1B,mBAAmB,CAAC,MAAM;IAC1B,mBAAmB,CAAC,OAAO;IAC3B,mBAAmB,CAAC,QAAQ;IAC5B,mBAAmB,CAAC,UAAU;IAC9B,mBAAmB,CAAC,OAAO;CAC5B,CAAA"}
@@ -10,9 +10,16 @@ export interface RecognizerConfiguration {
10
10
  id?: string;
11
11
  }
12
12
  /**
13
- * Recognizer base class.
13
+ * Base class for implementing custom recognizers to identify intents and entities from user input.
14
+ *
15
+ * Recognizers process user input, such as text or speech, and return structured data representing
16
+ * the recognized intents, entities, and other relevant information. This class provides a foundation
17
+ * for creating custom recognizers by defining common methods and properties.
14
18
  */
15
19
  export declare class Recognizer extends Configurable implements RecognizerConfiguration {
20
+ /**
21
+ * Optional. The unique identifier for the recognizer.
22
+ */
16
23
  id?: string;
17
24
  /**
18
25
  * To recognize intents and entities in a users utterance.
@@ -8,7 +8,11 @@ const configurable_1 = require("./configurable");
8
8
  const omit_1 = __importDefault(require("lodash/omit"));
9
9
  const recognizerResult_1 = require("./recognizerResult");
10
10
  /**
11
- * Recognizer base class.
11
+ * Base class for implementing custom recognizers to identify intents and entities from user input.
12
+ *
13
+ * Recognizers process user input, such as text or speech, and return structured data representing
14
+ * the recognized intents, entities, and other relevant information. This class provides a foundation
15
+ * for creating custom recognizers by defining common methods and properties.
12
16
  */
13
17
  class Recognizer extends configurable_1.Configurable {
14
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"recognizer.js","sourceRoot":"","sources":["../../src/recognizer.ts"],"names":[],"mappings":";;;;;;AAKA,iDAA6C;AAE7C,uDAA8B;AAC9B,yDAA0E;AAM1E;;GAEG;AACH,MAAa,UAAW,SAAQ,2BAAY;IAE1C;;;;;;;SAOK;IACL,SAAS,CACP,cAA6B,EAC7B,SAA4B,EAC5B,oBAA6C,EAC7C,iBAA0C;QAE1C,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;IACzD,CAAC;IAED;;;;;SAKK;IACK,wBAAwB,CAAE,iBAAmD;QACrF,IAAI,IAAI,GAAW,EAAE,CAAA;QACrB,IAAI,SAAS,GAAwB,EAAE,CAAA;QAEnC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC,UAA2B,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE;YACzG,IAAI,GAAG,MAAM,CAAC,IAAI,CAAA;YAClB,SAAS,GAAG,MAAM,CAAC,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C,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CACvE;SACF,CAAA;QAED,IAAI,mBAAmB,EAAE,CAAC;YACxB,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,UAAU,EAAE,mBAAmB,CAAC,CAAA;QAC3D,CAAC;QAED,OAAO,UAAU,CAAA;IACnB,CAAC;IAES,+CAA+C,CAAE,gBAAkC;QAC3F,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAA;QACjF,MAAM,oBAAoB,GAA8B,EAAE,CAAA;QAC1D,KAAK,MAAM,GAAG,IAAI,gBAAgB,EAAE,CAAC;YACnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAChC,oBAAoB,CAAC,GAAG,CAAC,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAA;YACnD,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IACjG,CAAC;CACF;AAhHD,gCAgHC"}
@@ -7,10 +7,25 @@ import { IntentScore } from './intentScore';
7
7
  * Value returned from a recognizer.
8
8
  */
9
9
  export interface RecognizerResult {
10
+ /**
11
+ * The original text input provided by the user.
12
+ */
10
13
  text: string;
14
+ /**
15
+ * Optional. The modified version of the text input, if applicable.
16
+ */
11
17
  alteredText?: string;
18
+ /**
19
+ * A mapping of intent names to their corresponding confidence scores.
20
+ */
12
21
  intents: Record<string, IntentScore>;
22
+ /**
23
+ * Optional. Entities recognized in the input, if any.
24
+ */
13
25
  entities?: any;
26
+ /**
27
+ * Additional properties that may be included in the recognizer result.
28
+ */
14
29
  [propName: string]: any;
15
30
  }
16
31
  export declare const getTopScoringIntent: (result: RecognizerResult) => {
@@ -1 +1 @@
1
- {"version":3,"file":"recognizerResult.js","sourceRoot":"","sources":["../../src/recognizerResult.ts"],"names":[],"mappings":";;;AAiBO,MAAM,mBAAmB,GAAG,CAAC,MAAwB,EAAqC,EAAE;;IACjG,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAA;IACjB,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAClE,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,CAAC,CAAC,CAAA;QAChC,IAAI,CAAC,SAAS,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;YACnC,SAAS,GAAG,UAAU,CAAA;YACtB,QAAQ,GAAG,KAAK,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,QAAQ;KAChB,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,mBAAmB,uBAmB/B"}
1
+ {"version":3,"file":"recognizerResult.js","sourceRoot":"","sources":["../../src/recognizerResult.ts"],"names":[],"mappings":";;;AAoCO,MAAM,mBAAmB,GAAG,CAAC,MAAwB,EAAqC,EAAE;;IACjG,IAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACpC,CAAC;IAED,IAAI,SAAS,GAAG,EAAE,CAAA;IAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAA;IACjB,KAAK,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC;QAClE,MAAM,KAAK,GAAG,MAAA,MAAM,CAAC,KAAK,mCAAI,CAAC,CAAC,CAAA;QAChC,IAAI,CAAC,SAAS,IAAI,KAAK,GAAG,QAAQ,EAAE,CAAC;YACnC,SAAS,GAAG,UAAU,CAAA;YACtB,QAAQ,GAAG,KAAK,CAAA;QAClB,CAAC;IACH,CAAC;IAED,OAAO;QACL,MAAM,EAAE,SAAS;QACjB,KAAK,EAAE,QAAQ;KAChB,CAAA;AACH,CAAC,CAAA;AAnBY,QAAA,mBAAmB,uBAmB/B"}
@@ -39,33 +39,32 @@ export declare class ServiceCollection {
39
39
  /**
40
40
  * Register an instance by key. This will overwrite existing instances.
41
41
  *
42
- * @param key key of the instance being provided
43
- * @param instance instance to provide
44
- * @returns this for chaining
42
+ * @param key Key of the instance being provided.
43
+ * @param instance Instance to provide.
44
+ * @returns `this` for chaining.
45
45
  */
46
46
  addInstance<InstanceType>(key: string, instance: InstanceType): this;
47
47
  /**
48
48
  * Register a factory for a key.
49
49
  *
50
- * @param key key that factory will provide
51
- * @param factory function that creates an instance to provide
52
- * @returns this for chaining
50
+ * @param key Key that factory will provide.
51
+ * @param factory Function that creates an instance to provide.
52
+ * @returns `this` for chaining.
53
53
  */
54
54
  addFactory<InstanceType>(key: string, factory: Factory<InstanceType, false>): this;
55
55
  /**
56
56
  * Register a factory for a key with a set of dependencies.
57
57
  *
58
- * @param key key that factory will provide
59
- * @param dependencies set of things this instance depends on. Will be provided to factory function via `services`.
60
- * @param factory function that creates an instance to provide
61
- * @returns this for chaining
58
+ * @param key Key that factory will provide.
59
+ * @param dependencies Set of things this instance depends on. Will be provided to factory function via `services`.
60
+ * @param factory Function that creates an instance to provide.
61
+ * @returns `this` for chaining.
62
62
  */
63
63
  addFactory<InstanceType, Dependencies>(key: string, dependencies: string[], factory: DependencyFactory<InstanceType, Dependencies, false>): this;
64
64
  /**
65
65
  * Register a factory (that expects the initial value that is not undefined) for a key.
66
66
  *
67
67
  * @param key key of the instance being provided
68
- * @param instance instance to provide
69
68
  * @returns this for chaining
70
69
  */
71
70
  composeFactory<InstanceType>(key: string, factory: Factory<InstanceType, true>): this;
@@ -73,27 +72,27 @@ export declare class ServiceCollection {
73
72
  * Register a factory (that expects an initial value that is not undefined) for a key
74
73
  * with a set of dependencies.
75
74
  *
76
- * @param key key that factory will provide
77
- * @param dependencies set of things this instance depends on. Will be provided to factory function via `services`.
78
- * @param factory function that creates an instance to provide
79
- * @returns this for chaining
75
+ * @param key Key that factory will provide.
76
+ * @param dependencies Set of things this instance depends on. Will be provided to factory function via `services`.
77
+ * @param factory Function that creates an instance to provide.
78
+ * @returns `this` for chaining.
80
79
  */
81
80
  composeFactory<InstanceType, Dependencies>(key: string, dependencies: string[], factory: DependencyFactory<InstanceType, Dependencies, true>): this;
82
81
  private buildNodes;
83
82
  /**
84
83
  * Build a single service.
85
84
  *
86
- * @param key service to build
87
- * @param deep reconstruct all dependencies
88
- * @returns the service instance, or undefined
85
+ * @param key Service to build.
86
+ * @param deep Whether to reconstruct all dependencies.
87
+ * @returns The service instance, or undefined.
89
88
  */
90
89
  makeInstance<InstanceType = unknown>(key: string, deep?: boolean): InstanceType | undefined;
91
90
  /**
92
91
  * Build a single service and assert that it is not undefined.
93
92
  *
94
- * @param key service to build
95
- * @param deep reconstruct all dependencies
96
- * @returns the service instance
93
+ * @param key Service to build.
94
+ * @param deep Wheter to reconstruct all dependencies.
95
+ * @returns The service instance
97
96
  */
98
97
  mustMakeInstance<InstanceType = unknown>(key: string, deep?: boolean): InstanceType;
99
98
  /**
@@ -105,8 +104,8 @@ export declare class ServiceCollection {
105
104
  /**
106
105
  * Build the full set of services, asserting that the specified keys are not undefined.
107
106
  *
108
- * @param keys instances that must be not undefined
109
- * @returns all resolve services
107
+ * @param keys Instances that must be not undefined
108
+ * @returns All resolve services
110
109
  */
111
110
  mustMakeInstances<InstancesType extends Record<string, unknown> = Record<string, unknown>>(...keys: string[]): InstancesType;
112
111
  }
@@ -69,9 +69,9 @@ class ServiceCollection {
69
69
  /**
70
70
  * Register an instance by key. This will overwrite existing instances.
71
71
  *
72
- * @param key key of the instance being provided
73
- * @param instance instance to provide
74
- * @returns this for chaining
72
+ * @param key Key of the instance being provided.
73
+ * @param instance Instance to provide.
74
+ * @returns `this` for chaining.
75
75
  */
76
76
  addInstance(key, instance) {
77
77
  if (this.graph.hasNode(key)) {
@@ -157,9 +157,9 @@ class ServiceCollection {
157
157
  /**
158
158
  * Build a single service.
159
159
  *
160
- * @param key service to build
161
- * @param deep reconstruct all dependencies
162
- * @returns the service instance, or undefined
160
+ * @param key Service to build.
161
+ * @param deep Whether to reconstruct all dependencies.
162
+ * @returns The service instance, or undefined.
163
163
  */
164
164
  makeInstance(key, deep = false) {
165
165
  // If this is not a deep reconstruction, reuse any services that `key` depends on
@@ -174,9 +174,9 @@ class ServiceCollection {
174
174
  /**
175
175
  * Build a single service and assert that it is not undefined.
176
176
  *
177
- * @param key service to build
178
- * @param deep reconstruct all dependencies
179
- * @returns the service instance
177
+ * @param key Service to build.
178
+ * @param deep Wheter to reconstruct all dependencies.
179
+ * @returns The service instance
180
180
  */
181
181
  mustMakeInstance(key, deep = false) {
182
182
  const instance = this.makeInstance(key, deep);
@@ -194,8 +194,8 @@ class ServiceCollection {
194
194
  /**
195
195
  * Build the full set of services, asserting that the specified keys are not undefined.
196
196
  *
197
- * @param keys instances that must be not undefined
198
- * @returns all resolve services
197
+ * @param keys Instances that must be not undefined
198
+ * @returns All resolve services
199
199
  */
200
200
  mustMakeInstances(...keys) {
201
201
  const instances = this.makeInstances();
@@ -1 +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,M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,KAAK;QAChE,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAe,GAAG,EAAE,IAAI,CAAC,CAAA;QAC3D,gBAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,GAAG,wBAAwB,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;AA9QD,8CA8QC"}
@@ -20,7 +20,7 @@ export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
20
20
  * Creates a new waterfall dialog containing the given array of steps.
21
21
  *
22
22
  * @remarks
23
- * See the addstep function for details on creating a valid step function.
23
+ * See the {@link WaterfallDialog.addStep | addStep function} for details on creating a valid step function.
24
24
  * @param dialogId Unique ID of the dialog within the component or set its being added to.
25
25
  * @param steps (Optional) array of asynchronous waterfall step functions.
26
26
  */
@@ -41,7 +41,7 @@ export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
41
41
  /**
42
42
  * Called when the WaterfallDialog is started and pushed onto the dialog stack.
43
43
  *
44
- * @param dialogContext The DialogContext for the current turn of conversation.
44
+ * @param dialogContext The {@link DialogContext} for the current turn of conversation.
45
45
  * @param options Optional, initial information to pass to the Dialog.
46
46
  * @returns A Promise representing the asynchronous operation.
47
47
  * @remarks
@@ -53,7 +53,7 @@ export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
53
53
  * Called when the WaterfallDialog is _continued_, where it is the active dialog and the
54
54
  * user replies with a new Activity.
55
55
  *
56
- * @param dialogContext The DialogContext for the current turn of conversation.
56
+ * @param dialogContext The {@link DialogContext} for the current turn of conversation.
57
57
  * @returns A Promise representing the asynchronous operation.
58
58
  * @remarks
59
59
  * If the task is successful, the result indicates whether the dialog is still
@@ -64,7 +64,7 @@ export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
64
64
  /**
65
65
  * Called when a child WaterfallDialog completed its turn, returning control to this dialog.
66
66
  *
67
- * @param dc The DialogContext for the current turn of the conversation.
67
+ * @param dc The {@link DialogContext} for the current turn of the conversation.
68
68
  * @param reason DialogReason why the dialog resumed.
69
69
  * @param result Optional, value returned from the dialog that was called. The type
70
70
  * of the value returned is dependent on the child dialog.
@@ -84,7 +84,7 @@ export declare class WaterfallDialog<O extends object = {}> extends Dialog<O> {
84
84
  /**
85
85
  * Executes a step of the WaterfallDialog.
86
86
  *
87
- * @param dc The DialogContext for the current turn of conversation.
87
+ * @param dc The {@link DialogContext} for the current turn of conversation.
88
88
  * @param index The index of the current waterfall step to execute.
89
89
  * @param reason The DialogReason the waterfall step is being executed.
90
90
  * @param result Optional, result returned by a dialog called in the previous waterfall step.
@@ -19,7 +19,7 @@ class WaterfallDialog extends dialog_1.Dialog {
19
19
  * Creates a new waterfall dialog containing the given array of steps.
20
20
  *
21
21
  * @remarks
22
- * See the addstep function for details on creating a valid step function.
22
+ * See the {@link WaterfallDialog.addStep | addStep function} for details on creating a valid step function.
23
23
  * @param dialogId Unique ID of the dialog within the component or set its being added to.
24
24
  * @param steps (Optional) array of asynchronous waterfall step functions.
25
25
  */
@@ -53,7 +53,7 @@ class WaterfallDialog extends dialog_1.Dialog {
53
53
  /**
54
54
  * Called when the WaterfallDialog is started and pushed onto the dialog stack.
55
55
  *
56
- * @param dialogContext The DialogContext for the current turn of conversation.
56
+ * @param dialogContext The {@link DialogContext} for the current turn of conversation.
57
57
  * @param options Optional, initial information to pass to the Dialog.
58
58
  * @returns A Promise representing the asynchronous operation.
59
59
  * @remarks
@@ -73,7 +73,7 @@ class WaterfallDialog extends dialog_1.Dialog {
73
73
  * Called when the WaterfallDialog is _continued_, where it is the active dialog and the
74
74
  * user replies with a new Activity.
75
75
  *
76
- * @param dialogContext The DialogContext for the current turn of conversation.
76
+ * @param dialogContext The {@link DialogContext} for the current turn of conversation.
77
77
  * @returns A Promise representing the asynchronous operation.
78
78
  * @remarks
79
79
  * If the task is successful, the result indicates whether the dialog is still
@@ -91,7 +91,7 @@ class WaterfallDialog extends dialog_1.Dialog {
91
91
  /**
92
92
  * Called when a child WaterfallDialog completed its turn, returning control to this dialog.
93
93
  *
94
- * @param dc The DialogContext for the current turn of the conversation.
94
+ * @param dc The {@link DialogContext} for the current turn of the conversation.
95
95
  * @param reason DialogReason why the dialog resumed.
96
96
  * @param result Optional, value returned from the dialog that was called. The type
97
97
  * of the value returned is dependent on the child dialog.
@@ -117,7 +117,7 @@ class WaterfallDialog extends dialog_1.Dialog {
117
117
  /**
118
118
  * Executes a step of the WaterfallDialog.
119
119
  *
120
- * @param dc The DialogContext for the current turn of conversation.
120
+ * @param dc The {@link DialogContext} for the current turn of conversation.
121
121
  * @param index The index of the current waterfall step to execute.
122
122
  * @param reason The DialogReason the waterfall step is being executed.
123
123
  * @param result Optional, result returned by a dialog called in the previous waterfall step.
@@ -9,11 +9,32 @@ import { DialogTurnResult } from './dialogTurnResult';
9
9
  * Values passed to the `WaterfallStepContext` constructor.
10
10
  */
11
11
  export interface WaterfallStepInfo<O extends object> {
12
+ /**
13
+ * The index of the current step in the waterfall dialog.
14
+ */
12
15
  index: number;
16
+ /**
17
+ * The options passed to the waterfall dialog when it was started.
18
+ */
13
19
  options: O;
20
+ /**
21
+ * The reason the current step is being executed.
22
+ */
14
23
  reason: DialogReason;
24
+ /**
25
+ * The result returned by the previous step or dialog.
26
+ */
15
27
  result: any;
28
+ /**
29
+ * A dictionary of values shared across all steps in the waterfall dialog.
30
+ */
16
31
  values: object;
32
+ /**
33
+ * A function to proceed to the next step in the waterfall dialog.
34
+ *
35
+ * @param result Optional result to pass to the next step.
36
+ * @returns A promise resolving to the result of the next dialog turn.
37
+ */
17
38
  onNext(result?: any): Promise<DialogTurnResult>;
18
39
  }
19
40
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"waterfallStepContext.js","sourceRoot":"","sources":["../../src/waterfallStepContext.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,mDAA+C;AAgB/C;;;;GAIG;AACH,MAAa,oBAA4C,SAAQ,6BAAa;IAG5E;;;;;SAKK;IACL,YAAa,aAA4B,EAAE,QAA8B;QACvE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAA;QACjF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAA;IACpC,CAAC;IAED;;;;SAIK;IACL,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;IAC7B,CAAC;IAED;;;;;SAKK;IACL,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAA;IAC/B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;;SAKK;IACL,KAAK,CAAC,IAAI,CAAE,MAAY;QACtB,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;CACF;AAtED,oDAsEC"}
1
+ {"version":3,"file":"waterfallStepContext.js","sourceRoot":"","sources":["../../src/waterfallStepContext.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,mDAA+C;AA0C/C;;;;GAIG;AACH,MAAa,oBAA4C,SAAQ,6BAAa;IAG5E;;;;;SAKK;IACL,YAAa,aAA4B,EAAE,QAA8B;QACvE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,EAAE,WAAW,EAAE,aAAa,CAAC,KAAK,EAAE,CAAC,CAAA;QACjF,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAA;QACzB,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,MAAM,CAAA;IACpC,CAAC;IAED;;;;SAIK;IACL,IAAI,KAAK;QACP,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;IAC7B,CAAC;IAED;;;;;SAKK;IACL,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAA;IAC/B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;SAIK;IACL,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAA;IAC9B,CAAC;IAED;;;;;SAKK;IACL,KAAK,CAAC,IAAI,CAAE,MAAY;QACtB,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;CACF;AAtED,oDAsEC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "@microsoft/agents-hosting-dialogs",
4
- "version": "0.2.10-g3ac88ff25e",
4
+ "version": "0.3.5",
5
5
  "homepage": "https://github.com/microsoft/Agents-for-js",
6
6
  "repository": {
7
7
  "type": "git",
@@ -16,7 +16,7 @@
16
16
  "main": "dist/index.js",
17
17
  "types": "dist/src/index.d.ts",
18
18
  "dependencies": {
19
- "@microsoft/agents-hosting": "0.2.10-g3ac88ff25e",
19
+ "@microsoft/agents-hosting": "0.3.5",
20
20
  "@types/lodash": "^4.17.16",
21
21
  "dependency-graph": "^1.0.0",
22
22
  "@microsoft/recognizers-text-suite": "^1.3.1",
@@ -8,16 +8,30 @@ import { ServiceCollection } from './serviceCollection'
8
8
  import { Configuration } from './configuration'
9
9
 
10
10
  /**
11
- * Definition of an AgentComponent that allows registration of services, custom actions, memory scopes and adapters.
11
+ * Abstract base class for defining an AgentComponent.
12
12
  *
13
- * To make your components available to the system you derive from AgentComponent and register services to add functionality.
14
- * These components then are consumed in appropriate places by the systems that need them. When using Composer, configureServices
15
- * gets called automatically on the components by the agent runtime, as long as the components are registered in the configuration.
13
+ * @remarks
14
+ * An `AgentComponent` allows the registration of services, custom actions, memory scopes, and adapters.
15
+ * To make components available to the system, derive from this class and implement the `configureServices` method.
16
+ * These components are consumed by the system in appropriate places. When using Composer, the `configureServices`
17
+ * method is called automatically by the agent runtime, provided the components are registered in the configuration.
16
18
  */
17
19
  export abstract class AgentComponent {
20
+ /**
21
+ * A Zod schema for validating that an object is an `AgentComponent`.
22
+ *
23
+ * @remarks
24
+ * This schema checks if the object has a `configureServices` method.
25
+ */
18
26
  static z = z.custom<AgentComponent>((val: any) => typeof val.configureServices === 'function', {
19
27
  message: 'AgentComponent',
20
28
  })
21
29
 
30
+ /**
31
+ * Configures the services, custom actions, memory scopes, and adapters for the component.
32
+ *
33
+ * @param services - The service collection to which services can be added.
34
+ * @param configuration - The configuration object for accessing settings.
35
+ */
22
36
  abstract configureServices (services: ServiceCollection, configuration: Configuration): void
23
37
  }
@@ -42,7 +42,7 @@ export class AgentStateSet {
42
42
  }
43
43
 
44
44
  /**
45
- * Calls `AgentState.load()` on all of the AgentState plugins in the set.
45
+ * Calls the {@link AgentState.load | AgentState.load method} on all of the AgentState plugins in the set.
46
46
  *
47
47
  * @remarks
48
48
  * This will trigger all of the plugins to read in their state in parallel.
@@ -57,7 +57,7 @@ export class AgentStateSet {
57
57
  }
58
58
 
59
59
  /**
60
- * Calls `AgentState.saveChanges()` on all of the AgentState plugins in the set.
60
+ * Calls {@link AgentState.saveChanges | AgentState.saveChanges method} on all of the AgentState plugins in the set.
61
61
  *
62
62
  * @remarks
63
63
  * This will trigger all of the plugins to write out their state in parallel.
@@ -10,7 +10,18 @@ import { CardAction } from '@microsoft/agents-activity'
10
10
  * user picked.
11
11
  */
12
12
  export interface Choice {
13
+ /**
14
+ * The value of the choice, which is used to identify the choice.
15
+ */
13
16
  value: string;
17
+
18
+ /**
19
+ * An optional action associated with the choice, such as a button click.
20
+ */
14
21
  action?: CardAction;
22
+
23
+ /**
24
+ * Optional synonyms that can be used to recognize the choice.
25
+ */
15
26
  synonyms?: string[];
16
27
  }
@@ -8,9 +8,24 @@ import { ModelResult } from './modelResult'
8
8
  import { Choice } from './choice'
9
9
 
10
10
  export interface FindChoicesOptions extends FindValuesOptions {
11
+ /**
12
+ * If true, the value of the choice will not be included in the search.
13
+ */
11
14
  noValue?: boolean;
15
+
16
+ /**
17
+ * If true, the action title of the choice will not be included in the search.
18
+ */
12
19
  noAction?: boolean;
20
+
21
+ /**
22
+ * If true, numbers will be recognized as choices.
23
+ */
13
24
  recognizeNumbers?: boolean;
25
+
26
+ /**
27
+ * If true, ordinals (e.g., first, second) will be recognized as choices.
28
+ */
14
29
  recognizeOrdinals?: boolean;
15
30
  }
16
31