@microsoft/agents-hosting-dialogs 1.0.0 → 1.0.7-g73d3d58001

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 (109) hide show
  1. package/dist/src/agentStateSet.d.ts +30 -27
  2. package/dist/src/agentStateSet.js +30 -27
  3. package/dist/src/agentStateSet.js.map +1 -1
  4. package/dist/src/choices/findValues.d.ts +21 -12
  5. package/dist/src/choices/findValues.js +8 -5
  6. package/dist/src/choices/findValues.js.map +1 -1
  7. package/dist/src/componentDialog.d.ts +117 -95
  8. package/dist/src/componentDialog.js +106 -84
  9. package/dist/src/componentDialog.js.map +1 -1
  10. package/dist/src/dialog.d.ts +15 -10
  11. package/dist/src/dialog.js +15 -10
  12. package/dist/src/dialog.js.map +1 -1
  13. package/dist/src/dialogContainer.d.ts +5 -2
  14. package/dist/src/dialogContainer.js +5 -2
  15. package/dist/src/dialogContainer.js.map +1 -1
  16. package/dist/src/dialogContext.d.ts +33 -12
  17. package/dist/src/dialogContext.js +33 -13
  18. package/dist/src/dialogContext.js.map +1 -1
  19. package/dist/src/dialogInstance.d.ts +11 -11
  20. package/dist/src/dialogReason.d.ts +13 -13
  21. package/dist/src/dialogReason.js +13 -13
  22. package/dist/src/dialogReason.js.map +1 -1
  23. package/dist/src/dialogSet.d.ts +12 -7
  24. package/dist/src/dialogSet.js +10 -5
  25. package/dist/src/dialogSet.js.map +1 -1
  26. package/dist/src/dialogTurnResult.d.ts +1 -0
  27. package/dist/src/dialogTurnStateConstants.d.ts +1 -0
  28. package/dist/src/dialogTurnStateConstants.js +1 -0
  29. package/dist/src/dialogTurnStateConstants.js.map +1 -1
  30. package/dist/src/dialogTurnStatus.d.ts +1 -0
  31. package/dist/src/dialogTurnStatus.js +1 -0
  32. package/dist/src/dialogTurnStatus.js.map +1 -1
  33. package/dist/src/index.d.ts +1 -0
  34. package/dist/src/memory/dialogPath.d.ts +8 -8
  35. package/dist/src/memory/dialogPath.js +8 -8
  36. package/dist/src/memory/dialogStateManager.d.ts +9 -4
  37. package/dist/src/memory/dialogStateManager.js +9 -4
  38. package/dist/src/memory/dialogStateManager.js.map +1 -1
  39. package/dist/src/memory/turnPath.d.ts +12 -12
  40. package/dist/src/memory/turnPath.js +12 -12
  41. package/dist/src/prompts/activityPrompt.d.ts +4 -0
  42. package/dist/src/prompts/activityPrompt.js +4 -0
  43. package/dist/src/prompts/activityPrompt.js.map +1 -1
  44. package/dist/src/prompts/attachmentPrompt.d.ts +1 -0
  45. package/dist/src/prompts/attachmentPrompt.js +1 -0
  46. package/dist/src/prompts/attachmentPrompt.js.map +1 -1
  47. package/dist/src/prompts/choicePrompt.d.ts +4 -0
  48. package/dist/src/prompts/choicePrompt.js +1 -0
  49. package/dist/src/prompts/choicePrompt.js.map +1 -1
  50. package/dist/src/prompts/confirmPrompt.d.ts +4 -1
  51. package/dist/src/prompts/confirmPrompt.js +1 -0
  52. package/dist/src/prompts/confirmPrompt.js.map +1 -1
  53. package/dist/src/prompts/datetimePrompt.d.ts +1 -0
  54. package/dist/src/prompts/datetimePrompt.js +1 -0
  55. package/dist/src/prompts/datetimePrompt.js.map +1 -1
  56. package/dist/src/prompts/numberPrompt.d.ts +1 -0
  57. package/dist/src/prompts/numberPrompt.js +1 -0
  58. package/dist/src/prompts/numberPrompt.js.map +1 -1
  59. package/dist/src/prompts/prompt.d.ts +24 -8
  60. package/dist/src/prompts/prompt.js +8 -0
  61. package/dist/src/prompts/prompt.js.map +1 -1
  62. package/dist/src/prompts/promptCultureModels.d.ts +16 -1
  63. package/dist/src/prompts/promptCultureModels.js +4 -1
  64. package/dist/src/prompts/promptCultureModels.js.map +1 -1
  65. package/dist/src/prompts/textPrompt.d.ts +3 -0
  66. package/dist/src/prompts/textPrompt.js +3 -0
  67. package/dist/src/prompts/textPrompt.js.map +1 -1
  68. package/dist/src/recognizer.d.ts +3 -0
  69. package/dist/src/recognizer.js +1 -0
  70. package/dist/src/recognizer.js.map +1 -1
  71. package/dist/src/recognizerResult.d.ts +5 -4
  72. package/dist/src/recognizerResult.js +5 -4
  73. package/dist/src/recognizerResult.js.map +1 -1
  74. package/dist/src/stringUtils.d.ts +4 -3
  75. package/dist/src/stringUtils.js +4 -3
  76. package/dist/src/stringUtils.js.map +1 -1
  77. package/dist/src/waterfallDialog.d.ts +11 -4
  78. package/dist/src/waterfallDialog.js +11 -4
  79. package/dist/src/waterfallDialog.js.map +1 -1
  80. package/package.json +2 -2
  81. package/src/agentStateSet.ts +30 -27
  82. package/src/choices/findValues.ts +21 -12
  83. package/src/componentDialog.ts +127 -97
  84. package/src/dialog.ts +15 -10
  85. package/src/dialogContainer.ts +5 -2
  86. package/src/dialogContext.ts +41 -15
  87. package/src/dialogInstance.ts +11 -11
  88. package/src/dialogReason.ts +13 -13
  89. package/src/dialogSet.ts +12 -7
  90. package/src/dialogTurnResult.ts +1 -0
  91. package/src/dialogTurnStateConstants.ts +1 -0
  92. package/src/dialogTurnStatus.ts +1 -0
  93. package/src/index.ts +3 -0
  94. package/src/memory/dialogPath.ts +8 -8
  95. package/src/memory/dialogStateManager.ts +9 -4
  96. package/src/memory/turnPath.ts +12 -12
  97. package/src/prompts/activityPrompt.ts +4 -0
  98. package/src/prompts/attachmentPrompt.ts +1 -0
  99. package/src/prompts/choicePrompt.ts +4 -0
  100. package/src/prompts/confirmPrompt.ts +4 -1
  101. package/src/prompts/datetimePrompt.ts +1 -0
  102. package/src/prompts/numberPrompt.ts +1 -0
  103. package/src/prompts/prompt.ts +24 -8
  104. package/src/prompts/promptCultureModels.ts +16 -1
  105. package/src/prompts/textPrompt.ts +3 -0
  106. package/src/recognizer.ts +3 -0
  107. package/src/recognizerResult.ts +5 -4
  108. package/src/stringUtils.ts +4 -3
  109. package/src/waterfallDialog.ts +11 -4
