@microsoft/agents-hosting-dialogs 0.2.14 → 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 (161) 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/intentScore.d.ts +6 -0
  43. package/dist/src/memory/dialogPath.d.ts +40 -8
  44. package/dist/src/memory/dialogPath.js +32 -8
  45. package/dist/src/memory/dialogPath.js.map +1 -1
  46. package/dist/src/memory/dialogStateManager.d.ts +2 -2
  47. package/dist/src/memory/dialogStateManager.js +2 -2
  48. package/dist/src/memory/pathResolvers/aliasPathResolver.d.ts +4 -0
  49. package/dist/src/memory/pathResolvers/aliasPathResolver.js +4 -0
  50. package/dist/src/memory/pathResolvers/aliasPathResolver.js.map +1 -1
  51. package/dist/src/memory/pathResolvers/atAtPathResolver.d.ts +6 -2
  52. package/dist/src/memory/pathResolvers/atAtPathResolver.js +6 -2
  53. package/dist/src/memory/pathResolvers/atAtPathResolver.js.map +1 -1
  54. package/dist/src/memory/pathResolvers/atPathResolver.d.ts +13 -7
  55. package/dist/src/memory/pathResolvers/atPathResolver.js +13 -7
  56. package/dist/src/memory/pathResolvers/atPathResolver.js.map +1 -1
  57. package/dist/src/memory/pathResolvers/dollarPathResolver.d.ts +7 -2
  58. package/dist/src/memory/pathResolvers/dollarPathResolver.js +7 -2
  59. package/dist/src/memory/pathResolvers/dollarPathResolver.js.map +1 -1
  60. package/dist/src/memory/pathResolvers/hashPathResolver.d.ts +7 -2
  61. package/dist/src/memory/pathResolvers/hashPathResolver.js +7 -2
  62. package/dist/src/memory/pathResolvers/hashPathResolver.js.map +1 -1
  63. package/dist/src/memory/pathResolvers/pathResolver.d.ts +10 -5
  64. package/dist/src/memory/pathResolvers/percentPathResolver.d.ts +7 -2
  65. package/dist/src/memory/pathResolvers/percentPathResolver.js +7 -2
  66. package/dist/src/memory/pathResolvers/percentPathResolver.js.map +1 -1
  67. package/dist/src/memory/scopePath.d.ts +27 -0
  68. package/dist/src/memory/scopePath.js +27 -0
  69. package/dist/src/memory/scopePath.js.map +1 -1
  70. package/dist/src/memory/scopes/classMemoryScope.d.ts +18 -14
  71. package/dist/src/memory/scopes/classMemoryScope.js +18 -14
  72. package/dist/src/memory/scopes/classMemoryScope.js.map +1 -1
  73. package/dist/src/memory/scopes/dialogClassMemoryScope.d.ts +12 -6
  74. package/dist/src/memory/scopes/dialogClassMemoryScope.js +12 -6
  75. package/dist/src/memory/scopes/dialogClassMemoryScope.js.map +1 -1
  76. package/dist/src/memory/scopes/dialogContextMemoryScope.d.ts +11 -7
  77. package/dist/src/memory/scopes/dialogContextMemoryScope.js +11 -7
  78. package/dist/src/memory/scopes/dialogContextMemoryScope.js.map +1 -1
  79. package/dist/src/memory/scopes/dialogMemoryScope.d.ts +23 -16
  80. package/dist/src/memory/scopes/dialogMemoryScope.js +23 -16
  81. package/dist/src/memory/scopes/dialogMemoryScope.js.map +1 -1
  82. package/dist/src/memory/scopes/turnMemoryScope.d.ts +14 -13
  83. package/dist/src/memory/scopes/turnMemoryScope.js +14 -13
  84. package/dist/src/memory/scopes/turnMemoryScope.js.map +1 -1
  85. package/dist/src/memory/turnPath.d.ts +61 -13
  86. package/dist/src/memory/turnPath.js +49 -13
  87. package/dist/src/memory/turnPath.js.map +1 -1
  88. package/dist/src/prompts/attachmentPrompt.d.ts +1 -1
  89. package/dist/src/prompts/attachmentPrompt.js +1 -1
  90. package/dist/src/prompts/choicePrompt.d.ts +17 -3
  91. package/dist/src/prompts/choicePrompt.js +1 -1
  92. package/dist/src/prompts/choicePrompt.js.map +1 -1
  93. package/dist/src/prompts/confirmPrompt.d.ts +6 -6
  94. package/dist/src/prompts/confirmPrompt.js +3 -3
  95. package/dist/src/prompts/datetimePrompt.d.ts +6 -6
  96. package/dist/src/prompts/datetimePrompt.js +3 -3
  97. package/dist/src/prompts/numberPrompt.d.ts +6 -6
  98. package/dist/src/prompts/numberPrompt.js +6 -6
  99. package/dist/src/prompts/prompt.d.ts +7 -7
  100. package/dist/src/prompts/prompt.js +2 -2
  101. package/dist/src/prompts/promptCultureModels.d.ts +38 -3
  102. package/dist/src/prompts/promptCultureModels.js +38 -3
  103. package/dist/src/prompts/promptCultureModels.js.map +1 -1
  104. package/dist/src/recognizer.d.ts +8 -1
  105. package/dist/src/recognizer.js +5 -1
  106. package/dist/src/recognizer.js.map +1 -1
  107. package/dist/src/recognizerResult.d.ts +15 -0
  108. package/dist/src/recognizerResult.js.map +1 -1
  109. package/dist/src/serviceCollection.d.ts +22 -22
  110. package/dist/src/serviceCollection.js +11 -11
  111. package/dist/src/waterfallDialog.d.ts +5 -5
  112. package/dist/src/waterfallDialog.js +5 -5
  113. package/dist/src/waterfallStepContext.d.ts +21 -0
  114. package/dist/src/waterfallStepContext.js.map +1 -1
  115. package/package.json +2 -2
  116. package/src/agentComponent.ts +18 -4
  117. package/src/agentStateSet.ts +2 -2
  118. package/src/choices/choice.ts +11 -0
  119. package/src/choices/findChoices.ts +15 -0
  120. package/src/choices/findValues.ts +33 -0
  121. package/src/choices/modelResult.ts +25 -0
  122. package/src/choices/tokenizer.ts +19 -0
  123. package/src/configurable.ts +1 -0
  124. package/src/converter.ts +10 -1
  125. package/src/dialog.ts +14 -13
  126. package/src/dialogContext.ts +37 -38
  127. package/src/dialogEvent.ts +3 -0
  128. package/src/dialogEvents.ts +25 -0
  129. package/src/dialogHelper.ts +14 -1
  130. package/src/dialogManager.ts +0 -1
  131. package/src/dialogSet.ts +4 -8
  132. package/src/dialogTurnStateConstants.ts +15 -1
  133. package/src/intentScore.ts +9 -2
  134. package/src/memory/dialogPath.ts +47 -23
  135. package/src/memory/dialogStateManager.ts +2 -2
  136. package/src/memory/pathResolvers/aliasPathResolver.ts +4 -0
  137. package/src/memory/pathResolvers/atAtPathResolver.ts +6 -2
  138. package/src/memory/pathResolvers/atPathResolver.ts +13 -7
  139. package/src/memory/pathResolvers/dollarPathResolver.ts +7 -2
  140. package/src/memory/pathResolvers/hashPathResolver.ts +7 -2
  141. package/src/memory/pathResolvers/pathResolver.ts +10 -5
  142. package/src/memory/pathResolvers/percentPathResolver.ts +7 -2
  143. package/src/memory/scopePath.ts +35 -0
  144. package/src/memory/scopes/classMemoryScope.ts +18 -14
  145. package/src/memory/scopes/dialogClassMemoryScope.ts +12 -6
  146. package/src/memory/scopes/dialogContextMemoryScope.ts +11 -7
  147. package/src/memory/scopes/dialogMemoryScope.ts +23 -16
  148. package/src/memory/scopes/turnMemoryScope.ts +14 -13
  149. package/src/memory/turnPath.ts +61 -25
  150. package/src/prompts/attachmentPrompt.ts +1 -1
  151. package/src/prompts/choicePrompt.ts +18 -3
  152. package/src/prompts/confirmPrompt.ts +6 -6
  153. package/src/prompts/datetimePrompt.ts +6 -6
  154. package/src/prompts/numberPrompt.ts +6 -6
  155. package/src/prompts/prompt.ts +7 -7
  156. package/src/prompts/promptCultureModels.ts +38 -3
  157. package/src/recognizer.ts +8 -1
  158. package/src/recognizerResult.ts +24 -5
  159. package/src/serviceCollection.ts +22 -22
  160. package/src/waterfallDialog.ts +5 -5
  161. package/src/waterfallStepContext.ts +32 -6
