@microsoft/agents-hosting 0.2.9-g361635b71c → 0.2.14
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/activityHandler.d.ts +304 -46
- package/dist/src/activityHandler.js +298 -45
- package/dist/src/activityHandler.js.map +1 -1
- package/dist/src/agent-client/agentClient.d.ts +50 -0
- package/dist/src/agent-client/agentClient.js +28 -0
- package/dist/src/agent-client/agentClient.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +256 -3
- package/dist/src/app/agentApplication.js +256 -0
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/agentApplicationBuilder.d.ts +32 -0
- package/dist/src/app/agentApplicationBuilder.js +32 -0
- package/dist/src/app/agentApplicationBuilder.js.map +1 -1
- package/dist/src/app/appMemory.d.ts +34 -0
- package/dist/src/app/{memory.js → appMemory.js} +1 -1
- package/dist/src/app/appMemory.js.map +1 -0
- package/dist/src/app/index.d.ts +3 -0
- package/dist/src/app/index.js +3 -0
- package/dist/src/app/index.js.map +1 -1
- package/dist/src/app/turnEvents.d.ts +6 -0
- package/dist/src/app/turnState.d.ts +2 -2
- package/dist/src/app/turnStateEntry.d.ts +32 -0
- package/dist/src/app/turnStateEntry.js +32 -0
- package/dist/src/app/turnStateEntry.js.map +1 -1
- package/dist/src/cards/index.d.ts +1 -0
- package/dist/src/cards/index.js +1 -0
- package/dist/src/cards/index.js.map +1 -1
- package/dist/src/cloudAdapter.d.ts +25 -3
- package/dist/src/cloudAdapter.js +25 -3
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/getProductInfo.d.ts +6 -0
- package/dist/src/getProductInfo.js +6 -0
- package/dist/src/getProductInfo.js.map +1 -1
- package/dist/src/logger.d.ts +34 -2
- package/dist/src/logger.js +35 -0
- package/dist/src/logger.js.map +1 -1
- package/dist/src/state/agentState.d.ts +79 -27
- package/dist/src/state/agentState.js +58 -27
- package/dist/src/state/agentState.js.map +1 -1
- package/dist/src/state/agentStatePropertyAccesor.d.ts +67 -11
- package/dist/src/state/agentStatePropertyAccesor.js +58 -11
- package/dist/src/state/agentStatePropertyAccesor.js.map +1 -1
- package/dist/src/storage/memoryStorage.d.ts +48 -14
- package/dist/src/storage/memoryStorage.js +48 -14
- package/dist/src/storage/memoryStorage.js.map +1 -1
- package/dist/src/storage/storage.d.ts +43 -13
- package/dist/src/turnContext.d.ts +142 -56
- package/dist/src/turnContext.js +123 -53
- package/dist/src/turnContext.js.map +1 -1
- package/package.json +5 -5
- package/src/activityHandler.ts +304 -46
- package/src/agent-client/agentClient.ts +55 -5
- package/src/app/agentApplication.ts +259 -2
- package/src/app/agentApplicationBuilder.ts +32 -0
- package/src/app/appMemory.ts +38 -0
- package/src/app/index.ts +3 -0
- package/src/app/turnEvents.ts +6 -0
- package/src/app/turnState.ts +2 -2
- package/src/app/turnStateEntry.ts +32 -0
- package/src/cards/index.ts +1 -0
- package/src/cloudAdapter.ts +28 -3
- package/src/getProductInfo.ts +7 -0
- package/src/logger.ts +34 -1
- package/src/state/agentState.ts +81 -29
- package/src/state/agentStatePropertyAccesor.ts +67 -11
- package/src/storage/memoryStorage.ts +48 -14
- package/src/storage/storage.ts +51 -18
- package/src/turnContext.ts +142 -56
- package/dist/src/app/memory.d.ts +0 -10
- package/dist/src/app/memory.js.map +0 -1
- package/src/app/memory.ts +0 -14
|
@@ -6,103 +6,361 @@ import { SearchInvokeResponse } from './invoke/searchInvokeResponse';
|
|
|
6
6
|
import { AdaptiveCardInvokeResponse } from './invoke/adaptiveCardInvokeResponse';
|
|
7
7
|
/** Symbol key for invoke response */
|
|
8
8
|
export declare const INVOKE_RESPONSE_KEY: unique symbol;
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Type definition for agent handler function
|
|
11
|
+
* @param context - The turn context for the current turn of conversation
|
|
12
|
+
* @param next - The function to call to continue to the next middleware or handler
|
|
13
|
+
* @returns A promise representing the asynchronous operation
|
|
14
|
+
*/
|
|
10
15
|
export type AgentHandler = (context: TurnContext, next: () => Promise<void>) => Promise<any>;
|
|
11
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Handles incoming activities from channels and dispatches them to the appropriate handlers.
|
|
18
|
+
*
|
|
19
|
+
* The ActivityHandler provides a foundation for handling different types of activities
|
|
20
|
+
* in an agent application. It processes various activity types such as messages, conversation updates,
|
|
21
|
+
* message reactions, etc., and routes them to the appropriate handler methods.
|
|
22
|
+
*
|
|
23
|
+
* Developers can extend this class to implement custom handlers for specific activity types
|
|
24
|
+
* or override existing ones to customize the behavior.
|
|
25
|
+
*/
|
|
12
26
|
export declare class ActivityHandler {
|
|
27
|
+
/**
|
|
28
|
+
* Collection of handlers registered for different activity types
|
|
29
|
+
* @protected
|
|
30
|
+
*/
|
|
13
31
|
protected readonly handlers: {
|
|
14
32
|
[type: string]: AgentHandler[];
|
|
15
33
|
};
|
|
16
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Registers a handler for the Turn activity type.
|
|
36
|
+
* This is called for all activities regardless of type.
|
|
37
|
+
* @param handler - The handler to register
|
|
38
|
+
* @returns The current instance for method chaining
|
|
39
|
+
*/
|
|
17
40
|
onTurn(handler: AgentHandler): this;
|
|
18
|
-
/**
|
|
41
|
+
/**
|
|
42
|
+
* Registers a handler for the MembersAdded activity type.
|
|
43
|
+
* This is called when new members are added to the conversation.
|
|
44
|
+
* @param handler - The handler to register
|
|
45
|
+
* @returns The current instance for method chaining
|
|
46
|
+
*/
|
|
19
47
|
onMembersAdded(handler: AgentHandler): this;
|
|
20
|
-
/**
|
|
48
|
+
/**
|
|
49
|
+
* Registers a handler for the MembersRemoved activity type.
|
|
50
|
+
* This is called when members are removed from the conversation.
|
|
51
|
+
* @param handler - The handler to register
|
|
52
|
+
* @returns The current instance for method chaining
|
|
53
|
+
*/
|
|
21
54
|
onMembersRemoved(handler: AgentHandler): this;
|
|
22
|
-
/**
|
|
55
|
+
/**
|
|
56
|
+
* Registers a handler for the Message activity type.
|
|
57
|
+
* This is called when a message is received from the user.
|
|
58
|
+
* @param handler - The handler to register
|
|
59
|
+
* @returns The current instance for method chaining
|
|
60
|
+
*/
|
|
23
61
|
onMessage(handler: AgentHandler): this;
|
|
24
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Registers a handler for the MessageUpdate activity type.
|
|
64
|
+
* This is called when a message is updated.
|
|
65
|
+
* @param handler - The handler to register
|
|
66
|
+
* @returns The current instance for method chaining
|
|
67
|
+
*/
|
|
25
68
|
onMessageUpdate(handler: AgentHandler): this;
|
|
26
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Registers a handler for the MessageDelete activity type.
|
|
71
|
+
* This is called when a message is deleted.
|
|
72
|
+
* @param handler - The handler to register
|
|
73
|
+
* @returns The current instance for method chaining
|
|
74
|
+
*/
|
|
27
75
|
onMessageDelete(handler: AgentHandler): this;
|
|
28
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Registers a handler for the ConversationUpdate activity type.
|
|
78
|
+
* This is called when the conversation is updated, such as when members are added or removed.
|
|
79
|
+
* @param handler - The handler to register
|
|
80
|
+
* @returns The current instance for method chaining
|
|
81
|
+
*/
|
|
29
82
|
onConversationUpdate(handler: AgentHandler): this;
|
|
30
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Registers a handler for the MessageReaction activity type.
|
|
85
|
+
* This is called when reactions are added or removed from messages.
|
|
86
|
+
* @param handler - The handler to register
|
|
87
|
+
* @returns The current instance for method chaining
|
|
88
|
+
*/
|
|
31
89
|
onMessageReaction(handler: AgentHandler): this;
|
|
32
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* Registers a handler for the ReactionsAdded activity type.
|
|
92
|
+
* This is called when reactions are added to messages.
|
|
93
|
+
* @param handler - The handler to register
|
|
94
|
+
* @returns The current instance for method chaining
|
|
95
|
+
*/
|
|
33
96
|
onReactionsAdded(handler: AgentHandler): this;
|
|
34
|
-
/**
|
|
97
|
+
/**
|
|
98
|
+
* Registers a handler for the ReactionsRemoved activity type.
|
|
99
|
+
* This is called when reactions are removed from messages.
|
|
100
|
+
* @param handler - The handler to register
|
|
101
|
+
* @returns The current instance for method chaining
|
|
102
|
+
*/
|
|
35
103
|
onReactionsRemoved(handler: AgentHandler): this;
|
|
36
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* Registers a handler for the Typing activity type.
|
|
106
|
+
* This is called when a typing indicator is received.
|
|
107
|
+
* @param handler - The handler to register
|
|
108
|
+
* @returns The current instance for method chaining
|
|
109
|
+
*/
|
|
37
110
|
onTyping(handler: AgentHandler): this;
|
|
38
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* Registers a handler for the InstallationUpdate activity type.
|
|
113
|
+
* This is called when an agent is installed or uninstalled.
|
|
114
|
+
* @param handler - The handler to register
|
|
115
|
+
* @returns The current instance for method chaining
|
|
116
|
+
*/
|
|
39
117
|
onInstallationUpdate(handler: AgentHandler): this;
|
|
40
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* Registers a handler for the InstallationUpdateAdd activity type.
|
|
120
|
+
* This is called when an agent is installed or upgraded.
|
|
121
|
+
* @param handler - The handler to register
|
|
122
|
+
* @returns The current instance for method chaining
|
|
123
|
+
*/
|
|
41
124
|
onInstallationUpdateAdd(handler: AgentHandler): this;
|
|
42
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* Registers a handler for the InstallationUpdateRemove activity type.
|
|
127
|
+
* This is called when an agent is uninstalled or downgraded.
|
|
128
|
+
* @param handler - The handler to register
|
|
129
|
+
* @returns The current instance for method chaining
|
|
130
|
+
*/
|
|
43
131
|
onInstallationUpdateRemove(handler: AgentHandler): this;
|
|
44
|
-
/**
|
|
132
|
+
/**
|
|
133
|
+
* Registers a handler for the EndOfConversation activity type.
|
|
134
|
+
* This is called when the conversation ends.
|
|
135
|
+
* @param handler - The handler to register
|
|
136
|
+
* @returns The current instance for method chaining
|
|
137
|
+
*/
|
|
45
138
|
onEndOfConversation(handler: AgentHandler): this;
|
|
46
|
-
/**
|
|
139
|
+
/**
|
|
140
|
+
* Registers a handler for the SignInInvoke activity type.
|
|
141
|
+
* This is called when a sign-in is requested.
|
|
142
|
+
* @param handler - The handler to register
|
|
143
|
+
* @returns The current instance for method chaining
|
|
144
|
+
*/
|
|
47
145
|
onSignInInvoke(handler: AgentHandler): this;
|
|
48
|
-
/**
|
|
146
|
+
/**
|
|
147
|
+
* Registers a handler for unrecognized activity types.
|
|
148
|
+
* This is called when an activity type is not recognized.
|
|
149
|
+
* @param handler - The handler to register
|
|
150
|
+
* @returns The current instance for method chaining
|
|
151
|
+
*/
|
|
49
152
|
onUnrecognizedActivityType(handler: AgentHandler): this;
|
|
50
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* Registers an activity event handler for the _dialog_ event, emitted as the last event for an incoming activity.
|
|
155
|
+
* This handler is called after all other handlers have been processed.
|
|
156
|
+
* @param handler - The handler to register
|
|
157
|
+
* @returns The current instance for method chaining
|
|
158
|
+
*/
|
|
51
159
|
onDialog(handler: AgentHandler): this;
|
|
52
|
-
/**
|
|
160
|
+
/**
|
|
161
|
+
* Runs the activity handler pipeline.
|
|
162
|
+
* This method is called to process an incoming activity through the registered handlers.
|
|
163
|
+
* @param context - The turn context for the current turn of conversation
|
|
164
|
+
* @throws Error if context is missing, activity is missing, or activity type is missing
|
|
165
|
+
*/
|
|
53
166
|
run(context: TurnContext): Promise<void>;
|
|
54
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* Handles the Turn activity.
|
|
169
|
+
* This method is called for every activity type and dispatches to the appropriate handler.
|
|
170
|
+
* @param context - The turn context for the current turn of conversation
|
|
171
|
+
* @protected
|
|
172
|
+
*/
|
|
55
173
|
protected onTurnActivity(context: TurnContext): Promise<void>;
|
|
56
|
-
/**
|
|
174
|
+
/**
|
|
175
|
+
* Handles the Message activity.
|
|
176
|
+
* This method processes incoming message activities.
|
|
177
|
+
* @param context - The turn context for the current turn of conversation
|
|
178
|
+
* @protected
|
|
179
|
+
*/
|
|
57
180
|
protected onMessageActivity(context: TurnContext): Promise<void>;
|
|
58
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* Handles the MessageUpdate activity.
|
|
183
|
+
* This method processes message update activities.
|
|
184
|
+
* @param context - The turn context for the current turn of conversation
|
|
185
|
+
* @protected
|
|
186
|
+
*/
|
|
59
187
|
protected onMessageUpdateActivity(context: TurnContext): Promise<void>;
|
|
60
|
-
/**
|
|
188
|
+
/**
|
|
189
|
+
* Handles the MessageDelete activity.
|
|
190
|
+
* This method processes message deletion activities.
|
|
191
|
+
* @param context - The turn context for the current turn of conversation
|
|
192
|
+
* @protected
|
|
193
|
+
*/
|
|
61
194
|
protected onMessageDeleteActivity(context: TurnContext): Promise<void>;
|
|
62
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Handles the ConversationUpdate activity.
|
|
197
|
+
* This method processes conversation update activities.
|
|
198
|
+
* @param context - The turn context for the current turn of conversation
|
|
199
|
+
* @protected
|
|
200
|
+
*/
|
|
63
201
|
protected onConversationUpdateActivity(context: TurnContext): Promise<void>;
|
|
64
|
-
/**
|
|
202
|
+
/**
|
|
203
|
+
* Handles the SignInInvoke activity.
|
|
204
|
+
* This method processes sign-in invoke activities.
|
|
205
|
+
* @param context - The turn context for the current turn of conversation
|
|
206
|
+
* @protected
|
|
207
|
+
*/
|
|
65
208
|
protected onSigninInvokeActivity(context: TurnContext): Promise<void>;
|
|
66
|
-
/**
|
|
209
|
+
/**
|
|
210
|
+
* Handles the Invoke activity.
|
|
211
|
+
* This method processes various invoke activities based on their name.
|
|
212
|
+
* @param context - The turn context for the current turn of conversation
|
|
213
|
+
* @returns An invoke response object with status and body
|
|
214
|
+
* @protected
|
|
215
|
+
*/
|
|
67
216
|
protected onInvokeActivity(context: TurnContext): Promise<InvokeResponse>;
|
|
68
|
-
/**
|
|
217
|
+
/**
|
|
218
|
+
* Handles the AdaptiveCardInvoke activity.
|
|
219
|
+
* This method processes adaptive card invoke activities.
|
|
220
|
+
* @param _context - The turn context for the current turn of conversation
|
|
221
|
+
* @param _invokeValue - The adaptive card invoke value
|
|
222
|
+
* @returns A promise that resolves to an adaptive card invoke response
|
|
223
|
+
* @protected
|
|
224
|
+
*/
|
|
69
225
|
protected onAdaptiveCardInvoke(_context: TurnContext, _invokeValue: AdaptiveCardInvokeValue): Promise<AdaptiveCardInvokeResponse>;
|
|
70
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* Handles the SearchInvoke activity.
|
|
228
|
+
* This method processes search invoke activities.
|
|
229
|
+
* @param _context - The turn context for the current turn of conversation
|
|
230
|
+
* @param _invokeValue - The search invoke value
|
|
231
|
+
* @returns A promise that resolves to a search invoke response
|
|
232
|
+
* @protected
|
|
233
|
+
*/
|
|
71
234
|
protected onSearchInvoke(_context: TurnContext, _invokeValue: SearchInvokeValue): Promise<SearchInvokeResponse>;
|
|
72
|
-
/**
|
|
235
|
+
/**
|
|
236
|
+
* Retrieves the SearchInvoke value from the activity.
|
|
237
|
+
* This method extracts and validates the search invoke value from an activity.
|
|
238
|
+
* @param activity - The activity to extract the search invoke value from
|
|
239
|
+
* @returns The validated search invoke value
|
|
240
|
+
* @private
|
|
241
|
+
*/
|
|
73
242
|
private getSearchInvokeValue;
|
|
74
|
-
/**
|
|
243
|
+
/**
|
|
244
|
+
* Retrieves the AdaptiveCardInvoke value from the activity.
|
|
245
|
+
* This method extracts and validates the adaptive card invoke value from an activity.
|
|
246
|
+
* @param activity - The activity to extract the adaptive card invoke value from
|
|
247
|
+
* @returns The validated adaptive card invoke value
|
|
248
|
+
* @private
|
|
249
|
+
*/
|
|
75
250
|
private getAdaptiveCardInvokeValue;
|
|
76
|
-
/**
|
|
251
|
+
/**
|
|
252
|
+
* Creates an error response for AdaptiveCardInvoke.
|
|
253
|
+
* This method creates an error response for adaptive card invoke activities.
|
|
254
|
+
* @param statusCode - The HTTP status code for the response
|
|
255
|
+
* @param code - The error code
|
|
256
|
+
* @param message - The error message
|
|
257
|
+
* @returns An adaptive card invoke error response
|
|
258
|
+
* @private
|
|
259
|
+
*/
|
|
77
260
|
private createAdaptiveCardInvokeErrorResponse;
|
|
78
|
-
/**
|
|
261
|
+
/**
|
|
262
|
+
* Handles the MessageReaction activity.
|
|
263
|
+
* This method processes message reaction activities.
|
|
264
|
+
* @param context - The turn context for the current turn of conversation
|
|
265
|
+
* @protected
|
|
266
|
+
*/
|
|
79
267
|
protected onMessageReactionActivity(context: TurnContext): Promise<void>;
|
|
80
|
-
/**
|
|
268
|
+
/**
|
|
269
|
+
* Handles the EndOfConversation activity.
|
|
270
|
+
* This method processes end of conversation activities.
|
|
271
|
+
* @param context - The turn context for the current turn of conversation
|
|
272
|
+
* @protected
|
|
273
|
+
*/
|
|
81
274
|
protected onEndOfConversationActivity(context: TurnContext): Promise<void>;
|
|
82
|
-
/**
|
|
275
|
+
/**
|
|
276
|
+
* Handles the Typing activity.
|
|
277
|
+
* This method processes typing indicator activities.
|
|
278
|
+
* @param context - The turn context for the current turn of conversation
|
|
279
|
+
* @protected
|
|
280
|
+
*/
|
|
83
281
|
protected onTypingActivity(context: TurnContext): Promise<void>;
|
|
84
|
-
/**
|
|
282
|
+
/**
|
|
283
|
+
* Handles the InstallationUpdate activity.
|
|
284
|
+
* This method processes installation update activities.
|
|
285
|
+
* @param context - The turn context for the current turn of conversation
|
|
286
|
+
* @protected
|
|
287
|
+
*/
|
|
85
288
|
protected onInstallationUpdateActivity(context: TurnContext): Promise<void>;
|
|
86
|
-
/**
|
|
289
|
+
/**
|
|
290
|
+
* Handles unrecognized activity types.
|
|
291
|
+
* This method processes activities with unrecognized types.
|
|
292
|
+
* @param context - The turn context for the current turn of conversation
|
|
293
|
+
* @protected
|
|
294
|
+
*/
|
|
87
295
|
protected onUnrecognizedActivity(context: TurnContext): Promise<void>;
|
|
88
|
-
/**
|
|
296
|
+
/**
|
|
297
|
+
* Dispatches the ConversationUpdate activity.
|
|
298
|
+
* This method dispatches conversation update activities to the appropriate handlers.
|
|
299
|
+
* @param context - The turn context for the current turn of conversation
|
|
300
|
+
* @protected
|
|
301
|
+
*/
|
|
89
302
|
protected dispatchConversationUpdateActivity(context: TurnContext): Promise<void>;
|
|
90
|
-
/**
|
|
303
|
+
/**
|
|
304
|
+
* Dispatches the MessageReaction activity.
|
|
305
|
+
* This method dispatches message reaction activities to the appropriate handlers.
|
|
306
|
+
* @param context - The turn context for the current turn of conversation
|
|
307
|
+
* @protected
|
|
308
|
+
*/
|
|
91
309
|
protected dispatchMessageReactionActivity(context: TurnContext): Promise<void>;
|
|
92
|
-
/**
|
|
310
|
+
/**
|
|
311
|
+
* Dispatches the MessageUpdate activity.
|
|
312
|
+
* This method dispatches message update activities to the appropriate handlers.
|
|
313
|
+
* @param context - The turn context for the current turn of conversation
|
|
314
|
+
* @protected
|
|
315
|
+
*/
|
|
93
316
|
protected dispatchMessageUpdateActivity(context: TurnContext): Promise<void>;
|
|
94
|
-
/**
|
|
317
|
+
/**
|
|
318
|
+
* Dispatches the MessageDelete activity.
|
|
319
|
+
* This method dispatches message delete activities to the appropriate handlers.
|
|
320
|
+
* @param context - The turn context for the current turn of conversation
|
|
321
|
+
* @protected
|
|
322
|
+
*/
|
|
95
323
|
protected dispatchMessageDeleteActivity(context: TurnContext): Promise<void>;
|
|
96
324
|
/**
|
|
97
325
|
* Returns the default next event handler.
|
|
326
|
+
* This method creates a function that calls the default handler.
|
|
327
|
+
* @param context - The turn context for the current turn of conversation
|
|
328
|
+
* @returns A function that calls the default handler
|
|
329
|
+
* @protected
|
|
98
330
|
*/
|
|
99
331
|
protected defaultNextEvent(context: TurnContext): () => Promise<void>;
|
|
100
|
-
/**
|
|
332
|
+
/**
|
|
333
|
+
* Registers a handler for a specific activity type.
|
|
334
|
+
* This method adds a handler to the list of handlers for a specific activity type.
|
|
335
|
+
* @param type - The activity type to register the handler for
|
|
336
|
+
* @param handler - The handler to register
|
|
337
|
+
* @returns The current instance for method chaining
|
|
338
|
+
* @protected
|
|
339
|
+
*/
|
|
101
340
|
protected on(type: string, handler: AgentHandler): this;
|
|
102
|
-
/**
|
|
341
|
+
/**
|
|
342
|
+
* Executes the handlers for a specific activity type.
|
|
343
|
+
* This method calls each registered handler for the specified activity type.
|
|
344
|
+
* @param context - The turn context for the current turn of conversation
|
|
345
|
+
* @param type - The activity type to handle
|
|
346
|
+
* @param onNext - The function to call when all handlers have been executed
|
|
347
|
+
* @returns The value returned by the last handler
|
|
348
|
+
* @protected
|
|
349
|
+
*/
|
|
103
350
|
protected handle(context: TurnContext, type: string, onNext: () => Promise<void>): Promise<any>;
|
|
104
|
-
/**
|
|
351
|
+
/**
|
|
352
|
+
* Creates an InvokeResponse object.
|
|
353
|
+
* This static method creates an invoke response with the specified body.
|
|
354
|
+
* @param body - The body of the response
|
|
355
|
+
* @returns An invoke response object with status and body
|
|
356
|
+
* @protected
|
|
357
|
+
*/
|
|
105
358
|
protected static createInvokeResponse(body?: any): InvokeResponse;
|
|
106
|
-
/**
|
|
359
|
+
/**
|
|
360
|
+
* Dispatches the Event activity.
|
|
361
|
+
* This method dispatches event activities to the appropriate handlers.
|
|
362
|
+
* @param context - The turn context for the current turn of conversation
|
|
363
|
+
* @protected
|
|
364
|
+
*/
|
|
107
365
|
protected dispatchEventActivity(context: TurnContext): Promise<void>;
|
|
108
366
|
}
|