@@ -11,22 +11,22 @@
11
11
  */
12
12
  export interface DialogInstance<T = any> {
13
13
  /**
14
- * ID of this dialog
15
- *
16
- * @remarks
17
- * Dialog state is associated with a specific dialog set.
18
- * This ID is the the dialog's Dialog.id within that dialog set.
19
- *
20
- */
14
+ * ID of this dialog
15
+ *
16
+ * @remarks
17
+ * Dialog state is associated with a specific dialog set.
18
+ * This ID is the the dialog's Dialog.id within that dialog set.
19
+ *
20
+ */
21
21
  id: string;
22
22
 
23
23
  /**
24
- * The state information for this instance of this dialog.
25
- */
24
+ * The state information for this instance of this dialog.
25
+ */
26
26
  state: T;
27
27
 
28
28
  /**
29
- * Hash code used to detect that a dialog has changed since the curent instance was started.
30
- */
29
+ * Hash code used to detect that a dialog has changed since the current instance was started.
30
+ */
31
31
  version?: string;
32
32
  }
@@ -8,33 +8,33 @@
8
8
  */
9
9
  export enum DialogReason {
10
10
  /**
11
- * The dialog is being started from DialogContext.beginDialog or DialogContext.replaceDialog.
12
- */
11
+ * The dialog is being started from DialogContext.beginDialog or DialogContext.replaceDialog.
12
+ */
13
13
  beginCalled = 'beginCalled',
14
14
 
15
15
  /**
16
- * The dialog is being continued from DialogContext.continueDialog.
17
- */
16
+ * The dialog is being continued from DialogContext.continueDialog.
17
+ */
18
18
  continueCalled = 'continueCalled',
19
19
 
20
20
  /**
21
- * The dialog is being ended from DialogContext.endDialog.
22
- */
21
+ * The dialog is being ended from DialogContext.endDialog.
22
+ */
23
23
  endCalled = 'endCalled',
24
24
 
25
25
  /**
26
- * The dialog is being ended from DialogContext.replaceDialog.
27
- */
26
+ * The dialog is being ended from DialogContext.replaceDialog.
27
+ */
28
28
  replaceCalled = 'replaceCalled',
29
29
 
30
30
  /**
31
- * The dialog is being cancelled from DialogContext.cancelAllDialogs.
32
- */
31
+ * The dialog is being cancelled from DialogContext.cancelAllDialogs.
32
+ */
33
33
  cancelCalled = 'cancelCalled',
34
34
 
35
35
  /**
36
- * A step in a WaterfallDialog is being called
37
- * because the previous step in the waterfall dialog called WaterfallStepContext.next.
38
- */
36
+ * A step in a WaterfallDialog is being called
37
+ * because the previous step in the waterfall dialog called WaterfallStepContext.next.
38
+ */
39
39
  nextCalled = 'nextCalled',
40
40
  }