@@ -4,10 +4,15 @@
4
4
  */
5
5
  import { AliasPathResolver } from './aliasPathResolver'
6
6
 
7
+ /**
8
+ * A path resolver that resolves paths starting with a dollar sign ('$')
9
+ * to the 'dialog.' namespace.
10
+ */
7
11
  export class DollarPathResolver extends AliasPathResolver {
8
12
  /**
9
- * Initializes a new instance of the DollarPathResolver class.
10
- */
13
+ * Initializes a new instance of the DollarPathResolver class.
14
+ * This resolver maps paths starting with '$' to the 'dialog.' namespace.
15
+ */
11
16
  constructor () {
12
17
  super('$', 'dialog.')
13
18
  }
@@ -4,10 +4,15 @@
4
4
  */
5
5
  import { AliasPathResolver } from './aliasPathResolver'
6
6
 
7
+ /**
8
+ * A path resolver that resolves paths starting with a hash sign ('#')
9
+ * to the 'turn.recognized.intents.' namespace.
10
+ */
7
11
  export class HashPathResolver extends AliasPathResolver {
8
12
  /**
9
- * Initializes a new instance of the HashPathResolver class.
10
- */
13
+ * Initializes a new instance of the HashPathResolver class.
14
+ * This resolver maps paths starting with '#' to the 'turn.recognized.intents.' namespace.
15
+ */
11
16
  constructor () {
12
17
  super('#', 'turn.recognized.intents.')
13
18
  }
@@ -3,12 +3,17 @@
3
3
  * Licensed under the MIT License.
4
4
  */
5
5
 
6
+ /**
7
+ * Interface for resolving and transforming paths.
8
+ * Implementations of this interface define how specific path patterns
9
+ * should be transformed into other formats or namespaces.
10
+ */
6
11
  export interface PathResolver {
7
12
  /**
8
- * Transform the path
9
- *
10
- * @param path Path to inspect.
11
- * @returns Transformed path
12
- */
13
+ * Transforms the given path into a new format or namespace.
14
+ *
15
+ * @param path - The path to inspect and transform.
16
+ * @returns The transformed path.
17
+ */
13
18
  transformPath(path: string): string;
14
19
  }
@@ -4,10 +4,15 @@
4
4
  */
5
5
  import { AliasPathResolver } from './aliasPathResolver'
6
6
 
7
+ /**
8
+ * A path resolver that resolves paths starting with a percent sign ('%')
9
+ * to the 'class.' namespace.
10
+ */
7
11
  export class PercentPathResolver extends AliasPathResolver {
8
12
  /**
9
- * Initializes a new instance of the PercentPathResolver class.
10
- */
13
+ * Initializes a new instance of the PercentPathResolver class.
14
+ * This resolver maps paths starting with '%' to the 'class.' namespace.
15
+ */
11
16
  constructor () {
12
17
  super('%', 'class.')
13
18
  }
@@ -7,13 +7,48 @@
7
7
  * Defines paths for the available scopes.
8
8
  */
9
9
  export class ScopePath {
10
+ /**
11
+ * Path for user-specific data.
12
+ */
10
13
  static readonly user = 'user'
14
+
15
+ /**
16
+ * Path for conversation-specific data.
17
+ */
11
18
  static readonly conversation = 'conversation'
19
+
20
+ /**
21
+ * Path for dialog-specific data.
22
+ */
12
23
  static readonly dialog = 'dialog'
24
+
25
+ /**
26
+ * Path for dialog class-specific data.
27
+ */
13
28
  static readonly dialogClass = 'dialogClass'
29
+
30
+ /**
31
+ * Path for dialog context-specific data.
32
+ */
14
33
  static readonly dialogContext = 'dialogContext'
34
+
35
+ /**
36
+ * Path for the current dialog instance data.
37
+ */
15
38
  static readonly this = 'this'
39
+
40
+ /**
41
+ * Path for class-specific data.
42
+ */
16
43
  static readonly class = 'class'
44
+
45
+ /**
46
+ * Path for settings-specific data.
47
+ */
17
48
  static readonly settings = 'settings'
49
+
50
+ /**
51
+ * Path for turn-specific data.
52
+ */
18
53
  static readonly turn = 'turn'
19
54
  }
@@ -7,22 +7,26 @@ import { ScopePath } from '../scopePath'
7
7
  import { DialogContext } from '../../dialogContext'
8
8
  import { Dialog } from '../../dialog'
9
9
 
10
+ /**
11
+ * A memory scope that provides access to the properties of the active dialog.
12
+ * This scope binds to the active dialog and clones its properties for use in memory.
13
+ */
10
14
  export class ClassMemoryScope extends MemoryScope {
11
15
  /**
12
- * Initializes a new instance of the ClassMemoryScope class.
13
- *
14
- * @param name Name of the scope class.
15
- */
16
+ * Initializes a new instance of the ClassMemoryScope class.
17
+ *
18
+ * @param name - Name of the scope class. Defaults to `ScopePath.class`.
19
+ */
16
20
  constructor (name = ScopePath.class) {
17
21
  super(name, false)
18
22
  }
19
23
 
20
24
  /**
21
- * Gets the backing memory for this scope.
22
- *
23
- * @param dialogContext The DialogContext object for this turn.
24
- * @returns The memory for the scope.
25
- */
25
+ * Gets the backing memory for this scope.
26
+ *
27
+ * @param dialogContext - The DialogContext object for this turn.
28
+ * @returns The memory for the scope, containing cloned properties of the active dialog.
29
+ */
26
30
  getMemory (dialogContext: DialogContext): object {
27
31
  // if active dialog is a container dialog then "dialog" binds to it
28
32
  if (dialogContext.activeDialog) {
@@ -52,11 +56,11 @@ export class ClassMemoryScope extends MemoryScope {
52
56
  }
53
57
 
54
58
  /**
55
- * Override to find the dialog instance referenced by the scope.
56
- *
57
- * @param dialogContext Current dialog context.
58
- * @returns The dialog instance referenced by the scope.
59
- */
59
+ * Override to find the dialog instance referenced by the scope.
60
+ *
61
+ * @param dialogContext - Current dialog context.
62
+ * @returns The dialog instance referenced by the scope, or undefined if not found.
63
+ */
60
64
  protected onFindDialog (dialogContext: DialogContext): Dialog | undefined {
61
65
  return dialogContext.findDialog(dialogContext.activeDialog.id)
62
66
  }
@@ -8,19 +8,25 @@ import { DialogContext } from '../../dialogContext'
8
8
  import { Dialog } from '../../dialog'
9
9
  import { DialogContainer } from '../../dialogContainer'
10
10
 
11
+ /**
12
+ * A memory scope that provides access to the properties of the active dialog class.
13
+ * This scope resolves to the active dialog if it is a container, or to its parent dialog.
14
+ */
11
15
  export class DialogClassMemoryScope extends ClassMemoryScope {
12
16
  /**
13
- * Initializes a new instance of the DialogClassMemoryScope class.
14
- */
17
+ * Initializes a new instance of the DialogClassMemoryScope class.
18
+ */
15
19
  constructor () {
16
20
  super(ScopePath.dialogClass)
17
21
  }
18
22
 
19
23
  /**
20
- * @protected
21
- * @param dialogContext The DialogContext object for this turn.
22
- * @returns The current Dialog.
23
- */
24
+ * @protected
25
+ * Finds the dialog instance referenced by the scope.
26
+ *
27
+ * @param dialogContext - The DialogContext object for this turn.
28
+ * @returns The current dialog, or its parent dialog if applicable.
29
+ */
24
30
  protected onFindDialog (dialogContext: DialogContext): Dialog | undefined {
25
31
  // Is the active dialog a container?
26
32
  const dialog = dialogContext.findDialog(dialogContext.activeDialog.id)
@@ -7,20 +7,24 @@ import { DialogContext } from '../../dialogContext'
7
7
  import { MemoryScope } from './memoryScope'
8
8
  import { ScopePath } from '../scopePath'
9
9
 
10
+ /**
11
+ * A memory scope that provides access to the dialog context.
12
+ * This scope includes information about the active dialog, its parent, and the dialog stack.
13
+ */
10
14
  export class DialogContextMemoryScope extends MemoryScope {
11
15
  /**
12
- * Initializes a new instance of the `DialogContextMemoryScope` class.
13
- */
16
+ * Initializes a new instance of the `DialogContextMemoryScope` class.
17
+ */
14
18
  constructor () {
15
19
  super(ScopePath.dialogContext, false)
16
20
  }
17
21
 
18
22
  /**
19
- * Gets the backing memory for this scope.
20
- *
21
- * @param dialogContext The `DialogContext` object for this turn.
22
- * @returns Memory for the scope.
23
- */
23
+ * Gets the backing memory for this scope.
24
+ *
25
+ * @param dialogContext - The `DialogContext` object for this turn.
26
+ * @returns An object containing the dialog stack, active dialog ID, and parent dialog ID.
27
+ */
24
28
  getMemory (dialogContext: DialogContext): Record<'stack' | 'activeDialog' | 'parent', unknown> {
25
29
  const stack = []
26
30
  let currentDialogContext: DialogContext | undefined = dialogContext
@@ -7,20 +7,24 @@ import { ScopePath } from '../scopePath'
7
7
  import { DialogContext } from '../../dialogContext'
8
8
  import { DialogContainer } from '../../dialogContainer'
9
9
 
10
+ /**
11
+ * A memory scope that provides access to the active dialog's state.
12
+ * This scope binds to the active dialog if it is a container, or to its parent dialog if applicable.
13
+ */
10
14
  export class DialogMemoryScope extends MemoryScope {
11
15
  /**
12
- * Initializes a new instance of the DialogMemoryScope class.
13
- */
16
+ * Initializes a new instance of the DialogMemoryScope class.
17
+ */
14
18
  constructor () {
15
19
  super(ScopePath.dialog)
16
20
  }
17
21
 
18
22
  /**
19
- * Gets the backing memory for this scope.
20
- *
21
- * @param dialogContext The DialogContext object for this turn.
22
- * @returns The memory for the scope.
23
- */
23
+ * Gets the backing memory for this scope.
24
+ *
25
+ * @param dialogContext - The DialogContext object for this turn.
26
+ * @returns The memory for the scope.
27
+ */
24
28
  getMemory (dialogContext: DialogContext): object {
25
29
  // If active dialog is a container dialog then "dialog" binds to it.
26
30
  // Otherwise the "dialog" will bind to the dialogs parent assuming it
@@ -35,11 +39,12 @@ export class DialogMemoryScope extends MemoryScope {
35
39
  }
36
40
 
37
41
  /**
38
- * Changes the backing object for the memory scope.
39
- *
40
- * @param dialogContext The DialogContext object for this turn.
41
- * @param memory Memory object to set for the scope.
42
- */
42
+ * Changes the backing object for the memory scope.
43
+ *
44
+ * @param dialogContext - The DialogContext object for this turn.
45
+ * @param memory - Memory object to set for the scope.
46
+ * @throws Will throw an error if the memory object is undefined or if no active dialog is found.
47
+ */
43
48
  setMemory (dialogContext: DialogContext, memory: object): void {
44
49
  if (memory === undefined) {
45
50
  throw new Error('DialogMemoryScope.setMemory: undefined memory object passed in.')
@@ -62,10 +67,12 @@ export class DialogMemoryScope extends MemoryScope {
62
67
  }
63
68
 
64
69
  /**
65
- * @private
66
- * @param dialogContext The DialogContext object for this turn.
67
- * @returns A boolean indicating whether is a cointainer or not.
68
- */
70
+ * Determines if the given dialog context is a container.
71
+ *
72
+ * @private
73
+ * @param dialogContext - The DialogContext object for this turn.
74
+ * @returns A boolean indicating whether the dialog context is a container.
75
+ */
69
76
  private isContainer (dialogContext: DialogContext): boolean {
70
77
  if (dialogContext !== undefined && dialogContext.activeDialog !== undefined) {
71
78
  const dialog = dialogContext.findDialog(dialogContext.activeDialog.id)
@@ -12,22 +12,23 @@ import { DialogContext } from '../../dialogContext'
12
12
  const TURN_STATE = 'turn'
13
13
 
14
14
  /**
15
- * TurnMemoryScope represents memory scoped to the current turn.
15
+ * A memory scope that provides access to the turn's state.
16
+ * This scope is used to store and retrieve information specific to the current turn.
16
17
  */
17
18
  export class TurnMemoryScope extends MemoryScope {
18
19
  /**
19
- * Initializes a new instance of the TurnMemoryScope class.
20
- */
20
+ * Initializes a new instance of the TurnMemoryScope class.
21
+ */
21
22
  constructor () {
22
23
  super(ScopePath.turn, true)
23
24
  }
24
25
 
25
26
  /**
26
- * Get the backing memory for this scope.
27
- *
28
- * @param dialogContext The DialogContext for this turn.
29
- * @returns The memory for the scope.
30
- */
27
+ * Gets the backing memory for this scope.
28
+ *
29
+ * @param dialogContext - The DialogContext object for this turn.
30
+ * @returns The memory for the scope.
31
+ */
31
32
  getMemory (dialogContext: DialogContext): object {
32
33
  let memory = dialogContext.context.turnState.get(TURN_STATE)
33
34
  if (typeof memory !== 'object') {
@@ -39,11 +40,11 @@ export class TurnMemoryScope extends MemoryScope {
39
40
  }
40
41
 
41
42
  /**
42
- * Changes the backing object for the memory scope.
43
- *
44
- * @param dialogContext The DialogContext for this turn.
45
- * @param memory Memory object to set for the scope.
46
- */
43
+ * Changes the backing object for the memory scope.
44
+ *
45
+ * @param dialogContext - The DialogContext object for this turn.
46
+ * @param memory - Memory object to set for the scope.
47
+ */
47
48
  setMemory (dialogContext: DialogContext, memory: object): void {
48
49
  if (memory === undefined) {
49
50
  throw new Error('TurnMemoryScope.setMemory: undefined memory object passed in.')
@@ -4,42 +4,78 @@
4
4
  */
5
5
 
6
6
  /**
7
- * Defines path for avaiable turns.
7
+ * Defines path for available turns.
8
8
  */
9
9
  export class TurnPath {
10
- /// The result from the last dialog that was called.
11
- static readonly lastResult = 'turn.lastresult'
10
+ /**
11
+ * The result from the last dialog that was called.
12
+ * @constant A string key representing the last result path (`'turn.lastresult'`).
13
+ */
14
+ static readonly lastResult: string = 'turn.lastresult'
12
15
 
13
- /// The current activity for the turn.
14
- static readonly activity = 'turn.activity'
16
+ /**
17
+ * The current activity for the turn.
18
+ * @constant A string key representing the activity path (`'turn.activity'`).
19
+ */
20
+ static readonly activity: string = 'turn.activity'
15
21
 
16
- /// The recognized result for the current turn.
17
- static readonly recognized = 'turn.recognized'
22
+ /**
23
+ * The recognized result for the current turn.
24
+ * @constant A string key representing the recognized result path (`'turn.recognized'`).
25
+ */
26
+ static readonly recognized: string = 'turn.recognized'
18
27
 
19
- /// Path to the top intent.
20
- static readonly topIntent = 'turn.recognized.intent'
28
+ /**
29
+ * Path to the top intent.
30
+ * @constant A string key representing the top intent path (`'turn.recognized.intent'`).
31
+ */
32
+ static readonly topIntent: string = 'turn.recognized.intent'
21
33
 
22
- /// Path to the top score.
23
- static readonly topScore = 'turn.recognized.score'
34
+ /**
35
+ * Path to the top score.
36
+ * @constant A string key representing the top score path (`'turn.recognized.score'`).
37
+ */
38
+ static readonly topScore: string = 'turn.recognized.score'
24
39
 
25
- /// Original text.
26
- static readonly text = 'turn.recognized.text'
40
+ /**
41
+ * Original text.
42
+ * @constant A string key representing the original text path (`'turn.recognized.text'`).
43
+ */
44
+ static readonly text: string = 'turn.recognized.text'
27
45
 
28
- /// Original utterance split into unrecognized strings.
29
- static readonly unrecognizedText = 'turn.unrecognizedText'
46
+ /**
47
+ * Original utterance split into unrecognized strings.
48
+ * @constant A string key representing the unrecognized text path (`'turn.unrecognizedText'`).
49
+ */
50
+ static readonly unrecognizedText: string = 'turn.unrecognizedText'
30
51
 
31
- /// Entities that were recognized from text.
32
- static readonly recognizedEntities = 'turn.recognizedEntities'
52
+ /**
53
+ * Entities that were recognized from text.
54
+ * @constant A string key representing the recognized entities path (`'turn.recognizedEntities'`).
55
+ */
56
+ static readonly recognizedEntities: string = 'turn.recognizedEntities'
33
57
 
34
- /// If true an interruption has occured.
35
- static readonly interrupted = 'turn.interrupted'
58
+ /**
59
+ * If true, an interruption has occurred.
60
+ * @constant A string key representing the interrupted path (`'turn.interrupted'`).
61
+ */
62
+ static readonly interrupted: string = 'turn.interrupted'
36
63
 
37
- /// The current dialog event (set during event processings).
38
- static readonly dialogEvent = 'turn.dialogEvent'
64
+ /**
65
+ * The current dialog event (set during event processing).
66
+ * @constant A string key representing the dialog event path (`'turn.dialogEvent'`).
67
+ */
68
+ static readonly dialogEvent: string = 'turn.dialogEvent'
39
69
 
40
- /// Used to track that we don't end up in infinite loop of RepeatDialogs().
41
- static readonly repeatedIds = 'turn.repeatedIds'
70
+ /**
71
+ * Used to track that we don't end up in an infinite loop of RepeatDialogs().
72
+ * @constant A string key representing the repeated IDs path (`'turn.repeatedIds'`).
73
+ */
74
+ static readonly repeatedIds: string = 'turn.repeatedIds'
42
75
 
43
- /// This is a bool which if set means that the turncontext.activity has been consumed by some component in the system.
44
- static readonly activityProcessed = 'turn.activityProcessed'
76
+ /**
77
+ * Indicates whether the turncontext.activity has been consumed by some component in the system.
78
+ * @constant A string key representing the activity processed path (`'turn.activityProcessed'`).
79
+ */
80
+ static readonly activityProcessed: string = 'turn.activityProcessed'
45
81
  }
@@ -10,7 +10,7 @@ import { Attachment, InputHints } from '@microsoft/agents-activity'
10
10
  * Prompts a user to upload attachments like images.
11
11
  *
12
12
  * @remarks
13
- * By default the prompt will return to the calling dialog an `Attachment[]`.
13
+ * By default the prompt will return to the calling dialog an {@link Attachment[]}.
14
14
  */
15
15
  export class AttachmentPrompt extends Prompt<Attachment[]> {
16
16
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
@@ -9,7 +9,22 @@ import { PromptCultureModels } from './promptCultureModels'
9
9
  import { Activity } from '@microsoft/agents-activity'
10
10
 
11
11
  // Need ChoiceDefaultsProperty so we can set choiceDefaults dynamically with lambda
12
+
13
+ /**
14
+ * Represents a dictionary of default choice options for different locales.
15
+ *
16
+ * @remarks
17
+ * This interface is used to define the default options for rendering choices in prompts,
18
+ * such as separators, inline options, and whether to include numbers.
19
+ */
12
20
  export interface ChoiceDefaultsChoicePrompt {
21
+ /**
22
+ * A mapping of locale strings to their corresponding choice factory options.
23
+ *
24
+ * @remarks
25
+ * Each locale key maps to a `ChoiceFactoryOptions` object that defines the
26
+ * default behavior for rendering choices in that locale.
27
+ */
13
28
  [locale: string]: ChoiceFactoryOptions;
14
29
  }
15
30
 
@@ -17,12 +32,12 @@ export interface ChoiceDefaultsChoicePrompt {
17
32
  * Prompts a user to select from a list of choices.
18
33
  *
19
34
  * @remarks
20
- * By default the prompt will return to the calling dialog a `FoundChoice` object containing the
35
+ * By default the prompt will return to the calling dialog a {@link FoundChoice} object containing the
21
36
  * choice that was selected.
22
37
  */
23
38
  export class ChoicePrompt extends Prompt<FoundChoice> {
24
39
  /**
25
- * A dictionary of Default Choices based on [[PromptCultureModels.getSupportedCultures()]].
40
+ * A dictionary of Default Choices based on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures method}.
26
41
  * Can be replaced by user using the constructor that contains choiceDefaults.
27
42
  */
28
43
  private choiceDefaults: ChoiceDefaultsChoicePrompt
@@ -47,7 +62,7 @@ export class ChoicePrompt extends Prompt<FoundChoice> {
47
62
  choiceOptions: ChoiceFactoryOptions | undefined
48
63
 
49
64
  /**
50
- * Additional options passed to the underlying `recognizeChoices()` function.
65
+ * Additional options passed to the underlying {@link recognizeChoices | recognizeChoices function }.
51
66
  */
52
67
  recognizerOptions: FindChoicesOptions | undefined
53
68
 
@@ -23,7 +23,7 @@ export interface ChoiceDefaultsConfirmPrompt {
23
23
  */
24
24
  export class ConfirmPrompt extends Prompt<boolean> {
25
25
  /**
26
- * A dictionary of Default Choices based on [[PromptCultureModels.getSupportedCultures()]].
26
+ * A dictionary of Default Choices based on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures} method.
27
27
  * Can be replaced by user using the constructor that contains choiceDefaults.
28
28
  * This is initially set in the constructor.
29
29
  */
@@ -37,12 +37,12 @@ export class ConfirmPrompt extends Prompt<boolean> {
37
37
  * Style of the "yes" and "no" choices rendered to the user when prompting.
38
38
  *
39
39
  * @remarks
40
- * Defaults to `ListStyle.auto`.
40
+ * Defaults to {@link ListStyle.auto}.
41
41
  */
42
42
  style: ListStyle
43
43
 
44
44
  /**
45
- * Additional options passed to the `ChoiceFactory` and used to tweak the style of choices
45
+ * Additional options passed to the {@link ChoiceFactory } and used to tweak the style of choices
46
46
  * rendered to the user.
47
47
  */
48
48
  choiceOptions: ChoiceFactoryOptions | undefined
@@ -55,10 +55,10 @@ export class ConfirmPrompt extends Prompt<boolean> {
55
55
  /**
56
56
  * Creates a new ConfirmPrompt instance.
57
57
  *
58
- * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`.
58
+ * @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
59
59
  * @param validator (Optional) validator that will be called each time the user responds to the prompt.
60
- * @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
61
- * @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on [[PromptCultureModels.getSupportedCultures()]].
60
+ * @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
61
+ * @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures} method.
62
62
  */
63
63
  constructor (
64
64
  dialogId: string,
@@ -8,7 +8,7 @@ import { Prompt, PromptOptions, PromptRecognizerResult, PromptValidator } from '
8
8
  import { Activity, InputHints } from '@microsoft/agents-activity'
9
9
 
10
10
  /**
11
- * Result returned by the `DateTimePrompt`.
11
+ * Result returned by the {@link DateTimePrompt}.
12
12
  */
13
13
  export interface DateTimeResolution {
14
14
  /**
@@ -23,8 +23,8 @@ export interface DateTimeResolution {
23
23
  type: string;
24
24
 
25
25
  /**
26
- * Value of the specified [type](#type) that's a reasonable approximation given the ambiguity
27
- * of the [timex](#timex).
26
+ * Value of the specified `type` that's a reasonable approximation given the ambiguity
27
+ * of the `timex`.
28
28
  */
29
29
  value: string;
30
30
  }
@@ -33,7 +33,7 @@ export interface DateTimeResolution {
33
33
  * Prompts a user to enter a datetime expression.
34
34
  *
35
35
  * @remarks
36
- * By default the prompt will return to the calling dialog a `DateTimeResolution[]`.
36
+ * By default the prompt will return to the calling dialog a {@link DateTimeResolution | DateTimeResolution[] }.
37
37
  */
38
38
  export class DateTimePrompt extends Prompt<DateTimeResolution[]> {
39
39
  /**
@@ -44,9 +44,9 @@ export class DateTimePrompt extends Prompt<DateTimeResolution[]> {
44
44
  /**
45
45
  * Creates a new DateTimePrompt instance.
46
46
  *
47
- * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`.
47
+ * @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
48
48
  * @param validator (Optional) validator that will be called each time the user responds to the prompt.
49
- * @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
49
+ * @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
50
50
  */
51
51
  constructor (dialogId: string, validator?: PromptValidator<DateTimeResolution[]>, defaultLocale?: string) {
52
52
  super(dialogId, validator)
@@ -28,9 +28,9 @@ export class NumberPrompt extends Prompt<number> {
28
28
  /**
29
29
  * Creates a new NumberPrompt instance.
30
30
  *
31
- * @param dialogId Unique ID of the dialog within its parent `DialogSet` or `ComponentDialog`.
31
+ * @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
32
32
  * @param validator (Optional) validator that will be called each time the user responds to the prompt.
33
- * @param defaultLocale (Optional) locale to use if `TurnContext.activity.locale` is not specified. Defaults to a value of `en-us`.
33
+ * @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
34
34
  */
35
35
  constructor (dialogId: string, validator?: PromptValidator<number>, defaultLocale?: string) {
36
36
  super(dialogId, validator)
@@ -40,10 +40,10 @@ export class NumberPrompt extends Prompt<number> {
40
40
  /**
41
41
  * Prompts the user for input.
42
42
  *
43
- * @param context [TurnContext] context for the current
43
+ * @param context {@link TurnContext} context for the current
44
44
  * turn of conversation with the user.
45
45
  * @param state Contains state for the current instance of the prompt on the dialog stack.
46
- * @param options A [PromptOptions] object constructed
46
+ * @param options A {@link PromptOptions} object constructed
47
47
  * from the options initially provided in the call to Prompt.
48
48
  * @param isRetry `true` if this is the first time this prompt dialog instance
49
49
  * on the stack is prompting the user for input; otherwise, false.
@@ -65,10 +65,10 @@ export class NumberPrompt extends Prompt<number> {
65
65
  /**
66
66
  * Attempts to recognize the user's input.
67
67
  *
68
- * @param context [TurnContext], context for the current
68
+ * @param context {@link TurnContext}, context for the current
69
69
  * turn of conversation with the user.
70
70
  * @param _state Contains state for the current instance of the prompt on the dialog stack.
71
- * @param _options A [PromptOptions] object constructed
71
+ * @param _options A {@link PromptOptions} object constructed
72
72
  * from the options initially provided in the call to Prompt.
73
73
  * @returns A `Promise` representing the asynchronous operation.
74
74
  */