@microsoft/agents-hosting 1.1.0-alpha.2 → 1.1.0-alpha.58
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 +10 -6
- package/dist/src/activityWireCompat.js +8 -3
- package/dist/src/activityWireCompat.js.map +1 -1
- package/dist/src/agent-client/agentClient.js +7 -3
- package/dist/src/agent-client/agentClient.js.map +1 -1
- package/dist/src/agent-client/agentResponseHandler.js +6 -2
- package/dist/src/agent-client/agentResponseHandler.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +26 -11
- package/dist/src/app/agentApplication.js +94 -86
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/agentApplicationBuilder.d.ts +2 -2
- package/dist/src/app/agentApplicationBuilder.js.map +1 -1
- package/dist/src/app/agentApplicationOptions.d.ts +9 -2
- package/dist/src/app/appRoute.d.ts +7 -0
- package/dist/src/app/attachmentDownloader.d.ts +13 -3
- package/dist/src/app/attachmentDownloader.js +16 -3
- package/dist/src/app/attachmentDownloader.js.map +1 -1
- package/dist/src/app/{authorization.d.ts → auth/authorization.d.ts} +33 -139
- package/dist/src/app/auth/authorization.js +188 -0
- package/dist/src/app/auth/authorization.js.map +1 -0
- package/dist/src/app/auth/authorizationManager.d.ts +71 -0
- package/dist/src/app/auth/authorizationManager.js +170 -0
- package/dist/src/app/auth/authorizationManager.js.map +1 -0
- package/dist/src/app/auth/handlerStorage.d.ts +36 -0
- package/dist/src/app/auth/handlerStorage.js +62 -0
- package/dist/src/app/auth/handlerStorage.js.map +1 -0
- package/dist/src/app/auth/handlers/agenticAuthorization.d.ts +97 -0
- package/dist/src/app/auth/handlers/agenticAuthorization.js +145 -0
- package/dist/src/app/auth/handlers/agenticAuthorization.js.map +1 -0
- package/dist/src/app/auth/handlers/azureBotAuthorization.d.ts +222 -0
- package/dist/src/app/auth/handlers/azureBotAuthorization.js +428 -0
- package/dist/src/app/auth/handlers/azureBotAuthorization.js.map +1 -0
- package/dist/src/app/auth/handlers/index.d.ts +2 -0
- package/dist/src/app/auth/handlers/index.js +19 -0
- package/dist/src/app/auth/handlers/index.js.map +1 -0
- package/dist/src/app/auth/index.d.ts +2 -0
- package/dist/src/app/auth/index.js +19 -0
- package/dist/src/app/auth/index.js.map +1 -0
- package/dist/src/app/auth/types.d.ts +104 -0
- package/dist/src/app/auth/types.js +24 -0
- package/dist/src/app/auth/types.js.map +1 -0
- package/dist/src/app/index.d.ts +2 -3
- package/dist/src/app/index.js +2 -3
- package/dist/src/app/index.js.map +1 -1
- package/dist/src/app/inputFileDownloader.d.ts +10 -3
- package/dist/src/app/routeList.d.ts +1 -1
- package/dist/src/app/routeList.js +22 -5
- package/dist/src/app/routeList.js.map +1 -1
- package/dist/src/app/streaming/streamingResponse.d.ts +11 -1
- package/dist/src/app/streaming/streamingResponse.js +17 -2
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/app/turnState.d.ts +2 -38
- package/dist/src/app/turnState.js +1 -46
- package/dist/src/app/turnState.js.map +1 -1
- package/dist/src/auth/MemoryCache.d.ts +16 -0
- package/dist/src/auth/MemoryCache.js +58 -0
- package/dist/src/auth/MemoryCache.js.map +1 -0
- package/dist/src/auth/authConfiguration.d.ts +44 -2
- package/dist/src/auth/authConfiguration.js +218 -53
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/authConstants.d.ts +11 -0
- package/dist/src/auth/authConstants.js +15 -0
- package/dist/src/auth/authConstants.js.map +1 -0
- package/dist/src/auth/authProvider.d.ts +23 -0
- package/dist/src/auth/connections.d.ts +40 -0
- package/dist/src/auth/connections.js +7 -0
- package/dist/src/auth/connections.js.map +1 -0
- package/dist/src/auth/index.d.ts +2 -0
- package/dist/src/auth/index.js +2 -0
- package/dist/src/auth/index.js.map +1 -1
- package/dist/src/auth/jwt-middleware.js +31 -18
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/auth/msalConnectionManager.d.ts +63 -0
- package/dist/src/auth/msalConnectionManager.js +124 -0
- package/dist/src/auth/msalConnectionManager.js.map +1 -0
- package/dist/src/auth/msalTokenProvider.d.ts +31 -0
- package/dist/src/auth/msalTokenProvider.js +167 -16
- package/dist/src/auth/msalTokenProvider.js.map +1 -1
- package/dist/src/baseAdapter.d.ts +10 -25
- package/dist/src/baseAdapter.js +2 -15
- package/dist/src/baseAdapter.js.map +1 -1
- package/dist/src/cloudAdapter.d.ts +40 -23
- package/dist/src/cloudAdapter.js +132 -56
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/connector-client/connectorClient.d.ts +9 -0
- package/dist/src/connector-client/connectorClient.js +39 -9
- package/dist/src/connector-client/connectorClient.js.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/oauth/index.d.ts +0 -1
- package/dist/src/oauth/index.js +0 -1
- package/dist/src/oauth/index.js.map +1 -1
- package/dist/src/oauth/userTokenClient.d.ts +30 -13
- package/dist/src/oauth/userTokenClient.js +64 -26
- package/dist/src/oauth/userTokenClient.js.map +1 -1
- package/dist/src/oauth/userTokenClient.types.d.ts +19 -6
- package/dist/src/turnContext.d.ts +7 -1
- package/dist/src/turnContext.js +11 -4
- package/dist/src/turnContext.js.map +1 -1
- package/package.json +10 -6
- package/src/activityWireCompat.ts +8 -3
- package/src/agent-client/agentClient.ts +9 -3
- package/src/agent-client/agentResponseHandler.ts +5 -2
- package/src/app/agentApplication.ts +98 -79
- package/src/app/agentApplicationBuilder.ts +2 -2
- package/src/app/agentApplicationOptions.ts +10 -2
- package/src/app/appRoute.ts +8 -0
- package/src/app/attachmentDownloader.ts +18 -3
- package/src/app/auth/authorization.ts +252 -0
- package/src/app/auth/authorizationManager.ts +213 -0
- package/src/app/auth/handlerStorage.ts +61 -0
- package/src/app/auth/handlers/agenticAuthorization.ts +194 -0
- package/src/app/auth/handlers/azureBotAuthorization.ts +599 -0
- package/src/app/auth/handlers/index.ts +2 -0
- package/src/app/auth/index.ts +2 -0
- package/src/app/auth/types.ts +111 -0
- package/src/app/index.ts +2 -3
- package/src/app/inputFileDownloader.ts +11 -3
- package/src/app/routeList.ts +24 -5
- package/src/app/streaming/streamingResponse.ts +20 -3
- package/src/app/turnState.ts +2 -61
- package/src/auth/MemoryCache.ts +59 -0
- package/src/auth/authConfiguration.ts +258 -52
- package/src/auth/authConstants.ts +11 -0
- package/src/auth/authProvider.ts +31 -0
- package/src/auth/connections.ts +46 -0
- package/src/auth/index.ts +2 -0
- package/src/auth/jwt-middleware.ts +38 -21
- package/src/auth/msalConnectionManager.ts +150 -0
- package/src/auth/msalTokenProvider.ts +209 -9
- package/src/baseAdapter.ts +10 -29
- package/src/cloudAdapter.ts +192 -67
- package/src/connector-client/connectorClient.ts +49 -10
- package/src/index.ts +0 -1
- package/src/oauth/index.ts +0 -1
- package/src/oauth/userTokenClient.ts +79 -23
- package/src/oauth/userTokenClient.types.ts +20 -8
- package/src/turnContext.ts +16 -5
- package/dist/src/app/authorization.js +0 -387
- package/dist/src/app/authorization.js.map +0 -1
- package/dist/src/claimsIdentity.d.ts +0 -35
- package/dist/src/claimsIdentity.js +0 -43
- package/dist/src/claimsIdentity.js.map +0 -1
- package/dist/src/oauth/oAuthFlow.d.ts +0 -119
- package/dist/src/oauth/oAuthFlow.js +0 -316
- package/dist/src/oauth/oAuthFlow.js.map +0 -1
- package/src/app/authorization.ts +0 -432
- package/src/claimsIdentity.ts +0 -47
- package/src/oauth/oAuthFlow.ts +0 -378
package/dist/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting",
|
|
4
|
-
"version": "1.1.0-alpha.
|
|
4
|
+
"version": "1.1.0-alpha.58",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -19,12 +19,13 @@
|
|
|
19
19
|
"main": "dist/src/index.js",
|
|
20
20
|
"types": "dist/src/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@azure/core-auth": "^1.10.
|
|
23
|
-
"@azure/msal-node": "^3.
|
|
24
|
-
"@microsoft/agents-activity": "1.1.0-alpha.
|
|
25
|
-
"axios": "^1.
|
|
22
|
+
"@azure/core-auth": "^1.10.1",
|
|
23
|
+
"@azure/msal-node": "^3.8.0",
|
|
24
|
+
"@microsoft/agents-activity": "1.1.0-alpha.58",
|
|
25
|
+
"axios": "^1.12.2",
|
|
26
26
|
"jsonwebtoken": "^9.0.2",
|
|
27
|
-
"jwks-rsa": "^3.2.0"
|
|
27
|
+
"jwks-rsa": "^3.2.0",
|
|
28
|
+
"object-path": "^0.11.8"
|
|
28
29
|
},
|
|
29
30
|
"license": "MIT",
|
|
30
31
|
"files": [
|
|
@@ -43,5 +44,8 @@
|
|
|
43
44
|
},
|
|
44
45
|
"engines": {
|
|
45
46
|
"node": ">=20.0.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/object-path": "^0.11.4"
|
|
46
50
|
}
|
|
47
51
|
}
|
|
@@ -29,13 +29,18 @@ function normalizeIncomingActivity(payload) {
|
|
|
29
29
|
* @returns The normalized payload object with `agent` replaced by `bot` in `relatesTo`.
|
|
30
30
|
*/
|
|
31
31
|
function normalizeOutgoingActivity(payload) {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const modifiedPayload = JSON.parse(JSON.stringify(payload));
|
|
33
|
+
if (modifiedPayload && modifiedPayload['relatesTo'] && modifiedPayload['relatesTo']['agent']) {
|
|
34
|
+
const relatesTo = modifiedPayload['relatesTo'];
|
|
34
35
|
const ov = relatesTo['agent'];
|
|
35
36
|
delete relatesTo['agent'];
|
|
36
37
|
relatesTo['bot'] = ov;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
+
if (modifiedPayload && modifiedPayload['_channelId']) {
|
|
40
|
+
modifiedPayload['channelId'] = modifiedPayload['_channelId'].toString();
|
|
41
|
+
delete modifiedPayload['_channelId'];
|
|
42
|
+
}
|
|
43
|
+
return modifiedPayload;
|
|
39
44
|
}
|
|
40
45
|
function normalizeTokenExchangeState(payload) {
|
|
41
46
|
if (payload['conversation'] && payload['conversation']['agent']) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activityWireCompat.js","sourceRoot":"","sources":["../../src/activityWireCompat.ts"],"names":[],"mappings":";;AAQA,8DAQC;AAUD,
|
|
1
|
+
{"version":3,"file":"activityWireCompat.js","sourceRoot":"","sources":["../../src/activityWireCompat.ts"],"names":[],"mappings":";;AAQA,8DAQC;AAUD,8DAaC;AAED,kEAQC;AAjDD;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CAAE,OAAY;IACrD,IAAI,OAAO,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;QACxD,MAAM,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAA;QACtC,MAAM,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAA;QAC3B,OAAO,SAAS,CAAC,KAAK,CAAC,CAAA;QACvB,SAAS,CAAC,OAAO,CAAC,GAAG,EAAE,CAAA;IACzB,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CAAE,OAAY;IACrD,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IAC3D,IAAI,eAAe,IAAI,eAAe,CAAC,WAAW,CAAC,IAAI,eAAe,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7F,MAAM,SAAS,GAAG,eAAe,CAAC,WAAW,CAAC,CAAA;QAC9C,MAAM,EAAE,GAAG,SAAS,CAAC,OAAO,CAAC,CAAA;QAC7B,OAAO,SAAS,CAAC,OAAO,CAAC,CAAA;QACzB,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;IACvB,CAAC;IACD,IAAI,eAAe,IAAI,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC;QACrD,eAAe,CAAC,WAAW,CAAC,GAAG,eAAe,CAAC,YAAY,CAAC,CAAC,QAAQ,EAAE,CAAA;QACvE,OAAO,eAAe,CAAC,YAAY,CAAC,CAAA;IACtC,CAAC;IACD,OAAO,eAAe,CAAA;AACxB,CAAC;AAED,SAAgB,2BAA2B,CAAE,OAAY;IACvD,IAAI,OAAO,CAAC,cAAc,CAAC,IAAI,OAAO,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;QAChE,MAAM,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;QAC5C,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QAChC,OAAO,YAAY,CAAC,OAAO,CAAC,CAAA;QAC5B,YAAY,CAAC,KAAK,CAAC,GAAG,EAAE,CAAA;IAC1B,CAAC;IACD,OAAO,OAAO,CAAA;AAChB,CAAC"}
|
|
@@ -49,15 +49,19 @@ class AgentClient {
|
|
|
49
49
|
const convRef = await conversationDataAccessor.set(context, { conversationReference: activity.getConversationReference(), nameRequested: false }, { channelId: activityCopy.channelId, conversationId: activityCopy.conversation.id });
|
|
50
50
|
const stateChanges = JSON.stringify(convRef);
|
|
51
51
|
logger.debug('stateChanges: ', stateChanges);
|
|
52
|
-
const authProvider = new auth_1.MsalTokenProvider();
|
|
53
|
-
const token = await authProvider.getAccessToken(
|
|
52
|
+
const authProvider = new auth_1.MsalTokenProvider(authConfig);
|
|
53
|
+
const token = await authProvider.getAccessToken(this.agentClientConfig.clientId);
|
|
54
54
|
logger.debug('agent request: ', activityCopy);
|
|
55
|
+
let authHeader = ''; // Allow anonymous auth.
|
|
56
|
+
if (token.trim().length > 0) {
|
|
57
|
+
authHeader = `Bearer ${token}`;
|
|
58
|
+
}
|
|
55
59
|
await conversationState.saveChanges(context, false, { channelId: activityCopy.channelId, conversationId: activityCopy.conversation.id });
|
|
56
60
|
const response = await fetch(this.agentClientConfig.endPoint, {
|
|
57
61
|
method: 'POST',
|
|
58
62
|
headers: {
|
|
59
63
|
'Content-Type': 'application/json',
|
|
60
|
-
Authorization:
|
|
64
|
+
Authorization: authHeader,
|
|
61
65
|
'x-ms-conversation-id': activityCopy.conversation.id
|
|
62
66
|
},
|
|
63
67
|
body: JSON.stringify(activityCopy)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentClient.js","sourceRoot":"","sources":["../../../src/agent-client/agentClient.ts"],"names":[],"mappings":";;;AAAA,kCAA8D;AAC9D,gEAAuF;AACvF,+BAAyB;AACzB,8DAAyD;AAIzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,qBAAqB,CAAC,CAAA;AAkC3C;;;GAGG;AACH,MAAa,WAAW;IAItB;;;;;OAKG;IACH,YAAoB,cAAsB;QACxC,IAAI,CAAC,iBAAiB,GAAG,IAAI,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAA;IACrE,CAAC;IAED;;;;;;;;;OASG;IACI,KAAK,CAAC,YAAY,CAAE,QAAkB,EAAE,UAA6B,EAAE,iBAAoC,EAAE,OAAoB;QACtI,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAA;QACrC,YAAY,CAAC,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAA;QAC3D,YAAY,CAAC,SAAS,GAAG,EAAE,GAAG,YAAY,CAAC,SAAS,EAAE,IAAI,EAAE,2BAAS,CAAC,KAAK,EAAE,CAAA;QAC7E,YAAY,CAAC,SAAS,GAAG;YACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;YAC/B,UAAU,EAAE,YAAY,CAAC,EAAE;YAC3B,SAAS,EAAE,YAAY,CAAC,SAAU;YAClC,MAAM,EAAE,YAAY,CAAC,MAAM;YAC3B,YAAY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,CAAC,GAAG,SAAS,aAAa,CAAC,KAAK,SAAS,EAAE,CAAC;gBACvD,OAAO;oBACL,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,WAAW,CAAE;oBAC/C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,WAAW,CAAE;oBAC/C,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,aAAa,CAAE;iBACpD,CAAA;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,yCAAyC,SAAS,EAAE,CAAC,CAAA;YACvE,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;CACF;AAtGD,kCAsGC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configureResponseController = void 0;
|
|
4
4
|
const agents_activity_1 = require("@microsoft/agents-activity");
|
|
5
|
+
const cloudAdapter_1 = require("../cloudAdapter");
|
|
5
6
|
const turnContext_1 = require("../turnContext");
|
|
6
7
|
const uuid_1 = require("uuid");
|
|
7
8
|
const activityWireCompat_1 = require("../activityWireCompat");
|
|
@@ -46,10 +47,13 @@ const configureResponseController = (app, adapter, agent, conversationState) =>
|
|
|
46
47
|
};
|
|
47
48
|
exports.configureResponseController = configureResponseController;
|
|
48
49
|
const handleResponse = (adapter, handler, conversationState) => async (req, res) => {
|
|
50
|
+
var _a, _b;
|
|
49
51
|
const incoming = (0, activityWireCompat_1.normalizeIncomingActivity)(req.body);
|
|
50
52
|
const activity = agents_activity_1.Activity.fromObject(incoming);
|
|
51
53
|
logger.debug('received response: ', activity);
|
|
52
|
-
const
|
|
54
|
+
const connection = adapter.connectionManager.getDefaultConnection();
|
|
55
|
+
const appId = (_b = (_a = connection === null || connection === void 0 ? void 0 : connection.connectionSettings) === null || _a === void 0 ? void 0 : _a.clientId) !== null && _b !== void 0 ? _b : '';
|
|
56
|
+
const myTurnContext = new turnContext_1.TurnContext(adapter, activity, cloudAdapter_1.CloudAdapter.createIdentity(appId));
|
|
53
57
|
const conversationDataAccessor = conversationState.createProperty(req.params.conversationId);
|
|
54
58
|
const conversationRefState = await conversationDataAccessor.get(myTurnContext, undefined, { channelId: activity.channelId, conversationId: req.params.conversationId });
|
|
55
59
|
const conversationRef = JSON.stringify(conversationRefState.conversationReference);
|
|
@@ -69,7 +73,7 @@ const handleResponse = (adapter, handler, conversationState) => async (req, res)
|
|
|
69
73
|
}
|
|
70
74
|
res.status(200).send(response);
|
|
71
75
|
};
|
|
72
|
-
await adapter.continueConversation(conversationRefState.conversationReference, callback
|
|
76
|
+
await adapter.continueConversation(myTurnContext.identity, conversationRefState.conversationReference, callback);
|
|
73
77
|
};
|
|
74
78
|
const applyActivityToTurnContext = (turnContext, activity) => {
|
|
75
79
|
turnContext.activity.channelData = activity.channelData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/agentResponseHandler.ts"],"names":[],"mappings":";;;AAAA,gEAA2F;
|
|
1
|
+
{"version":3,"file":"agentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/agentResponseHandler.ts"],"names":[],"mappings":";;;AAAA,gEAA2F;AAE3F,kDAA8C;AAE9C,gDAA4C;AAC5C,+BAAyB;AACzB,8DAAiE;AACjE,8DAAyD;AAGzD,MAAM,MAAM,GAAG,IAAA,cAAK,EAAC,qBAAqB,CAAC,CAAA;AAM3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACI,MAAM,2BAA2B,GAAG,CAAC,GAAgB,EAAE,OAAqB,EAAE,KAAsB,EAAE,iBAAoC,EAAE,EAAE;IACnJ,GAAG,CAAC,IAAI,CAAC,4EAA4E,EAAE,cAAc,CAAC,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAC,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,CAAC,QAAQ,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAA;IAC7D,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;IACzC,WAAW,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;IACnD,WAAW,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;IACnD,WAAW,CAAC,QAAQ,CAAC,SAAS,GAAG,QAAQ,CAAC,SAAS,CAAA;IACnD,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;IACzC,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;IACzC,WAAW,CAAC,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAA;AAC7C,CAAC,CAAA"}
|
|
@@ -10,13 +10,14 @@ import { AdaptiveCardsActions } from './adaptiveCards';
|
|
|
10
10
|
import { AgentApplicationOptions } from './agentApplicationOptions';
|
|
11
11
|
import { ConversationUpdateEvents } from './conversationUpdateEvents';
|
|
12
12
|
import { AgentExtension } from './extensions';
|
|
13
|
-
import { Authorization } from './authorization';
|
|
14
13
|
import { RouteHandler } from './routeHandler';
|
|
15
14
|
import { RouteSelector } from './routeSelector';
|
|
16
15
|
import { TurnEvents } from './turnEvents';
|
|
17
16
|
import { TurnState } from './turnState';
|
|
18
17
|
import { RouteRank } from './routeRank';
|
|
19
18
|
import { RouteList } from './routeList';
|
|
19
|
+
import { Authorization } from './auth';
|
|
20
|
+
import { JwtPayload } from 'jsonwebtoken';
|
|
20
21
|
/**
|
|
21
22
|
* Event handler function type for application events.
|
|
22
23
|
* @typeParam TState - The state type extending TurnState.
|
|
@@ -64,6 +65,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
64
65
|
protected readonly _beforeTurn: ApplicationEventHandler<TState>[];
|
|
65
66
|
protected readonly _afterTurn: ApplicationEventHandler<TState>[];
|
|
66
67
|
private readonly _adapter?;
|
|
68
|
+
private readonly _authorizationManager?;
|
|
67
69
|
private readonly _authorization?;
|
|
68
70
|
private _typingTimer;
|
|
69
71
|
protected readonly _extensions: AgentExtension<TState>[];
|
|
@@ -160,6 +162,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
160
162
|
* @param isInvokeRoute - Whether this route is for invoke activities. Defaults to false.
|
|
161
163
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
162
164
|
* @param authHandlers - Array of authentication handler names for this route. Defaults to empty array.
|
|
165
|
+
* @param isAgenticRoute - Whether this route is for agentic requests only. Defaults to false.
|
|
163
166
|
* @returns The current instance of the application.
|
|
164
167
|
*
|
|
165
168
|
* @remarks
|
|
@@ -180,7 +183,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
180
183
|
* ```
|
|
181
184
|
*
|
|
182
185
|
*/
|
|
183
|
-
addRoute(selector: RouteSelector, handler: RouteHandler<TState>, isInvokeRoute?: boolean, rank?: number, authHandlers?: string[]): this;
|
|
186
|
+
addRoute(selector: RouteSelector, handler: RouteHandler<TState>, isInvokeRoute?: boolean, rank?: number, authHandlers?: string[], isAgenticRoute?: boolean): this;
|
|
184
187
|
/**
|
|
185
188
|
* Adds a handler for specific activity types.
|
|
186
189
|
*
|
|
@@ -188,6 +191,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
188
191
|
* @param handler - The handler function that will be called when the specified activity type is received.
|
|
189
192
|
* @param authHandlers - Array of authentication handler names for this activity. Defaults to empty array.
|
|
190
193
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
194
|
+
* @param isAgenticRoute - Indicates if this handler is for agentic requests only. Defaults to false.
|
|
191
195
|
* @returns The current instance of the application.
|
|
192
196
|
*
|
|
193
197
|
* @remarks
|
|
@@ -202,7 +206,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
202
206
|
* ```
|
|
203
207
|
*
|
|
204
208
|
*/
|
|
205
|
-
onActivity(type: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank): this;
|
|
209
|
+
onActivity(type: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank, isAgenticRoute?: boolean): this;
|
|
206
210
|
/**
|
|
207
211
|
* Adds a handler for conversation update events.
|
|
208
212
|
*
|
|
@@ -210,6 +214,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
210
214
|
* @param handler - The handler function that will be called when the specified event occurs.
|
|
211
215
|
* @param authHandlers - Array of authentication handler names for this event. Defaults to empty array.
|
|
212
216
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
217
|
+
* @param isAgenticRoute - Indicates if this handler is for agentic requests only. Defaults to false.
|
|
213
218
|
* @returns The current instance of the application.
|
|
214
219
|
* @throws Error if the handler is not a function.
|
|
215
220
|
*
|
|
@@ -229,7 +234,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
229
234
|
* ```
|
|
230
235
|
*
|
|
231
236
|
*/
|
|
232
|
-
onConversationUpdate(event: ConversationUpdateEvents, handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank): this;
|
|
237
|
+
onConversationUpdate(event: ConversationUpdateEvents, handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank, isAgenticRoute?: boolean): this;
|
|
233
238
|
/**
|
|
234
239
|
* Continues a conversation asynchronously.
|
|
235
240
|
*
|
|
@@ -238,7 +243,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
238
243
|
* @returns A promise that resolves when the conversation logic has completed.
|
|
239
244
|
* @throws Error if the adapter is not configured.
|
|
240
245
|
*/
|
|
241
|
-
protected continueConversationAsync(conversationReferenceOrContext: ConversationReference | TurnContext, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
246
|
+
protected continueConversationAsync(botAppIdOrIdentity: string | JwtPayload, conversationReferenceOrContext: ConversationReference | TurnContext, logic: (context: TurnContext) => Promise<void>): Promise<void>;
|
|
242
247
|
/**
|
|
243
248
|
* Adds a handler for message activities that match the specified keyword or pattern.
|
|
244
249
|
*
|
|
@@ -247,6 +252,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
247
252
|
* @param handler - The handler function that will be called when a matching message is received.
|
|
248
253
|
* @param authHandlers - Array of authentication handler names for this message handler. Defaults to empty array.
|
|
249
254
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
255
|
+
* @param isAgenticRoute - Indicates if this handler is for agentic requests only. Defaults to false.
|
|
250
256
|
* @returns The current instance of the application.
|
|
251
257
|
*
|
|
252
258
|
* @remarks
|
|
@@ -267,7 +273,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
267
273
|
* ```
|
|
268
274
|
*
|
|
269
275
|
*/
|
|
270
|
-
onMessage(keyword: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank): this;
|
|
276
|
+
onMessage(keyword: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState) => Promise<void>, authHandlers?: string[], rank?: RouteRank, isAgenticRoute?: boolean): this;
|
|
271
277
|
/**
|
|
272
278
|
* Sets a handler to be called when a user successfully signs in.
|
|
273
279
|
*
|
|
@@ -313,6 +319,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
313
319
|
*
|
|
314
320
|
* @param handler - The handler function that will be called when a message reaction is added.
|
|
315
321
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
322
|
+
* @param isAgenticRoute - Indicates if this handler is for agentic requests only. Defaults to false.
|
|
316
323
|
* @returns The current instance of the application.
|
|
317
324
|
*
|
|
318
325
|
* @remarks
|
|
@@ -330,12 +337,13 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
330
337
|
* ```
|
|
331
338
|
*
|
|
332
339
|
*/
|
|
333
|
-
onMessageReactionAdded(handler: (context: TurnContext, state: TState) => Promise<void>, rank?: RouteRank): this;
|
|
340
|
+
onMessageReactionAdded(handler: (context: TurnContext, state: TState) => Promise<void>, rank?: RouteRank, isAgenticRoute?: boolean): this;
|
|
334
341
|
/**
|
|
335
342
|
* Adds a handler for message reaction removed events.
|
|
336
343
|
*
|
|
337
344
|
* @param handler - The handler function that will be called when a message reaction is removed.
|
|
338
345
|
* @param rank - The rank of the route, used to determine the order of evaluation. Defaults to RouteRank.Unspecified.
|
|
346
|
+
* @param isAgenticRoute - Indicates if this handler is for agentic requests only. Defaults to false.
|
|
339
347
|
* @returns The current instance of the application.
|
|
340
348
|
*
|
|
341
349
|
* @remarks
|
|
@@ -353,7 +361,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
353
361
|
* ```
|
|
354
362
|
*
|
|
355
363
|
*/
|
|
356
|
-
onMessageReactionRemoved(handler: (context: TurnContext, state: TState) => Promise<void>, rank?: RouteRank): this;
|
|
364
|
+
onMessageReactionRemoved(handler: (context: TurnContext, state: TState) => Promise<void>, rank?: RouteRank, isAgenticRoute?: boolean): this;
|
|
357
365
|
/**
|
|
358
366
|
* Executes the application logic for a given turn context.
|
|
359
367
|
*
|
|
@@ -389,8 +397,8 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
389
397
|
* 2. Processes mentions if configured
|
|
390
398
|
* 3. Loads turn state
|
|
391
399
|
* 4. Handles authentication flows
|
|
392
|
-
* 5.
|
|
393
|
-
* 6.
|
|
400
|
+
* 5. Downloads files if file downloaders are configured
|
|
401
|
+
* 6. Executes before-turn event handlers
|
|
394
402
|
* 7. Routes to appropriate handlers
|
|
395
403
|
* 8. Executes after-turn event handlers
|
|
396
404
|
* 9. Saves turn state
|
|
@@ -405,6 +413,10 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
405
413
|
*
|
|
406
414
|
*/
|
|
407
415
|
runInternal(turnContext: TurnContext): Promise<boolean>;
|
|
416
|
+
/**
|
|
417
|
+
* Finds the appropriate route for the given context.
|
|
418
|
+
*/
|
|
419
|
+
private getRoute;
|
|
408
420
|
/**
|
|
409
421
|
* Sends a proactive message to a conversation.
|
|
410
422
|
*
|
|
@@ -427,7 +439,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
427
439
|
* ```
|
|
428
440
|
*
|
|
429
441
|
*/
|
|
430
|
-
sendProactiveActivity(context: TurnContext | ConversationReference, activityOrText: string | Activity, speak?: string, inputHint?: string): Promise<ResourceResponse | undefined>;
|
|
442
|
+
sendProactiveActivity(botAppIdOrIdentity: string | JwtPayload, context: TurnContext | ConversationReference, activityOrText: string | Activity, speak?: string, inputHint?: string): Promise<ResourceResponse | undefined>;
|
|
431
443
|
/**
|
|
432
444
|
* Starts a typing indicator timer for the current turn context.
|
|
433
445
|
*
|
|
@@ -536,6 +548,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
536
548
|
* Creates a selector function for activity types.
|
|
537
549
|
*
|
|
538
550
|
* @param type - The activity type to match. Can be a string, RegExp, or RouteSelector function.
|
|
551
|
+
* @param isAgenticRoute - Indicates if the route is for agentic requests only. Defaults to false.
|
|
539
552
|
* @returns A RouteSelector function that matches the specified activity type.
|
|
540
553
|
*/
|
|
541
554
|
private createActivitySelector;
|
|
@@ -543,6 +556,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
543
556
|
* Creates a selector function for conversation update events.
|
|
544
557
|
*
|
|
545
558
|
* @param event - The conversation update event to match.
|
|
559
|
+
* @param isAgenticRoute - Indicates if the route is for agentic requests only. Defaults to false.
|
|
546
560
|
* @returns A RouteSelector function that matches the specified conversation update event.
|
|
547
561
|
*/
|
|
548
562
|
private createConversationUpdateSelector;
|
|
@@ -550,6 +564,7 @@ export declare class AgentApplication<TState extends TurnState> {
|
|
|
550
564
|
* Creates a selector function for message content matching.
|
|
551
565
|
*
|
|
552
566
|
* @param keyword - The keyword, pattern, or selector function to match against message text.
|
|
567
|
+
* @param isAgenticRoute - Indicates if the route is for agentic requests only. Defaults to false.
|
|
553
568
|
* @returns A RouteSelector function that matches messages based on the specified keyword.
|
|
554
569
|
*/
|
|
555
570
|
private createMessageSelector;
|