package/src/dialogSet.ts CHANGED
@@ -12,7 +12,7 @@ import { DialogContext, DialogState } from './dialogContext'
12
12
  import { StringUtils } from './stringUtils'
13
13
 
14
14
  /**
15
- * @summary Interface for dialogs that have child dialog dependencies.
15
+ * Interface for dialogs that have child dialog dependencies.
16
16
  *
17
17
  * @remarks
18
18
  * Implement this interface on dialog classes that need to register child dialogs
@@ -38,7 +38,7 @@ import { StringUtils } from './stringUtils'
38
38
  */
39
39
  export interface DialogDependencies {
40
40
  /**
41
- * @summary Returns an array of child dialogs that this dialog depends on.
41
+ * Returns an array of child dialogs that this dialog depends on.
42
42
  *
43
43
  *
44
44
  * @remarks
@@ -64,7 +64,7 @@ export interface DialogDependencies {
64
64
  * persist the dialog stack for the set:
65
65
  *
66
66
  * To interact with the sets dialogs you can call `createcontext` with the
67
- * current {@link @microsoft/agents-hosting.TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
67
+ * current {@link TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
68
68
  * execution of the sets dialogs:
69
69
  *
70
70
  */
@@ -76,12 +76,13 @@ export class DialogSet {
76
76
  /**
77
77
  * Creates a new DialogSet instance.
78
78
  *
79
+ * @param dialogState (Optional) state property used to persist the sets dialog stack.
80
+ *
79
81
  * @remarks
80
82
  * If the `dialogState` parameter is not passed in, calls to `createContext`
81
83
  * will return an error. You will need to create a {@link DialogContext} for the set manually and
82
84
  * pass in your own state object for persisting the sets dialog stack:
83
85
  *
84
- * @param dialogState (Optional) state property used to persist the sets dialog stack.
85
86
  */
86
87
  constructor (dialogState?: AgentStatePropertyAccessor<DialogState>) {
87
88
  this.dialogState = dialogState
@@ -91,8 +92,10 @@ export class DialogSet {
91
92
  * Returns a 32-bit hash of the all the `Dialog.version` values in the set.
92
93
  *
93
94
  * @returns A version that will change when any of the child dialogs version changes.
95
+ *
94
96
  * @remarks
95
97
  * This hash is persisted to state storage and used to detect changes to a dialog set.
98
+ *
96
99
  */
97
100
  getVersion (): string {
98
101
  if (!this._version) {
@@ -112,14 +115,15 @@ export class DialogSet {
112
115
  /**
113
116
  * Adds a new dialog or prompt to the set.
114
117
  *
118
+ * @param dialog The dialog or prompt to add.
119
+ * If a telemetryClient is present on the dialog set, it will be added to each dialog.
120
+ * @returns The dialog set after the operation is complete.
121
+ *
115
122
  * @remarks
116
123
  * If the {@link Dialog.id} being added already exists in the set, the dialogs id will be updated to
117
124
  * include a suffix which makes it unique. So adding 2 dialogs named "duplicate" to the set
118
125
  * would result in the first one having an id of "duplicate" and the second one having an id
119
126
  * of "duplicate2".
120
- * @param dialog The dialog or prompt to add.
121
- * If a telemetryClient is present on the dialog set, it will be added to each dialog.
122
- * @returns The dialog set after the operation is complete.
123
127
  */
124
128
  add<T extends Dialog>(dialog: T): this {
125
129
  if (!(dialog instanceof Dialog)) {
@@ -184,6 +188,7 @@ export class DialogSet {
184
188
 
185
189
  /**
186
190
  * Finds a dialog that was previously added to the set using add.
191
+ *
187
192
  * @param dialogId ID of the dialog or prompt to lookup.
188
193
  * @returns The dialog if found; otherwise undefined.
189
194
  */
@@ -26,6 +26,7 @@ export interface DialogTurnResult<T = any> {
26
26
  * the stack is now empty,
27
27
  * the last dialog on the stack completed normally,
28
28
  * and the last dialog returned a result to the dialog context.
29
+ *
29
30
  */
30
31
  result?: T;
31
32
 
@@ -9,6 +9,7 @@
9
9
  * @remarks
10
10
  * These constants are used as keys to store and retrieve specific state information
11
11
  * during the execution of a dialog turn.
12
+ *
12
13
  */
13
14
  export class DialogTurnStateConstants {
14
15
  /**
@@ -9,6 +9,7 @@ export enum DialogTurnStatus {
9
9
  *
10
10
  * @remarks
11
11
  * Indicates that the dialog stack was initially empty when the operation was attempted.
12
+ *
12
13
  */
13
14
  empty = 'empty',
14
15
 
package/src/index.ts CHANGED
@@ -34,3 +34,6 @@ export * from './configuration'
34
34
  export * from './intentScore'
35
35
 
36
36
  export { runDialog } from './dialogHelper'
37
+
38
+ // Type-only re-export to avoid TypeDoc issues
39
+ export type { TurnContext } from '@microsoft/agents-hosting'
@@ -9,49 +9,49 @@
9
9
  export class DialogPath {
10
10
  /**
11
11
  * Counter of emitted events.
12
- * @constant A string key representing the event counter path (`'dialog.eventCounter'`).
12
+ * A string key representing the event counter path (`'dialog.eventCounter'`).
13
13
  */
14
14
  static readonly eventCounter: string = 'dialog.eventCounter'
15
15
 
16
16
  /**
17
17
  * Currently expected properties.
18
- * @constant A string key representing the expected properties path (`'dialog.expectedProperties'`).
18
+ * A string key representing the expected properties path (`'dialog.expectedProperties'`).
19
19
  */
20
20
  static readonly expectedProperties: string = 'dialog.expectedProperties'
21
21
 
22
22
  /**
23
23
  * Default operation to use for entities where there is no identified operation entity.
24
- * @constant A string key representing the default operation path (`'dialog.defaultOperation'`).
24
+ * A string key representing the default operation path (`'dialog.defaultOperation'`).
25
25
  */
26
26
  static readonly defaultOperation: string = 'dialog.defaultOperation'
27
27
 
28
28
  /**
29
29
  * Last surfaced entity ambiguity event.
30
- * @constant A string key representing the last event path (`'dialog.lastEvent'`).
30
+ * A string key representing the last event path (`'dialog.lastEvent'`).
31
31
  */
32
32
  static readonly lastEvent: string = 'dialog.lastEvent'
33
33
 
34
34
  /**
35
35
  * Currently required properties.
36
- * @constant A string key representing the required properties path (`'dialog.requiredProperties'`).
36
+ * A string key representing the required properties path (`'dialog.requiredProperties'`).
37
37
  */
38
38
  static readonly requiredProperties: string = 'dialog.requiredProperties'
39
39
 
40
40
  /**
41
41
  * Number of retries for the current Ask.
42
- * @constant A string key representing the retries path (`'dialog.retries'`).
42
+ * A string key representing the retries path (`'dialog.retries'`).
43
43
  */
44
44
  static readonly retries: string = 'dialog.retries'
45
45
 
46
46
  /**
47
47
  * Last intent.
48
- * @constant A string key representing the last intent path (`'dialog.lastIntent'`).
48
+ * A string key representing the last intent path (`'dialog.lastIntent'`).
49
49
  */
50
50
  static readonly lastIntent: string = 'dialog.lastIntent'
51
51
 
52
52
  /**
53
53
  * Last trigger event: defined in FormEvent, ask, clarifyEntity etc.
54
- * @constant A string key representing the last trigger event path (`'dialog.lastTriggerEvent'`).
54
+ * A string key representing the last trigger event path (`'dialog.lastTriggerEvent'`).
55
55
  */
56
56
  static readonly lastTriggerEvent: string = 'dialog.lastTriggerEvent'
57
57
  }
@@ -129,12 +129,14 @@ export class DialogStateManager {
129
129
  /**
130
130
  * Get the value from memory using path expression.
131
131
  *
132
- * @remarks
133
- * This always returns a CLONE of the memory, any modifications to the result will not affect memory.
134
132
  * @typeParam T The value type to return.
135
133
  * @param pathExpression Path expression to use.
136
134
  * @param defaultValue (Optional) default value to use if the path isn't found. May be a function that returns the default value to use.
137
135
  * @returns The found value or undefined if not found and no `defaultValue` specified.
136
+ *
137
+ * @remarks
138
+ * This always returns a CLONE of the memory, any modifications to the result will not affect memory.
139
+ *
138
140
  */
139
141
  getValue<T = any>(pathExpression: string, defaultValue?: T | (() => T)): T {
140
142
  function returnDefault (): T {
@@ -274,6 +276,7 @@ export class DialogStateManager {
274
276
  *
275
277
  * @remarks
276
278
  * This should be called at the beginning of the turn.
279
+ *
277
280
  */
278
281
  async loadAllScopes (): Promise<void> {
279
282
  const scopes = this.configuration.memoryScopes
@@ -287,6 +290,7 @@ export class DialogStateManager {
287
290
  *
288
291
  * @remarks
289
292
  * This should be called at the end of the turn.
293
+ *
290
294
  */
291
295
  async saveAllChanges (): Promise<void> {
292
296
  const scopes = this.configuration.memoryScopes
@@ -315,11 +319,12 @@ export class DialogStateManager {
315
319
  /**
316
320
  * Normalizes the path segments of a passed in path.
317
321
  *
318
- * @remarks
319
- * A path of `profile.address[0]` will be normalized to `profile.address.0`.
320
322
  * @param pathExpression The path to normalize.
321
323
  * @param allowNestedPaths Optional. If `false` then detection of a nested path will cause an empty path to be returned. Defaults to 'true'.
322
324
  * @returns The normalized path.
325
+ *
326
+ * @remarks
327
+ * A path of `profile.address[0]` will be normalized to `profile.address.0`.
323
328
  */
324
329
  parsePath (pathExpression: string, allowNestedPaths = true): (string | number)[] {
325
330
  // Expand path segments
@@ -9,73 +9,73 @@
9
9
  export class TurnPath {
10
10
  /**
11
11
  * The result from the last dialog that was called.
12
- * @constant A string key representing the last result path (`'turn.lastresult'`).
12
+ * A string key representing the last result path (`'turn.lastresult'`).
13
13
  */
14
14
  static readonly lastResult: string = 'turn.lastresult'
15
15
 
16
16
  /**
17
17
  * The current activity for the turn.
18
- * @constant A string key representing the activity path (`'turn.activity'`).
18
+ * A string key representing the activity path (`'turn.activity'`).
19
19
  */
20
20
  static readonly activity: string = 'turn.activity'
21
21
 
22
22
  /**
23
23
  * The recognized result for the current turn.
24
- * @constant A string key representing the recognized result path (`'turn.recognized'`).
24
+ * A string key representing the recognized result path (`'turn.recognized'`).
25
25
  */
26
26
  static readonly recognized: string = 'turn.recognized'
27
27
 
28
28
  /**
29
29
  * Path to the top intent.
30
- * @constant A string key representing the top intent path (`'turn.recognized.intent'`).
30
+ * A string key representing the top intent path (`'turn.recognized.intent'`).
31
31
  */
32
32
  static readonly topIntent: string = 'turn.recognized.intent'
33
33
 
34
34
  /**
35
35
  * Path to the top score.
36
- * @constant A string key representing the top score path (`'turn.recognized.score'`).
36
+ * A string key representing the top score path (`'turn.recognized.score'`).
37
37
  */
38
38
  static readonly topScore: string = 'turn.recognized.score'
39
39
 
40
40
  /**
41
41
  * Original text.
42
- * @constant A string key representing the original text path (`'turn.recognized.text'`).
42
+ * A string key representing the original text path (`'turn.recognized.text'`).
43
43
  */
44
44
  static readonly text: string = 'turn.recognized.text'
45
45
 
46
46
  /**
47
47
  * Original utterance split into unrecognized strings.
48
- * @constant A string key representing the unrecognized text path (`'turn.unrecognizedText'`).
48
+ * A string key representing the unrecognized text path (`'turn.unrecognizedText'`).
49
49
  */
50
50
  static readonly unrecognizedText: string = 'turn.unrecognizedText'
51
51
 
52
52
  /**
53
53
  * Entities that were recognized from text.
54
- * @constant A string key representing the recognized entities path (`'turn.recognizedEntities'`).
54
+ * A string key representing the recognized entities path (`'turn.recognizedEntities'`).
55
55
  */
56
56
  static readonly recognizedEntities: string = 'turn.recognizedEntities'
57
57
 
58
58
  /**
59
59
  * If true, an interruption has occurred.
60
- * @constant A string key representing the interrupted path (`'turn.interrupted'`).
60
+ * A string key representing the interrupted path (`'turn.interrupted'`).
61
61
  */
62
62
  static readonly interrupted: string = 'turn.interrupted'
63
63
 
64
64
  /**
65
65
  * The current dialog event (set during event processing).
66
- * @constant A string key representing the dialog event path (`'turn.dialogEvent'`).
66
+ * A string key representing the dialog event path (`'turn.dialogEvent'`).
67
67
  */
68
68
  static readonly dialogEvent: string = 'turn.dialogEvent'
69
69
 
70
70
  /**
71
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'`).
72
+ * A string key representing the repeated IDs path (`'turn.repeatedIds'`).
73
73
  */
74
74
  static readonly repeatedIds: string = 'turn.repeatedIds'
75
75
 
76
76
  /**
77
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'`).
78
+ * A string key representing the activity processed path (`'turn.activityProcessed'`).
79
79
  */
80
80
  static readonly activityProcessed: string = 'turn.activityProcessed'
81
81
  }
@@ -41,9 +41,11 @@ export class ActivityPrompt extends Dialog {
41
41
  * @param options PromptOptions, additional
42
42
  * information to pass to the prompt being started.
43
43
  * @returns A `Promise` representing the asynchronous operation.
44
+ *
44
45
  * @remarks
45
46
  * If the promise is successful, the result indicates whether the prompt is still
46
47
  * active after the turn has been processed by the prompt.
48
+ *
47
49
  */
48
50
  async beginDialog (dialogContext: DialogContext, options: PromptOptions): Promise<DialogTurnResult> {
49
51
  // Ensure prompts have input hint set
@@ -72,11 +74,13 @@ export class ActivityPrompt extends Dialog {
72
74
  * @param dialogContext The DialogContext for the current
73
75
  * turn of conversation.
74
76
  * @returns A `Promise` representing the asynchronous operation.
77
+ *
75
78
  * @remarks
76
79
  * If the promise is successful, the result indicates whether the dialog is still
77
80
  * active after the turn has been processed by the dialog.
78
81
  * The prompt generally continues to receive the user's replies until it accepts the
79
82
  * user's reply as valid input for the prompt.
83
+ *
80
84
  */
81
85
  async continueDialog (dialogContext: DialogContext): Promise<DialogTurnResult> {
82
86
  // Perform base recognition
@@ -11,6 +11,7 @@ import { Attachment, InputHints } from '@microsoft/agents-activity'
11
11
  *
12
12
  * @remarks
13
13
  * By default the prompt will return to the calling dialog an `Attachment[]`.
14
+ *
14
15
  */
15
16
  export class AttachmentPrompt extends Prompt<Attachment[]> {
16
17
  // eslint-disable-next-line @typescript-eslint/no-useless-constructor
@@ -16,6 +16,7 @@ import { Activity } from '@microsoft/agents-activity'
16
16
  * @remarks
17
17
  * This interface is used to define the default options for rendering choices in prompts,
18
18
  * such as separators, inline options, and whether to include numbers.
19
+ *
19
20
  */
20
21
  export interface ChoiceDefaultsChoicePrompt {
21
22
  /**
@@ -24,6 +25,7 @@ export interface ChoiceDefaultsChoicePrompt {
24
25
  * @remarks
25
26
  * Each locale key maps to a `ChoiceFactoryOptions` object that defines the
26
27
  * default behavior for rendering choices in that locale.
28
+ *
27
29
  */
28
30
  [locale: string]: ChoiceFactoryOptions;
29
31
  }
@@ -34,6 +36,7 @@ export interface ChoiceDefaultsChoicePrompt {
34
36
  * @remarks
35
37
  * By default the prompt will return to the calling dialog a {@link FoundChoice} object containing the
36
38
  * choice that was selected.
39
+ *
37
40
  */
38
41
  export class ChoicePrompt extends Prompt<FoundChoice> {
39
42
  /**
@@ -52,6 +55,7 @@ export class ChoicePrompt extends Prompt<FoundChoice> {
52
55
  *
53
56
  * @remarks
54
57
  * Defaults to `ListStyle.auto`.
58
+ *
55
59
  */
56
60
  style: ListStyle
57
61
 
@@ -10,7 +10,7 @@ import { PromptCultureModels } from './promptCultureModels'
10
10
  import { Activity } from '@microsoft/agents-activity'
11
11
 
12
12
  /**
13
- * @summary Defines locale-specific choice defaults for confirmation prompts.
13
+ * Defines locale-specific choice defaults for confirmation prompts.
14
14
  *
15
15
  * @remarks
16
16
  * This interface represents a dictionary that maps locale strings to their corresponding
@@ -50,6 +50,7 @@ export interface ChoiceDefaultsConfirmPrompt {
50
50
  * @remarks
51
51
  * The key is a locale string (e.g., 'en-us', 'fr-fr', 'de-de') and the value
52
52
  * contains the localized choices and formatting options for that locale.
53
+ *
53
54
  */
54
55
  [locale: string]: {
55
56
  /**
@@ -71,6 +72,7 @@ export interface ChoiceDefaultsConfirmPrompt {
71
72
  * @remarks
72
73
  * By default the prompt will return to the calling dialog a `boolean` representing the users
73
74
  * selection.
75
+ *
74
76
  */
75
77
  export class ConfirmPrompt extends Prompt<boolean> {
76
78
  /**
@@ -89,6 +91,7 @@ export class ConfirmPrompt extends Prompt<boolean> {
89
91
  *
90
92
  * @remarks
91
93
  * Defaults to {@link ListStyle.auto}.
94
+ *
92
95
  */
93
96
  style: ListStyle
94
97
 
@@ -34,6 +34,7 @@ export interface DateTimeResolution {
34
34
  *
35
35
  * @remarks
36
36
  * By default the prompt will return to the calling dialog a {@link DateTimeResolution | DateTimeResolution[] }.
37
+ *
37
38
  */
38
39
  export class DateTimePrompt extends Prompt<DateTimeResolution[]> {
39
40
  /**
@@ -18,6 +18,7 @@ Object.values(locales).forEach((locale) => Globalize.load(locale))
18
18
  *
19
19
  * @remarks
20
20
  * By default the prompt will return to the calling dialog a `number` representing the users input.
21
+ *
21
22
  */
22
23
  export class NumberPrompt extends Prompt<number> {
23
24
  /**
@@ -103,7 +103,10 @@ export interface PromptRecognizerResult<T> {
103
103
  }
104
104
 
105
105
  /**
106
- * @summary Function signature for providing a custom prompt validator.
106
+ * Function signature for providing a custom prompt validator.
107
+ *
108
+ * @param T Type of recognizer result being validated.
109
+ * @param prompt Contextual information containing the recognizer result and original options passed to the prompt.
107
110
  *
108
111
  * @remarks
109
112
  * The validator should be an asynchronous function that returns `true` if
@@ -118,8 +121,7 @@ export interface PromptRecognizerResult<T> {
118
121
  * ```typescript
119
122
  * type PromptValidator<T> = (prompt: PromptValidatorContext<T>) => Promise<boolean>;
120
123
  * ```
121
- * @param T Type of recognizer result being validated.
122
- * @param prompt Contextual information containing the recognizer result and original options passed to the prompt.
124
+ *
123
125
  */
124
126
  export type PromptValidator<T> = (prompt: PromptValidatorContext<T>) => Promise<boolean>
125
127
 
@@ -134,6 +136,7 @@ export interface PromptValidatorContext<T> {
134
136
  *
135
137
  * @remarks
136
138
  * The validator can use this to re-prompt the user.
139
+ *
137
140
  */
138
141
  readonly context: TurnContext;
139
142
 
@@ -141,8 +144,9 @@ export interface PromptValidatorContext<T> {
141
144
  * Result returned from the prompts recognizer function.
142
145
  *
143
146
  * @remarks
144
- * The {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.succeeded | recognized.succeeded} field can be checked to determine of the recognizer found
145
- * anything and then the value can be retrieved from {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.value | recognized.value}.
147
+ * The {@link PromptRecognizerResult.succeeded | recognized.succeeded} field can be checked to determine of the recognizer found
148
+ * anything and then the value can be retrieved from {@link PromptRecognizerResult.value | recognized.value}.
149
+ *
146
150
  */
147
151
  readonly recognized: PromptRecognizerResult<T>;
148
152
 
@@ -151,6 +155,7 @@ export interface PromptValidatorContext<T> {
151
155
  *
152
156
  * @remarks
153
157
  * The validator can use this to persist things like turn counts or other state information.
158
+ *
154
159
  */
155
160
  readonly state: object;
156
161
 
@@ -159,6 +164,7 @@ export interface PromptValidatorContext<T> {
159
164
  *
160
165
  * @remarks
161
166
  * The validator can extend this interface to support additional prompt options.
167
+ *
162
168
  */
163
169
  readonly options: PromptOptions;
164
170
 
@@ -166,6 +172,7 @@ export interface PromptValidatorContext<T> {
166
172
  * A count of the number of times the prompt has been executed.
167
173
  *
168
174
  * A number indicating how many times the prompt was invoked (starting at 1 for the first time it was invoked).
175
+ *
169
176
  */
170
177
  readonly attemptCount: number;
171
178
  }
@@ -197,9 +204,11 @@ export abstract class Prompt<T> extends Dialog {
197
204
  * @param options Optional. PromptOptions,
198
205
  * additional information to pass to the prompt being started.
199
206
  * @returns A `Promise` representing the asynchronous operation.
207
+ *
200
208
  * @remarks
201
209
  * If the task is successful, the result indicates whether the prompt is still
202
210
  * active after the turn has been processed by the prompt.
211
+ *
203
212
  */
204
213
  async beginDialog (dialogContext: DialogContext, options: PromptOptions): Promise<DialogTurnResult> {
205
214
  // Ensure prompts have input hint set
@@ -227,11 +236,13 @@ export abstract class Prompt<T> extends Dialog {
227
236
  *
228
237
  * @param dialogContext The DialogContext for the current turn of conversation.
229
238
  * @returns A `Promise` representing the asynchronous operation.
239
+ *
230
240
  * @remarks
231
241
  * If the task is successful, the result indicates whether the dialog is still
232
242
  * active after the turn has been processed by the dialog.
233
243
  * The prompt generally continues to receive the user's replies until it accepts the
234
244
  * user's reply as valid input for the prompt.
245
+ *
235
246
  */
236
247
  async continueDialog (dialogContext: DialogContext): Promise<DialogTurnResult> {
237
248
  // Don't do anything for non-message activities
@@ -288,10 +299,12 @@ export abstract class Prompt<T> extends Dialog {
288
299
  * @param dialogContext The DialogContext for the current turn of conversation.
289
300
  * @param event DialogEvent, the event being raised.
290
301
  * @returns Whether the event is handled by the current dialog and further processing should stop.
302
+ *
291
303
  * @remarks
292
304
  * This is a good place to perform interception of an event as returning `true` will prevent
293
305
  * any further bubbling of the event to the dialogs parents and will also prevent any child
294
306
  * dialogs from performing their default processing.
307
+ *
295
308
  */
296
309
  protected async onPreBubbleEvent (dialogContext: DialogContext, event: DialogEvent): Promise<boolean> {
297
310
  if (event.name === 'activityReceived' && dialogContext.context.activity.type === ActivityTypes.Message) {
@@ -317,9 +330,11 @@ export abstract class Prompt<T> extends Dialog {
317
330
  * @param _result Optional, value returned from the previous dialog on the stack.
318
331
  * The type of the value returned is dependent on the previous dialog.
319
332
  * @returns A Promise representing the asynchronous operation.
333
+ *
320
334
  * @remarks
321
335
  * If the task is successful, the result indicates whether the dialog is still
322
336
  * active after the turn has been processed by the dialog.
337
+ *
323
338
  */
324
339
  async resumeDialog (dialogContext: DialogContext, _reason: DialogReason, _result?: any): Promise<DialogTurnResult> {
325
340
  // Prompts are typically leaf nodes on the stack but the dev is free to push other dialogs
@@ -364,12 +379,13 @@ export abstract class Prompt<T> extends Dialog {
364
379
  /**
365
380
  * Called to recognize an utterance received from the user.
366
381
  *
367
- * @remarks
368
- * The Prompt class filters out non-message activities so its safe to assume that the users
369
- * utterance can be retrieved from `context.activity.text`.
370
382
  * @param context Context for the current turn of conversation with the user.
371
383
  * @param state Additional state being persisted for the prompt.
372
384
  * @param options Options that the prompt was started with in the call to `DialogContext.prompt()`.
385
+ *
386
+ * @remarks
387
+ * The Prompt class filters out non-message activities so its safe to assume that the users
388
+ * utterance can be retrieved from `context.activity.text`.
373
389
  */
374
390
  protected abstract onRecognize (
375
391
  context: TurnContext,