@microsoft/agents-hosting 1.0.0 → 1.0.3-g444d99f704
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/package.json +2 -2
- package/dist/src/activityHandler.d.ts +0 -1
- package/dist/src/activityHandler.js +0 -1
- package/dist/src/activityHandler.js.map +1 -1
- package/dist/src/agent-client/agentResponseHandler.d.ts +6 -6
- package/dist/src/agent-client/agentResponseHandler.js +6 -6
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.d.ts +12 -4
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js +5 -1
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +24 -7
- package/dist/src/app/agentApplication.js +24 -7
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/appRoute.d.ts +8 -4
- package/dist/src/app/attachmentDownloader.d.ts +3 -1
- package/dist/src/app/attachmentDownloader.js +3 -1
- package/dist/src/app/attachmentDownloader.js.map +1 -1
- package/dist/src/app/authorization.d.ts +26 -18
- package/dist/src/app/authorization.js +26 -18
- package/dist/src/app/authorization.js.map +1 -1
- package/dist/src/app/routeRank.d.ts +10 -3
- package/dist/src/app/routeRank.js +10 -3
- package/dist/src/app/routeRank.js.map +1 -1
- package/dist/src/app/streaming/streamingResponse.d.ts +23 -2
- package/dist/src/app/streaming/streamingResponse.js +23 -2
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/app/turnState.d.ts +69 -19
- package/dist/src/app/turnState.js +69 -19
- package/dist/src/app/turnState.js.map +1 -1
- package/dist/src/auth/authConfiguration.d.ts +16 -9
- package/dist/src/auth/authConfiguration.js +11 -6
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/jwt-middleware.js +26 -18
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/cards/adaptiveCard.d.ts +1 -1
- package/dist/src/headerPropagation.d.ts +18 -6
- package/dist/src/state/agentState.d.ts +23 -7
- package/dist/src/state/agentState.js +19 -7
- package/dist/src/state/agentState.js.map +1 -1
- package/dist/src/state/agentStatePropertyAccesor.d.ts +63 -41
- package/dist/src/state/agentStatePropertyAccesor.js +43 -32
- package/dist/src/state/agentStatePropertyAccesor.js.map +1 -1
- package/dist/src/storage/fileStorage.d.ts +8 -6
- package/dist/src/storage/fileStorage.js +8 -6
- package/dist/src/storage/fileStorage.js.map +1 -1
- package/dist/src/storage/memoryStorage.d.ts +12 -7
- package/dist/src/storage/memoryStorage.js +12 -7
- package/dist/src/storage/memoryStorage.js.map +1 -1
- package/dist/src/storage/storage.d.ts +18 -1
- package/dist/src/turnContext.d.ts +31 -20
- package/dist/src/turnContext.js +31 -20
- package/dist/src/turnContext.js.map +1 -1
- package/package.json +2 -2
- package/src/activityHandler.ts +0 -1
- package/src/agent-client/agentResponseHandler.ts +6 -6
- package/src/app/adaptiveCards/adaptiveCardsActions.ts +12 -4
- package/src/app/agentApplication.ts +24 -7
- package/src/app/appRoute.ts +8 -4
- package/src/app/attachmentDownloader.ts +3 -1
- package/src/app/authorization.ts +26 -18
- package/src/app/routeRank.ts +10 -3
- package/src/app/streaming/streamingResponse.ts +23 -2
- package/src/app/turnState.ts +69 -19
- package/src/auth/authConfiguration.ts +16 -9
- package/src/auth/jwt-middleware.ts +24 -17
- package/src/cards/adaptiveCard.ts +1 -1
- package/src/headerPropagation.ts +18 -6
- package/src/state/agentState.ts +23 -7
- package/src/state/agentStatePropertyAccesor.ts +63 -41
- package/src/storage/fileStorage.ts +8 -6
- package/src/storage/memoryStorage.ts +12 -7
- package/src/storage/storage.ts +18 -1
- package/src/turnContext.ts +31 -20
|
@@ -29,7 +29,7 @@ const logger = (0, logger_1.debug)('agents:authorization');
|
|
|
29
29
|
* - Sign-in success/failure event handling
|
|
30
30
|
* - Automatic configuration from environment variables
|
|
31
31
|
*
|
|
32
|
-
*
|
|
32
|
+
* @example
|
|
33
33
|
* ```typescript
|
|
34
34
|
* const auth = new Authorization(storage, {
|
|
35
35
|
* 'microsoft': {
|
|
@@ -43,15 +43,12 @@ const logger = (0, logger_1.debug)('agents:authorization');
|
|
|
43
43
|
* await context.sendActivity('Welcome! You are now signed in.');
|
|
44
44
|
* });
|
|
45
45
|
* ```
|
|
46
|
+
*
|
|
46
47
|
*/
|
|
47
48
|
class Authorization {
|
|
48
49
|
/**
|
|
49
50
|
* Creates a new instance of Authorization.
|
|
50
51
|
*
|
|
51
|
-
* @param storage - The storage system to use for state management.
|
|
52
|
-
* @param authHandlers - Configuration for OAuth providers.
|
|
53
|
-
* @throws {Error} If storage is null/undefined or no auth handlers are provided.
|
|
54
|
-
*
|
|
55
52
|
* @remarks
|
|
56
53
|
* The constructor initializes all configured auth handlers and sets up OAuth flows.
|
|
57
54
|
* It automatically configures handler properties from environment variables if not provided:
|
|
@@ -59,7 +56,7 @@ class Authorization {
|
|
|
59
56
|
* - Connection title: {handlerId}_connectionTitle
|
|
60
57
|
* - Connection text: {handlerId}_connectionText
|
|
61
58
|
*
|
|
62
|
-
*
|
|
59
|
+
* @example
|
|
63
60
|
* ```typescript
|
|
64
61
|
* const auth = new Authorization(storage, {
|
|
65
62
|
* 'microsoft': {
|
|
@@ -71,6 +68,11 @@ class Authorization {
|
|
|
71
68
|
* }
|
|
72
69
|
* });
|
|
73
70
|
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param storage - The storage system to use for state management.
|
|
73
|
+
* @param authHandlers - Configuration for OAuth providers.
|
|
74
|
+
* @throws {Error} If storage is null/undefined or no auth handlers are provided.
|
|
75
|
+
*
|
|
74
76
|
*/
|
|
75
77
|
constructor(storage, authHandlers, userTokenClient) {
|
|
76
78
|
var _a, _b, _c, _d;
|
|
@@ -112,19 +114,20 @@ class Authorization {
|
|
|
112
114
|
* @param authHandlerId - ID of the auth handler to use.
|
|
113
115
|
* @returns A promise that resolves to the token response from the OAuth provider.
|
|
114
116
|
* @throws {Error} If the auth handler is not configured.
|
|
115
|
-
* @public
|
|
116
117
|
*
|
|
117
118
|
* @remarks
|
|
118
119
|
* This method retrieves an existing token for the specified auth handler.
|
|
119
120
|
* The token may be cached and will be retrieved from the OAuth provider if needed.
|
|
120
121
|
*
|
|
121
|
-
*
|
|
122
|
+
* @example
|
|
122
123
|
* ```typescript
|
|
123
124
|
* const tokenResponse = await auth.getToken(context, 'microsoft');
|
|
124
125
|
* if (tokenResponse.token) {
|
|
125
126
|
* console.log('User is authenticated');
|
|
126
127
|
* }
|
|
127
128
|
* ```
|
|
129
|
+
*
|
|
130
|
+
* @public
|
|
128
131
|
*/
|
|
129
132
|
async getToken(context, authHandlerId) {
|
|
130
133
|
var _a;
|
|
@@ -154,14 +157,13 @@ class Authorization {
|
|
|
154
157
|
* @param authHandlerId - ID of the auth handler to use.
|
|
155
158
|
* @returns A promise that resolves to the exchanged token response.
|
|
156
159
|
* @throws {Error} If the auth handler is not configured.
|
|
157
|
-
* @public
|
|
158
160
|
*
|
|
159
161
|
* @remarks
|
|
160
162
|
* This method handles token exchange scenarios, particularly for on-behalf-of (OBO) flows.
|
|
161
163
|
* It checks if the current token is exchangeable (e.g., has audience starting with 'api://')
|
|
162
164
|
* and performs the appropriate token exchange using MSAL.
|
|
163
165
|
*
|
|
164
|
-
*
|
|
166
|
+
* @example
|
|
165
167
|
* ```typescript
|
|
166
168
|
* const exchangedToken = await auth.exchangeToken(
|
|
167
169
|
* context,
|
|
@@ -169,6 +171,8 @@ class Authorization {
|
|
|
169
171
|
* 'microsoft'
|
|
170
172
|
* );
|
|
171
173
|
* ```
|
|
174
|
+
*
|
|
175
|
+
* @public
|
|
172
176
|
*/
|
|
173
177
|
async exchangeToken(context, scopes, authHandlerId) {
|
|
174
178
|
var _a;
|
|
@@ -221,7 +225,6 @@ class Authorization {
|
|
|
221
225
|
* @param authHandlerId - ID of the auth handler to use.
|
|
222
226
|
* @returns A promise that resolves to the token response from the OAuth provider.
|
|
223
227
|
* @throws {Error} If the auth handler is not configured.
|
|
224
|
-
* @public
|
|
225
228
|
*
|
|
226
229
|
* @remarks
|
|
227
230
|
* This method manages the complete OAuth authentication flow:
|
|
@@ -232,7 +235,7 @@ class Authorization {
|
|
|
232
235
|
* The method automatically manages the sign-in state and continuation activities,
|
|
233
236
|
* allowing the conversation to resume after successful authentication.
|
|
234
237
|
*
|
|
235
|
-
*
|
|
238
|
+
* @example
|
|
236
239
|
* ```typescript
|
|
237
240
|
* const tokenResponse = await auth.beginOrContinueFlow(context, state, 'microsoft');
|
|
238
241
|
* if (tokenResponse && tokenResponse.token) {
|
|
@@ -240,6 +243,8 @@ class Authorization {
|
|
|
240
243
|
* await context.sendActivity('Authentication successful!');
|
|
241
244
|
* }
|
|
242
245
|
* ```
|
|
246
|
+
*
|
|
247
|
+
* @public
|
|
243
248
|
*/
|
|
244
249
|
async beginOrContinueFlow(context, state, authHandlerId, secRoute = true) {
|
|
245
250
|
var _a, _b, _c, _d, _e;
|
|
@@ -294,14 +299,13 @@ class Authorization {
|
|
|
294
299
|
* @param authHandlerId - Optional ID of the auth handler to use for sign out. If not provided, signs out from all handlers.
|
|
295
300
|
* @returns A promise that resolves when sign out is complete.
|
|
296
301
|
* @throws {Error} If the specified auth handler is not configured.
|
|
297
|
-
* @public
|
|
298
302
|
*
|
|
299
303
|
* @remarks
|
|
300
304
|
* This method clears the user's token and resets the authentication state.
|
|
301
305
|
* If no specific authHandlerId is provided, it signs out from all configured handlers.
|
|
302
306
|
* This ensures complete cleanup of authentication state across all providers.
|
|
303
307
|
*
|
|
304
|
-
*
|
|
308
|
+
* @example
|
|
305
309
|
* ```typescript
|
|
306
310
|
* // Sign out from specific handler
|
|
307
311
|
* await auth.signOut(context, state, 'microsoft');
|
|
@@ -309,6 +313,8 @@ class Authorization {
|
|
|
309
313
|
* // Sign out from all handlers
|
|
310
314
|
* await auth.signOut(context, state);
|
|
311
315
|
* ```
|
|
316
|
+
*
|
|
317
|
+
* @public
|
|
312
318
|
*/
|
|
313
319
|
async signOut(context, state, authHandlerId) {
|
|
314
320
|
var _a;
|
|
@@ -328,20 +334,21 @@ class Authorization {
|
|
|
328
334
|
* Sets a handler to be called when sign-in is successfully completed.
|
|
329
335
|
*
|
|
330
336
|
* @param handler - The handler function to call on successful sign-in.
|
|
331
|
-
* @public
|
|
332
337
|
*
|
|
333
338
|
* @remarks
|
|
334
339
|
* This method allows you to register a callback that will be invoked whenever
|
|
335
340
|
* a user successfully completes the authentication process. The handler receives
|
|
336
341
|
* the turn context, state, and the ID of the auth handler that was used.
|
|
337
342
|
*
|
|
338
|
-
*
|
|
343
|
+
* @example
|
|
339
344
|
* ```typescript
|
|
340
345
|
* auth.onSignInSuccess(async (context, state, authHandlerId) => {
|
|
341
346
|
* await context.sendActivity(`Welcome! You signed in using ${authHandlerId}.`);
|
|
342
347
|
* // Perform any post-authentication setup
|
|
343
348
|
* });
|
|
344
349
|
* ```
|
|
350
|
+
*
|
|
351
|
+
* @public
|
|
345
352
|
*/
|
|
346
353
|
onSignInSuccess(handler) {
|
|
347
354
|
this._signInSuccessHandler = handler;
|
|
@@ -350,7 +357,6 @@ class Authorization {
|
|
|
350
357
|
* Sets a handler to be called when sign-in fails.
|
|
351
358
|
*
|
|
352
359
|
* @param handler - The handler function to call on sign-in failure.
|
|
353
|
-
* @public
|
|
354
360
|
*
|
|
355
361
|
* @remarks
|
|
356
362
|
* This method allows you to register a callback that will be invoked whenever
|
|
@@ -363,13 +369,15 @@ class Authorization {
|
|
|
363
369
|
* - Network connectivity issues
|
|
364
370
|
* - OAuth provider errors
|
|
365
371
|
*
|
|
366
|
-
*
|
|
372
|
+
* @example
|
|
367
373
|
* ```typescript
|
|
368
374
|
* auth.onSignInFailure(async (context, state, authHandlerId, errorMessage) => {
|
|
369
375
|
* await context.sendActivity(`Sign-in failed: ${errorMessage || 'Unknown error'}`);
|
|
370
376
|
* await context.sendActivity('Please try signing in again.');
|
|
371
377
|
* });
|
|
372
378
|
* ```
|
|
379
|
+
*
|
|
380
|
+
* @public
|
|
373
381
|
*/
|
|
374
382
|
onSignInFailure(handler) {
|
|
375
383
|
this._signInFailureHandler = handler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../../src/app/authorization.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,8DAAyD;AAGzD,oCAAoE;AACpE,kCAAqF;AACrF,gEAA8C;AAG9C,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,sBAAsB,CAAC,CAAA;AAuC5C
|
|
1
|
+
{"version":3,"file":"authorization.js","sourceRoot":"","sources":["../../../src/app/authorization.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;AAGH,8DAAyD;AAGzD,oCAAoE;AACpE,kCAAqF;AACrF,gEAA8C;AAG9C,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,sBAAsB,CAAC,CAAA;AAuC5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,aAAa;IAOxB;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,YAAqB,OAAgB,EAAE,YAAmC,EAAE,eAAgC;;QAAvF,YAAO,GAAP,OAAO,CAAS;QAsPrC;;;WAGG;QACH,0BAAqB,GAA+F,IAAI,CAAA;QA0BxH;;;WAGG;QACH,0BAAqB,GAAsH,IAAI,CAAA;QAvR7I,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAA;QAC9D,CAAC;QACD,IAAI,YAAY,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;QACtE,CAAC;QACD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;QAChC,KAAK,MAAM,EAAE,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;YACnC,I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AAO,CAAA;IACtC,CAAC;IAQD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,eAAe,CAAE,OAAiH;QACvI,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAA;IACtC,CAAC;CACF;AA1VD,sCA0VC"}
|
|
@@ -25,24 +25,31 @@
|
|
|
25
25
|
* this.onMessage('dupText', handler1, undefined, RouteRank.Last);
|
|
26
26
|
* this.onMessage('dupText', handler2, undefined, RouteRank.First); // This executes first
|
|
27
27
|
* ```
|
|
28
|
+
*
|
|
28
29
|
*/
|
|
29
30
|
export declare enum RouteRank {
|
|
30
31
|
/**
|
|
31
|
-
* Highest priority rank (value: 0).
|
|
32
|
+
* Highest priority rank (value: 0).
|
|
33
|
+
*
|
|
34
|
+
* Routes with this rank are evaluated
|
|
32
35
|
* before any other routes. Use this for critical routes that must take precedence
|
|
33
36
|
* over all others, such as high-priority message handlers or override handlers
|
|
34
37
|
* that should execute before any other matching routes.
|
|
35
38
|
*/
|
|
36
39
|
First = 0,
|
|
37
40
|
/**
|
|
38
|
-
* Lowest priority rank (value: Number.MAX_VALUE).
|
|
41
|
+
* Lowest priority rank (value: Number.MAX_VALUE).
|
|
42
|
+
*
|
|
43
|
+
* Routes with this rank are
|
|
39
44
|
* evaluated last, after all other routes have been considered. Ideal for
|
|
40
45
|
* catch-all message handlers, fallback activity handlers, or default responses
|
|
41
46
|
* that should only match when no other routes apply.
|
|
42
47
|
*/
|
|
43
48
|
Last,
|
|
44
49
|
/**
|
|
45
|
-
* Default priority rank (value: Number.MAX_VALUE / 2).
|
|
50
|
+
* Default priority rank (value: Number.MAX_VALUE / 2).
|
|
51
|
+
*
|
|
52
|
+
* This is the standard
|
|
46
53
|
* rank for most routes that don't require special ordering. Routes with this
|
|
47
54
|
* rank are evaluated after high-priority routes but before low-priority ones.
|
|
48
55
|
* Use this when you don't need to specify a particular evaluation order.
|
|
@@ -28,25 +28,32 @@ exports.RouteRank = void 0;
|
|
|
28
28
|
* this.onMessage('dupText', handler1, undefined, RouteRank.Last);
|
|
29
29
|
* this.onMessage('dupText', handler2, undefined, RouteRank.First); // This executes first
|
|
30
30
|
* ```
|
|
31
|
+
*
|
|
31
32
|
*/
|
|
32
33
|
var RouteRank;
|
|
33
34
|
(function (RouteRank) {
|
|
34
35
|
/**
|
|
35
|
-
* Highest priority rank (value: 0).
|
|
36
|
+
* Highest priority rank (value: 0).
|
|
37
|
+
*
|
|
38
|
+
* Routes with this rank are evaluated
|
|
36
39
|
* before any other routes. Use this for critical routes that must take precedence
|
|
37
40
|
* over all others, such as high-priority message handlers or override handlers
|
|
38
41
|
* that should execute before any other matching routes.
|
|
39
42
|
*/
|
|
40
43
|
RouteRank[RouteRank["First"] = 0] = "First";
|
|
41
44
|
/**
|
|
42
|
-
* Lowest priority rank (value: Number.MAX_VALUE).
|
|
45
|
+
* Lowest priority rank (value: Number.MAX_VALUE).
|
|
46
|
+
*
|
|
47
|
+
* Routes with this rank are
|
|
43
48
|
* evaluated last, after all other routes have been considered. Ideal for
|
|
44
49
|
* catch-all message handlers, fallback activity handlers, or default responses
|
|
45
50
|
* that should only match when no other routes apply.
|
|
46
51
|
*/
|
|
47
52
|
RouteRank[RouteRank["Last"] = Number.MAX_VALUE] = "Last";
|
|
48
53
|
/**
|
|
49
|
-
* Default priority rank (value: Number.MAX_VALUE / 2).
|
|
54
|
+
* Default priority rank (value: Number.MAX_VALUE / 2).
|
|
55
|
+
*
|
|
56
|
+
* This is the standard
|
|
50
57
|
* rank for most routes that don't require special ordering. Routes with this
|
|
51
58
|
* rank are evaluated after high-priority routes but before low-priority ones.
|
|
52
59
|
* Use this when you don't need to specify a particular evaluation order.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routeRank.js","sourceRoot":"","sources":["../../../src/app/routeRank.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH
|
|
1
|
+
{"version":3,"file":"routeRank.js","sourceRoot":"","sources":["../../../src/app/routeRank.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,IAAY,SA8BX;AA9BD,WAAY,SAAS;IACnB;;;;;;;OAOG;IACH,2CAAS,CAAA;IAET;;;;;;;OAOG;IACH,8BAAO,MAAM,CAAC,SAAS,UAAA,CAAA;IAEvB;;;;;;;OAOG;IACH,qCAAc,MAAM,CAAC,SAAS,GAAG,CAAC,iBAAA,CAAA;AACpC,CAAC,EA9BW,SAAS,yBAAT,SAAS,QA8BpB"}
|
|
@@ -7,6 +7,7 @@ import { TurnContext } from '../../turnContext';
|
|
|
7
7
|
import { Citation } from './citation';
|
|
8
8
|
/**
|
|
9
9
|
* A helper class for streaming responses to the client.
|
|
10
|
+
*
|
|
10
11
|
* @remarks
|
|
11
12
|
* This class is used to send a series of updates to the client in a single response. The expected
|
|
12
13
|
* sequence of calls is:
|
|
@@ -32,13 +33,16 @@ export declare class StreamingResponse {
|
|
|
32
33
|
private _sensitivityLabel?;
|
|
33
34
|
/**
|
|
34
35
|
* Creates a new StreamingResponse instance.
|
|
36
|
+
*
|
|
35
37
|
* @param {TurnContext} context - Context for the current turn of conversation with the user.
|
|
36
38
|
* @returns {TurnContext} - The context for the current turn of conversation with the user.
|
|
37
39
|
*/
|
|
38
40
|
constructor(context: TurnContext);
|
|
39
41
|
/**
|
|
40
42
|
* Gets the stream ID of the current response.
|
|
43
|
+
*
|
|
41
44
|
* @returns {string | undefined} - The stream ID of the current response.
|
|
45
|
+
*
|
|
42
46
|
* @remarks
|
|
43
47
|
* Assigned after the initial update is sent.
|
|
44
48
|
*/
|
|
@@ -49,40 +53,49 @@ export declare class StreamingResponse {
|
|
|
49
53
|
get citations(): ClientCitation[] | undefined;
|
|
50
54
|
/**
|
|
51
55
|
* Gets the number of updates sent for the stream.
|
|
56
|
+
*
|
|
52
57
|
* @returns {number} - The number of updates sent for the stream.
|
|
53
58
|
*/
|
|
54
59
|
get updatesSent(): number;
|
|
55
60
|
/**
|
|
56
61
|
* Queues an informative update to be sent to the client.
|
|
62
|
+
*
|
|
57
63
|
* @param {string} text Text of the update to send.
|
|
58
64
|
*/
|
|
59
65
|
queueInformativeUpdate(text: string): void;
|
|
60
66
|
/**
|
|
61
67
|
* Queues a chunk of partial message text to be sent to the client
|
|
68
|
+
*
|
|
69
|
+
* @param {string} text Partial text of the message to send.
|
|
70
|
+
* @param {Citation[]} citations Citations to be included in the message.
|
|
71
|
+
*
|
|
62
72
|
* @remarks
|
|
63
73
|
* The text we be sent as quickly as possible to the client. Chunks may be combined before
|
|
64
74
|
* delivery to the client.
|
|
65
|
-
*
|
|
66
|
-
* @param {Citation[]} citations Citations to be included in the message.
|
|
75
|
+
*
|
|
67
76
|
*/
|
|
68
77
|
queueTextChunk(text: string, citations?: Citation[]): void;
|
|
69
78
|
/**
|
|
70
79
|
* Ends the stream by sending the final message to the client.
|
|
80
|
+
*
|
|
71
81
|
* @returns {Promise<void>} - A promise representing the async operation
|
|
72
82
|
*/
|
|
73
83
|
endStream(): Promise<void>;
|
|
74
84
|
/**
|
|
75
85
|
* Sets the attachments to attach to the final chunk.
|
|
86
|
+
*
|
|
76
87
|
* @param attachments List of attachments.
|
|
77
88
|
*/
|
|
78
89
|
setAttachments(attachments: Attachment[]): void;
|
|
79
90
|
/**
|
|
80
91
|
* Sets the sensitivity label to attach to the final chunk.
|
|
92
|
+
*
|
|
81
93
|
* @param sensitivityLabel The sensitivty label.
|
|
82
94
|
*/
|
|
83
95
|
setSensitivityLabel(sensitivityLabel: SensitivityUsageInfo): void;
|
|
84
96
|
/**
|
|
85
97
|
* Sets the citations for the full message.
|
|
98
|
+
*
|
|
86
99
|
* @param {Citation[]} citations Citations to be included in the message.
|
|
87
100
|
*/
|
|
88
101
|
setCitations(citations: Citation[]): void;
|
|
@@ -90,32 +103,38 @@ export declare class StreamingResponse {
|
|
|
90
103
|
* Sets the Feedback Loop in Teams that allows a user to
|
|
91
104
|
* give thumbs up or down to a response.
|
|
92
105
|
* Default is `false`.
|
|
106
|
+
*
|
|
93
107
|
* @param enableFeedbackLoop If true, the feedback loop is enabled.
|
|
94
108
|
*/
|
|
95
109
|
setFeedbackLoop(enableFeedbackLoop: boolean): void;
|
|
96
110
|
/**
|
|
97
111
|
* Sets the type of UI to use for the feedback loop.
|
|
112
|
+
*
|
|
98
113
|
* @param feedbackLoopType The type of the feedback loop.
|
|
99
114
|
*/
|
|
100
115
|
setFeedbackLoopType(feedbackLoopType: 'default' | 'custom'): void;
|
|
101
116
|
/**
|
|
102
117
|
* Sets the the Generated by AI label in Teams
|
|
103
118
|
* Default is `false`.
|
|
119
|
+
*
|
|
104
120
|
* @param enableGeneratedByAILabel If true, the label is added.
|
|
105
121
|
*/
|
|
106
122
|
setGeneratedByAILabel(enableGeneratedByAILabel: boolean): void;
|
|
107
123
|
/**
|
|
108
124
|
* Returns the most recently streamed message.
|
|
125
|
+
*
|
|
109
126
|
* @returns The streamed message.
|
|
110
127
|
*/
|
|
111
128
|
getMessage(): string;
|
|
112
129
|
/**
|
|
113
130
|
* Waits for the outgoing activity queue to be empty.
|
|
131
|
+
*
|
|
114
132
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
115
133
|
*/
|
|
116
134
|
waitForQueue(): Promise<void>;
|
|
117
135
|
/**
|
|
118
136
|
* Queues the next chunk of text to be sent to the client.
|
|
137
|
+
*
|
|
119
138
|
* @private
|
|
120
139
|
*/
|
|
121
140
|
private queueNextChunk;
|
|
@@ -125,12 +144,14 @@ export declare class StreamingResponse {
|
|
|
125
144
|
private queueActivity;
|
|
126
145
|
/**
|
|
127
146
|
* Sends any queued activities to the client until the queue is empty.
|
|
147
|
+
*
|
|
128
148
|
* @returns {Promise<void>} - A promise that will be resolved once the queue is empty.
|
|
129
149
|
* @private
|
|
130
150
|
*/
|
|
131
151
|
private drainQueue;
|
|
132
152
|
/**
|
|
133
153
|
* Sends an activity to the client and saves the stream ID returned.
|
|
154
|
+
*
|
|
134
155
|
* @param {Activity} activity - The activity to send.
|
|
135
156
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
136
157
|
* @private
|
|
@@ -11,6 +11,7 @@ const logger_1 = require("@microsoft/agents-activity/logger");
|
|
|
11
11
|
const logger = (0, logger_1.debug)('agents:streamingResponse');
|
|
12
12
|
/**
|
|
13
13
|
* A helper class for streaming responses to the client.
|
|
14
|
+
*
|
|
14
15
|
* @remarks
|
|
15
16
|
* This class is used to send a series of updates to the client in a single response. The expected
|
|
16
17
|
* sequence of calls is:
|
|
@@ -22,6 +23,7 @@ const logger = (0, logger_1.debug)('agents:streamingResponse');
|
|
|
22
23
|
class StreamingResponse {
|
|
23
24
|
/**
|
|
24
25
|
* Creates a new StreamingResponse instance.
|
|
26
|
+
*
|
|
25
27
|
* @param {TurnContext} context - Context for the current turn of conversation with the user.
|
|
26
28
|
* @returns {TurnContext} - The context for the current turn of conversation with the user.
|
|
27
29
|
*/
|
|
@@ -40,7 +42,9 @@ class StreamingResponse {
|
|
|
40
42
|
}
|
|
41
43
|
/**
|
|
42
44
|
* Gets the stream ID of the current response.
|
|
45
|
+
*
|
|
43
46
|
* @returns {string | undefined} - The stream ID of the current response.
|
|
47
|
+
*
|
|
44
48
|
* @remarks
|
|
45
49
|
* Assigned after the initial update is sent.
|
|
46
50
|
*/
|
|
@@ -55,6 +59,7 @@ class StreamingResponse {
|
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* Gets the number of updates sent for the stream.
|
|
62
|
+
*
|
|
58
63
|
* @returns {number} - The number of updates sent for the stream.
|
|
59
64
|
*/
|
|
60
65
|
get updatesSent() {
|
|
@@ -62,6 +67,7 @@ class StreamingResponse {
|
|
|
62
67
|
}
|
|
63
68
|
/**
|
|
64
69
|
* Queues an informative update to be sent to the client.
|
|
70
|
+
*
|
|
65
71
|
* @param {string} text Text of the update to send.
|
|
66
72
|
*/
|
|
67
73
|
queueInformativeUpdate(text) {
|
|
@@ -81,11 +87,14 @@ class StreamingResponse {
|
|
|
81
87
|
}
|
|
82
88
|
/**
|
|
83
89
|
* Queues a chunk of partial message text to be sent to the client
|
|
90
|
+
*
|
|
91
|
+
* @param {string} text Partial text of the message to send.
|
|
92
|
+
* @param {Citation[]} citations Citations to be included in the message.
|
|
93
|
+
*
|
|
84
94
|
* @remarks
|
|
85
95
|
* The text we be sent as quickly as possible to the client. Chunks may be combined before
|
|
86
96
|
* delivery to the client.
|
|
87
|
-
*
|
|
88
|
-
* @param {Citation[]} citations Citations to be included in the message.
|
|
97
|
+
*
|
|
89
98
|
*/
|
|
90
99
|
queueTextChunk(text, citations) {
|
|
91
100
|
if (this._ended) {
|
|
@@ -100,6 +109,7 @@ class StreamingResponse {
|
|
|
100
109
|
}
|
|
101
110
|
/**
|
|
102
111
|
* Ends the stream by sending the final message to the client.
|
|
112
|
+
*
|
|
103
113
|
* @returns {Promise<void>} - A promise representing the async operation
|
|
104
114
|
*/
|
|
105
115
|
endStream() {
|
|
@@ -114,6 +124,7 @@ class StreamingResponse {
|
|
|
114
124
|
}
|
|
115
125
|
/**
|
|
116
126
|
* Sets the attachments to attach to the final chunk.
|
|
127
|
+
*
|
|
117
128
|
* @param attachments List of attachments.
|
|
118
129
|
*/
|
|
119
130
|
setAttachments(attachments) {
|
|
@@ -121,6 +132,7 @@ class StreamingResponse {
|
|
|
121
132
|
}
|
|
122
133
|
/**
|
|
123
134
|
* Sets the sensitivity label to attach to the final chunk.
|
|
135
|
+
*
|
|
124
136
|
* @param sensitivityLabel The sensitivty label.
|
|
125
137
|
*/
|
|
126
138
|
setSensitivityLabel(sensitivityLabel) {
|
|
@@ -128,6 +140,7 @@ class StreamingResponse {
|
|
|
128
140
|
}
|
|
129
141
|
/**
|
|
130
142
|
* Sets the citations for the full message.
|
|
143
|
+
*
|
|
131
144
|
* @param {Citation[]} citations Citations to be included in the message.
|
|
132
145
|
*/
|
|
133
146
|
setCitations(citations) {
|
|
@@ -155,6 +168,7 @@ class StreamingResponse {
|
|
|
155
168
|
* Sets the Feedback Loop in Teams that allows a user to
|
|
156
169
|
* give thumbs up or down to a response.
|
|
157
170
|
* Default is `false`.
|
|
171
|
+
*
|
|
158
172
|
* @param enableFeedbackLoop If true, the feedback loop is enabled.
|
|
159
173
|
*/
|
|
160
174
|
setFeedbackLoop(enableFeedbackLoop) {
|
|
@@ -162,6 +176,7 @@ class StreamingResponse {
|
|
|
162
176
|
}
|
|
163
177
|
/**
|
|
164
178
|
* Sets the type of UI to use for the feedback loop.
|
|
179
|
+
*
|
|
165
180
|
* @param feedbackLoopType The type of the feedback loop.
|
|
166
181
|
*/
|
|
167
182
|
setFeedbackLoopType(feedbackLoopType) {
|
|
@@ -170,6 +185,7 @@ class StreamingResponse {
|
|
|
170
185
|
/**
|
|
171
186
|
* Sets the the Generated by AI label in Teams
|
|
172
187
|
* Default is `false`.
|
|
188
|
+
*
|
|
173
189
|
* @param enableGeneratedByAILabel If true, the label is added.
|
|
174
190
|
*/
|
|
175
191
|
setGeneratedByAILabel(enableGeneratedByAILabel) {
|
|
@@ -177,6 +193,7 @@ class StreamingResponse {
|
|
|
177
193
|
}
|
|
178
194
|
/**
|
|
179
195
|
* Returns the most recently streamed message.
|
|
196
|
+
*
|
|
180
197
|
* @returns The streamed message.
|
|
181
198
|
*/
|
|
182
199
|
getMessage() {
|
|
@@ -184,6 +201,7 @@ class StreamingResponse {
|
|
|
184
201
|
}
|
|
185
202
|
/**
|
|
186
203
|
* Waits for the outgoing activity queue to be empty.
|
|
204
|
+
*
|
|
187
205
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
188
206
|
*/
|
|
189
207
|
waitForQueue() {
|
|
@@ -191,6 +209,7 @@ class StreamingResponse {
|
|
|
191
209
|
}
|
|
192
210
|
/**
|
|
193
211
|
* Queues the next chunk of text to be sent to the client.
|
|
212
|
+
*
|
|
194
213
|
* @private
|
|
195
214
|
*/
|
|
196
215
|
queueNextChunk() {
|
|
@@ -244,6 +263,7 @@ class StreamingResponse {
|
|
|
244
263
|
}
|
|
245
264
|
/**
|
|
246
265
|
* Sends any queued activities to the client until the queue is empty.
|
|
266
|
+
*
|
|
247
267
|
* @returns {Promise<void>} - A promise that will be resolved once the queue is empty.
|
|
248
268
|
* @private
|
|
249
269
|
*/
|
|
@@ -269,6 +289,7 @@ class StreamingResponse {
|
|
|
269
289
|
}
|
|
270
290
|
/**
|
|
271
291
|
* Sends an activity to the client and saves the stream ID returned.
|
|
292
|
+
*
|
|
272
293
|
* @param {Activity} activity - The activity to send.
|
|
273
294
|
* @returns {Promise<void>} - A promise representing the async operation.
|
|
274
295
|
* @private
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"streamingResponse.js","sourceRoot":"","sources":["../../../../src/app/streaming/streamingResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAgI;AAGhI,iDAA6C;AAC7C,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,0BAA0B,CAAC,CAAA;AAEhD
|
|
1
|
+
{"version":3,"file":"streamingResponse.js","sourceRoot":"","sources":["../../../../src/app/streaming/streamingResponse.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAAgI;AAGhI,iDAA6C;AAC7C,8DAAyD;AAEzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,0BAA0B,CAAC,CAAA;AAEhD;;;;;;;;;;GAUG;AACH,MAAa,iBAAiB;IAoB5B;;;;;SAKK;IACL,YAAoB,OAAoB;QAxBhC,kBAAa,GAAW,CAAC,CAAA;QAEzB,aAAQ,GAAW,EAAE,CAAA;QAErB,WAAM,GAAG,KAAK,CAAA;QAEtB,gCAAgC;QACxB,WAAM,GAA0B,EAAE,CAAA;QAElC,iBAAY,GAAG,KAAK,CAAA;QAE5B,8BAA8B;QACtB,wBAAmB,GAAG,KAAK,CAAA;QAE3B,8BAAyB,GAAG,KAAK,CAAA;QACjC,eAAU,GAAsB,EAAE,CAAA;QAUxC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAA;IACzB,CAAC;IAED;;;;;;;SAOK;IAC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