@microsoft/agents-hosting-dialogs 0.3.5 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/dialogContext.d.ts +12 -12
- package/dist/src/dialogContext.js +7 -7
- package/dist/src/dialogSet.d.ts +3 -3
- package/dist/src/dialogSet.js +3 -3
- package/dist/src/prompts/attachmentPrompt.d.ts +1 -1
- package/dist/src/prompts/attachmentPrompt.js +1 -1
- package/dist/src/prompts/confirmPrompt.d.ts +1 -1
- package/dist/src/prompts/confirmPrompt.js +1 -1
- package/dist/src/prompts/datetimePrompt.d.ts +1 -1
- package/dist/src/prompts/datetimePrompt.js +1 -1
- package/dist/src/prompts/numberPrompt.d.ts +1 -1
- package/dist/src/prompts/numberPrompt.js +1 -1
- package/dist/src/prompts/prompt.d.ts +2 -2
- package/package.json +2 -2
- package/src/dialogContext.ts +18 -18
- package/src/dialogSet.ts +3 -3
- package/src/prompts/attachmentPrompt.ts +1 -1
- package/src/prompts/confirmPrompt.ts +1 -1
- package/src/prompts/datetimePrompt.ts +1 -1
- package/src/prompts/numberPrompt.ts +1 -1
- package/src/prompts/prompt.ts +2 -2
|
@@ -16,7 +16,7 @@ import { Activity } from '@microsoft/agents-activity';
|
|
|
16
16
|
* Contains dialog state, information about the state of the dialog stack, for a specific {@link DialogSet}.
|
|
17
17
|
*
|
|
18
18
|
* @remarks
|
|
19
|
-
* State is read from and saved to storage each turn, and state cache for the turn is managed through the {@link TurnContext}.
|
|
19
|
+
* State is read from and saved to storage each turn, and state cache for the turn is managed through the {@link @microsoft/agents-hosting.TurnContext}.
|
|
20
20
|
*
|
|
21
21
|
* For more information, see the articles on
|
|
22
22
|
* [Managing state](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-state) and
|
|
@@ -44,21 +44,21 @@ export declare class DialogContext {
|
|
|
44
44
|
/**
|
|
45
45
|
* Creates an new instance of the DialogContext class.
|
|
46
46
|
*
|
|
47
|
-
* @param dialogs The
|
|
48
|
-
* @param contextOrDialogContext The
|
|
49
|
-
* @param state The state object to use to read and write
|
|
47
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
48
|
+
* @param contextOrDialogContext The `TurnContext` object for the current turn.
|
|
49
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
50
50
|
* @remarks
|
|
51
|
-
* Passing in a DialogContext instance will clone the dialog context.
|
|
51
|
+
* Passing in a `DialogContext` instance will clone the dialog context.
|
|
52
52
|
*/
|
|
53
53
|
constructor(dialogs: DialogSet, contextOrDialogContext: TurnContext, state: DialogState);
|
|
54
54
|
/**
|
|
55
55
|
* Creates an new instance of the DialogContext class.
|
|
56
56
|
*
|
|
57
|
-
* @param dialogs The
|
|
58
|
-
* @param contextOrDialogContext The
|
|
59
|
-
* @param state The state object to use to read and write
|
|
57
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
58
|
+
* @param contextOrDialogContext The `DialogContext` object for the current turn.
|
|
59
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
60
60
|
* @remarks
|
|
61
|
-
* Passing in a DialogContext instance will clone the dialog context.
|
|
61
|
+
* Passing in a `DialogContext` instance will clone the dialog context.
|
|
62
62
|
*/
|
|
63
63
|
constructor(dialogs: DialogSet, contextOrDialogContext: DialogContext, state: DialogState);
|
|
64
64
|
/**
|
|
@@ -77,7 +77,7 @@ export declare class DialogContext {
|
|
|
77
77
|
* The parent dialog context for this dialog context, or `undefined` if this context doesn't have a parent.
|
|
78
78
|
*
|
|
79
79
|
* @remarks
|
|
80
|
-
* When it attempts to start a dialog, the dialog context searches for the Dialog.id
|
|
80
|
+
* When it attempts to start a dialog, the dialog context searches for the {@link Dialog.id}
|
|
81
81
|
* in its {@link DialogContext.dialogs}. If the dialog to start is not found
|
|
82
82
|
* in this dialog context, it searches in its parent dialog context, and so on.
|
|
83
83
|
*/
|
|
@@ -175,7 +175,7 @@ export declare class DialogContext {
|
|
|
175
175
|
*
|
|
176
176
|
* @param dialogId ID of the prompt dialog to start.
|
|
177
177
|
* @param promptOrOptions The text of the initial prompt to send the user,
|
|
178
|
-
* the {@link Activity} to send as the initial prompt, or
|
|
178
|
+
* the {@link @microsoft/agents-activity.Activity} to send as the initial prompt, or
|
|
179
179
|
* the object with which to format the prompt dialog.
|
|
180
180
|
* @param choices Optional. Array of choices for the user to choose from,
|
|
181
181
|
* for use with a {@link ChoicePrompt}.
|
|
@@ -191,7 +191,7 @@ export declare class DialogContext {
|
|
|
191
191
|
*
|
|
192
192
|
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result.
|
|
193
193
|
* @remarks
|
|
194
|
-
* After the call completes, you can check the turn context's {@link TurnContext.responded}
|
|
194
|
+
* After the call completes, you can check the turn context's {@link @microsoft/agents-hosting.TurnContext.responded | TurnContext.responded}
|
|
195
195
|
* property to determine if the dialog sent a reply to the user.
|
|
196
196
|
*
|
|
197
197
|
* The {@link DialogTurnResult.status} of returned object describes
|
|
@@ -51,12 +51,12 @@ const ACTIVITY_RECEIVED_EMITTED = Symbol('ActivityReceivedEmitted');
|
|
|
51
51
|
*/
|
|
52
52
|
class DialogContext {
|
|
53
53
|
/**
|
|
54
|
-
* Creates an new instance of the DialogContext class.
|
|
54
|
+
* Creates an new instance of the `DialogContext` class.
|
|
55
55
|
*
|
|
56
|
-
* @param dialogs The
|
|
57
|
-
* @param contextOrDialogContext The
|
|
58
|
-
* @param state The state object to use to read and write
|
|
59
|
-
* @remarks Passing in a DialogContext instance will clone the dialog context.
|
|
56
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
57
|
+
* @param contextOrDialogContext The `TurnContext` or `DialogContext` for the current turn.
|
|
58
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
59
|
+
* @remarks Passing in a `DialogContext` instance will clone the dialog context.
|
|
60
60
|
*/
|
|
61
61
|
constructor(dialogs, contextOrDialogContext, state) {
|
|
62
62
|
/**
|
|
@@ -229,7 +229,7 @@ class DialogContext {
|
|
|
229
229
|
*
|
|
230
230
|
* @param dialogId ID of the prompt dialog to start.
|
|
231
231
|
* @param promptOrOptions The text of the initial prompt to send the user,
|
|
232
|
-
* or the {@link Activity} to send as the initial prompt.
|
|
232
|
+
* or the {@link @microsoft/agents-activity.Activity} to send as the initial prompt.
|
|
233
233
|
* @param choices Optional. Array of choices for the user to choose from,
|
|
234
234
|
* for use with a {@link ChoicePrompt}.
|
|
235
235
|
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result.
|
|
@@ -257,7 +257,7 @@ class DialogContext {
|
|
|
257
257
|
*
|
|
258
258
|
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result.
|
|
259
259
|
* @remarks
|
|
260
|
-
* After the call completes, you can check the turn context's {@link TurnContext.responded}
|
|
260
|
+
* After the call completes, you can check the turn context's {@link @microsoft/agents-hosting.TurnContext.responded | TurnContext.responded}
|
|
261
261
|
* property to determine if the dialog sent a reply to the user.
|
|
262
262
|
*
|
|
263
263
|
* The {@link DialogTurnResult.status} of returned object describes
|
package/dist/src/dialogSet.d.ts
CHANGED
|
@@ -18,8 +18,8 @@ export interface DialogDependencies {
|
|
|
18
18
|
* The constructor for the dialog set should be passed a state property that will be used to
|
|
19
19
|
* persist the dialog stack for the set:
|
|
20
20
|
*
|
|
21
|
-
* To interact with the sets dialogs you can call createcontext with the
|
|
22
|
-
* current {@link TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
21
|
+
* To interact with the sets dialogs you can call `createcontext` with the
|
|
22
|
+
* current {@link @microsoft/agents-hosting.TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
23
23
|
* execution of the sets dialogs:
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
@@ -31,7 +31,7 @@ export declare class DialogSet {
|
|
|
31
31
|
* Creates a new DialogSet instance.
|
|
32
32
|
*
|
|
33
33
|
* @remarks
|
|
34
|
-
* If the `dialogState` parameter is not passed in, calls to {@link DialogSet.createcontext |createContext}
|
|
34
|
+
* If the `dialogState` parameter is not passed in, calls to {@link @microsoft/agents-hosting-dialogs.DialogSet.createcontext | createContext}
|
|
35
35
|
* will return an error. You will need to create a {@link DialogContext} for the set manually and
|
|
36
36
|
* pass in your own state object for persisting the sets dialog stack:
|
|
37
37
|
*
|
package/dist/src/dialogSet.js
CHANGED
|
@@ -11,8 +11,8 @@ const stringUtils_1 = require("./stringUtils");
|
|
|
11
11
|
* The constructor for the dialog set should be passed a state property that will be used to
|
|
12
12
|
* persist the dialog stack for the set:
|
|
13
13
|
*
|
|
14
|
-
* To interact with the sets dialogs you can call createcontext with the
|
|
15
|
-
* current {@link TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
14
|
+
* To interact with the sets dialogs you can call `createcontext` with the
|
|
15
|
+
* current {@link @microsoft/agents-hosting.TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
16
16
|
* execution of the sets dialogs:
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
@@ -21,7 +21,7 @@ class DialogSet {
|
|
|
21
21
|
* Creates a new DialogSet instance.
|
|
22
22
|
*
|
|
23
23
|
* @remarks
|
|
24
|
-
* If the `dialogState` parameter is not passed in, calls to {@link DialogSet.createcontext |createContext}
|
|
24
|
+
* If the `dialogState` parameter is not passed in, calls to {@link @microsoft/agents-hosting-dialogs.DialogSet.createcontext | createContext}
|
|
25
25
|
* will return an error. You will need to create a {@link DialogContext} for the set manually and
|
|
26
26
|
* pass in your own state object for persisting the sets dialog stack:
|
|
27
27
|
*
|
|
@@ -9,7 +9,7 @@ import { Attachment } from '@microsoft/agents-activity';
|
|
|
9
9
|
* Prompts a user to upload attachments like images.
|
|
10
10
|
*
|
|
11
11
|
* @remarks
|
|
12
|
-
* By default the prompt will return to the calling dialog an {@link Attachment[]}.
|
|
12
|
+
* By default the prompt will return to the calling dialog an {@link Attachment | Attachment[]}.
|
|
13
13
|
*/
|
|
14
14
|
export declare class AttachmentPrompt extends Prompt<Attachment[]> {
|
|
15
15
|
constructor(dialogId: string, validator?: PromptValidator<Attachment[]>);
|
|
@@ -7,7 +7,7 @@ const agents_activity_1 = require("@microsoft/agents-activity");
|
|
|
7
7
|
* Prompts a user to upload attachments like images.
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
|
-
* By default the prompt will return to the calling dialog an {@link Attachment[]}.
|
|
10
|
+
* By default the prompt will return to the calling dialog an {@link Attachment | Attachment[]}.
|
|
11
11
|
*/
|
|
12
12
|
class AttachmentPrompt extends prompt_1.Prompt {
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -46,7 +46,7 @@ export declare class ConfirmPrompt extends Prompt<boolean> {
|
|
|
46
46
|
*
|
|
47
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 {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
49
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
50
50
|
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures} method.
|
|
51
51
|
*/
|
|
52
52
|
constructor(dialogId: string, validator?: PromptValidator<boolean>, defaultLocale?: string, choiceDefaults?: ChoiceDefaultsConfirmPrompt);
|
|
@@ -55,7 +55,7 @@ class ConfirmPrompt extends prompt_1.Prompt {
|
|
|
55
55
|
*
|
|
56
56
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
57
57
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
58
|
-
* @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
58
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
59
59
|
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures} method.
|
|
60
60
|
*/
|
|
61
61
|
constructor(dialogId, validator, defaultLocale, choiceDefaults) {
|
|
@@ -35,7 +35,7 @@ export declare class DateTimePrompt extends Prompt<DateTimeResolution[]> {
|
|
|
35
35
|
*
|
|
36
36
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
37
37
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
38
|
-
* @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
38
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
39
39
|
*/
|
|
40
40
|
constructor(dialogId: string, validator?: PromptValidator<DateTimeResolution[]>, defaultLocale?: string);
|
|
41
41
|
/**
|
|
@@ -53,7 +53,7 @@ class DateTimePrompt extends prompt_1.Prompt {
|
|
|
53
53
|
*
|
|
54
54
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
55
55
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
56
|
-
* @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
56
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
57
57
|
*/
|
|
58
58
|
constructor(dialogId, validator, defaultLocale) {
|
|
59
59
|
super(dialogId, validator);
|
|
@@ -20,7 +20,7 @@ export declare class NumberPrompt extends Prompt<number> {
|
|
|
20
20
|
*
|
|
21
21
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
22
22
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
23
|
-
* @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
23
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
24
24
|
*/
|
|
25
25
|
constructor(dialogId: string, validator?: PromptValidator<number>, defaultLocale?: string);
|
|
26
26
|
/**
|
|
@@ -60,7 +60,7 @@ class NumberPrompt extends prompt_1.Prompt {
|
|
|
60
60
|
*
|
|
61
61
|
* @param dialogId Unique ID of the dialog within its parent {@link DialogSet} or {@link ComponentDialog}.
|
|
62
62
|
* @param validator (Optional) validator that will be called each time the user responds to the prompt.
|
|
63
|
-
* @param defaultLocale (Optional) locale to use if {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
63
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
64
64
|
*/
|
|
65
65
|
constructor(dialogId, validator, defaultLocale) {
|
|
66
66
|
super(dialogId, validator);
|
|
@@ -123,8 +123,8 @@ export interface PromptValidatorContext<T> {
|
|
|
123
123
|
* Result returned from the prompts recognizer function.
|
|
124
124
|
*
|
|
125
125
|
* @remarks
|
|
126
|
-
* The {@link
|
|
127
|
-
* anything and then the value can be retrieved from {@link
|
|
126
|
+
* The {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.succeeded | recognized.succeeded} field can be checked to determine of the recognizer found
|
|
127
|
+
* anything and then the value can be retrieved from {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.value | recognized.value}.
|
|
128
128
|
*/
|
|
129
129
|
readonly recognized: PromptRecognizerResult<T>;
|
|
130
130
|
/**
|
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.3
|
|
4
|
+
"version": "0.4.3",
|
|
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.3
|
|
19
|
+
"@microsoft/agents-hosting": "0.4.3",
|
|
20
20
|
"@types/lodash": "^4.17.16",
|
|
21
21
|
"dependency-graph": "^1.0.0",
|
|
22
22
|
"@microsoft/recognizers-text-suite": "^1.3.1",
|
package/src/dialogContext.ts
CHANGED
|
@@ -48,7 +48,7 @@ const ACTIVITY_RECEIVED_EMITTED = Symbol('ActivityReceivedEmitted')
|
|
|
48
48
|
* Contains dialog state, information about the state of the dialog stack, for a specific {@link DialogSet}.
|
|
49
49
|
*
|
|
50
50
|
* @remarks
|
|
51
|
-
* State is read from and saved to storage each turn, and state cache for the turn is managed through the {@link TurnContext}.
|
|
51
|
+
* State is read from and saved to storage each turn, and state cache for the turn is managed through the {@link @microsoft/agents-hosting.TurnContext}.
|
|
52
52
|
*
|
|
53
53
|
* For more information, see the articles on
|
|
54
54
|
* [Managing state](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-state) and
|
|
@@ -77,32 +77,32 @@ export class DialogContext {
|
|
|
77
77
|
/**
|
|
78
78
|
* Creates an new instance of the DialogContext class.
|
|
79
79
|
*
|
|
80
|
-
* @param dialogs The
|
|
81
|
-
* @param contextOrDialogContext The
|
|
82
|
-
* @param state The state object to use to read and write
|
|
80
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
81
|
+
* @param contextOrDialogContext The `TurnContext` object for the current turn.
|
|
82
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
83
83
|
* @remarks
|
|
84
|
-
* Passing in a DialogContext instance will clone the dialog context.
|
|
84
|
+
* Passing in a `DialogContext` instance will clone the dialog context.
|
|
85
85
|
*/
|
|
86
86
|
constructor (dialogs: DialogSet, contextOrDialogContext: TurnContext, state: DialogState)
|
|
87
87
|
|
|
88
88
|
/**
|
|
89
89
|
* Creates an new instance of the DialogContext class.
|
|
90
90
|
*
|
|
91
|
-
* @param dialogs The
|
|
92
|
-
* @param contextOrDialogContext The
|
|
93
|
-
* @param state The state object to use to read and write
|
|
91
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
92
|
+
* @param contextOrDialogContext The `DialogContext` object for the current turn.
|
|
93
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
94
94
|
* @remarks
|
|
95
|
-
* Passing in a DialogContext instance will clone the dialog context.
|
|
95
|
+
* Passing in a `DialogContext` instance will clone the dialog context.
|
|
96
96
|
*/
|
|
97
97
|
constructor (dialogs: DialogSet, contextOrDialogContext: DialogContext, state: DialogState)
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
* Creates an new instance of the DialogContext class.
|
|
100
|
+
* Creates an new instance of the `DialogContext` class.
|
|
101
101
|
*
|
|
102
|
-
* @param dialogs The
|
|
103
|
-
* @param contextOrDialogContext The
|
|
104
|
-
* @param state The state object to use to read and write
|
|
105
|
-
* @remarks Passing in a DialogContext instance will clone the dialog context.
|
|
102
|
+
* @param dialogs The `DialogSet` for which to create the dialog context.
|
|
103
|
+
* @param contextOrDialogContext The `TurnContext` or `DialogContext` for the current turn.
|
|
104
|
+
* @param state The state object to use to read and write `DialogState` to storage.
|
|
105
|
+
* @remarks Passing in a `DialogContext` instance will clone the dialog context.
|
|
106
106
|
*/
|
|
107
107
|
constructor (dialogs: DialogSet, contextOrDialogContext: TurnContext | DialogContext, state: DialogState) {
|
|
108
108
|
this.dialogs = dialogs
|
|
@@ -144,7 +144,7 @@ export class DialogContext {
|
|
|
144
144
|
* The parent dialog context for this dialog context, or `undefined` if this context doesn't have a parent.
|
|
145
145
|
*
|
|
146
146
|
* @remarks
|
|
147
|
-
* When it attempts to start a dialog, the dialog context searches for the Dialog.id
|
|
147
|
+
* When it attempts to start a dialog, the dialog context searches for the {@link Dialog.id}
|
|
148
148
|
* in its {@link DialogContext.dialogs}. If the dialog to start is not found
|
|
149
149
|
* in this dialog context, it searches in its parent dialog context, and so on.
|
|
150
150
|
*/
|
|
@@ -341,7 +341,7 @@ export class DialogContext {
|
|
|
341
341
|
*
|
|
342
342
|
* @param dialogId ID of the prompt dialog to start.
|
|
343
343
|
* @param promptOrOptions The text of the initial prompt to send the user,
|
|
344
|
-
* the {@link Activity} to send as the initial prompt, or
|
|
344
|
+
* the {@link @microsoft/agents-activity.Activity} to send as the initial prompt, or
|
|
345
345
|
* the object with which to format the prompt dialog.
|
|
346
346
|
* @param choices Optional. Array of choices for the user to choose from,
|
|
347
347
|
* for use with a {@link ChoicePrompt}.
|
|
@@ -361,7 +361,7 @@ export class DialogContext {
|
|
|
361
361
|
*
|
|
362
362
|
* @param dialogId ID of the prompt dialog to start.
|
|
363
363
|
* @param promptOrOptions The text of the initial prompt to send the user,
|
|
364
|
-
* or the {@link Activity} to send as the initial prompt.
|
|
364
|
+
* or the {@link @microsoft/agents-activity.Activity} to send as the initial prompt.
|
|
365
365
|
* @param choices Optional. Array of choices for the user to choose from,
|
|
366
366
|
* for use with a {@link ChoicePrompt}.
|
|
367
367
|
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result.
|
|
@@ -397,7 +397,7 @@ export class DialogContext {
|
|
|
397
397
|
*
|
|
398
398
|
* @returns {Promise<DialogTurnResult>} a promise resolving to the dialog turn result.
|
|
399
399
|
* @remarks
|
|
400
|
-
* After the call completes, you can check the turn context's {@link TurnContext.responded}
|
|
400
|
+
* After the call completes, you can check the turn context's {@link @microsoft/agents-hosting.TurnContext.responded | TurnContext.responded}
|
|
401
401
|
* property to determine if the dialog sent a reply to the user.
|
|
402
402
|
*
|
|
403
403
|
* The {@link DialogTurnResult.status} of returned object describes
|
package/src/dialogSet.ts
CHANGED
|
@@ -25,8 +25,8 @@ export interface DialogDependencies {
|
|
|
25
25
|
* The constructor for the dialog set should be passed a state property that will be used to
|
|
26
26
|
* persist the dialog stack for the set:
|
|
27
27
|
*
|
|
28
|
-
* To interact with the sets dialogs you can call createcontext with the
|
|
29
|
-
* current {@link TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
28
|
+
* To interact with the sets dialogs you can call `createcontext` with the
|
|
29
|
+
* current {@link @microsoft/agents-hosting.TurnContext}. That will create a {@link DialogContext} that can be used to start or continue
|
|
30
30
|
* execution of the sets dialogs:
|
|
31
31
|
*
|
|
32
32
|
*/
|
|
@@ -39,7 +39,7 @@ export class DialogSet {
|
|
|
39
39
|
* Creates a new DialogSet instance.
|
|
40
40
|
*
|
|
41
41
|
* @remarks
|
|
42
|
-
* If the `dialogState` parameter is not passed in, calls to {@link DialogSet.createcontext |createContext}
|
|
42
|
+
* If the `dialogState` parameter is not passed in, calls to {@link @microsoft/agents-hosting-dialogs.DialogSet.createcontext | createContext}
|
|
43
43
|
* will return an error. You will need to create a {@link DialogContext} for the set manually and
|
|
44
44
|
* pass in your own state object for persisting the sets dialog stack:
|
|
45
45
|
*
|
|
@@ -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 {@link Attachment[]}.
|
|
13
|
+
* By default the prompt will return to the calling dialog an {@link Attachment | Attachment[]}.
|
|
14
14
|
*/
|
|
15
15
|
export class AttachmentPrompt extends Prompt<Attachment[]> {
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-useless-constructor
|
|
@@ -57,7 +57,7 @@ export class ConfirmPrompt extends Prompt<boolean> {
|
|
|
57
57
|
*
|
|
58
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 {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
60
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
61
61
|
* @param choiceDefaults (Optional) Overrides the dictionary of Default Choices on {@link PromptCultureModels.getSupportedCultures | PromptCultureModels.getSupportedCultures} method.
|
|
62
62
|
*/
|
|
63
63
|
constructor (
|
|
@@ -46,7 +46,7 @@ export class DateTimePrompt extends Prompt<DateTimeResolution[]> {
|
|
|
46
46
|
*
|
|
47
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 {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
49
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | 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)
|
|
@@ -30,7 +30,7 @@ export class NumberPrompt extends Prompt<number> {
|
|
|
30
30
|
*
|
|
31
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 {@link TurnContext.activity.locale} is not specified. Defaults to a value of `en-us`.
|
|
33
|
+
* @param defaultLocale (Optional) locale to use if the {@link Activity.locale | 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)
|
package/src/prompts/prompt.ts
CHANGED
|
@@ -140,8 +140,8 @@ export interface PromptValidatorContext<T> {
|
|
|
140
140
|
* Result returned from the prompts recognizer function.
|
|
141
141
|
*
|
|
142
142
|
* @remarks
|
|
143
|
-
* The {@link
|
|
144
|
-
* anything and then the value can be retrieved from {@link
|
|
143
|
+
* The {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.succeeded | recognized.succeeded} field can be checked to determine of the recognizer found
|
|
144
|
+
* anything and then the value can be retrieved from {@link @microsoft/agents-hosting-dialogs.PromptRecognizerResult.value | recognized.value}.
|
|
145
145
|
*/
|
|
146
146
|
readonly recognized: PromptRecognizerResult<T>;
|
|
147
147
|
|