@microsoft/agents-hosting 1.7.1 → 1.8.0-beta.34.g5d543f96c0
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/README.md +64 -2
- package/dist/package.json +3 -3
- package/dist/src/agent-client/agentClient.d.ts +18 -6
- package/dist/src/agent-client/agentClient.js +34 -18
- package/dist/src/agent-client/agentClient.js.map +1 -1
- package/dist/src/agent-client/agentResponseHandler.d.ts +14 -9
- package/dist/src/agent-client/agentResponseHandler.js +10 -5
- package/dist/src/agent-client/agentResponseHandler.js.map +1 -1
- package/dist/src/agent-client/createAgentResponseHandler.d.ts +7 -2
- package/dist/src/agent-client/createAgentResponseHandler.js +55 -8
- package/dist/src/agent-client/createAgentResponseHandler.js.map +1 -1
- package/dist/src/app/adaptiveCards/activityValueParsers.d.ts +1 -4
- package/dist/src/app/adaptiveCards/activityValueParsers.js +2 -6
- package/dist/src/app/adaptiveCards/activityValueParsers.js.map +1 -1
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.d.ts +18 -0
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js +53 -23
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +7 -0
- package/dist/src/app/agentApplication.js +130 -70
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/attachmentDownloader.d.ts +4 -1
- package/dist/src/app/attachmentDownloader.js +27 -5
- package/dist/src/app/attachmentDownloader.js.map +1 -1
- package/dist/src/app/auth/handlers/agenticAuthorization.d.ts +1 -1
- package/dist/src/app/auth/handlers/azureBotAuthorization.d.ts +1 -1
- package/dist/src/app/auth/types.d.ts +3 -4
- package/dist/src/app/index.d.ts +2 -0
- package/dist/src/app/index.js.map +1 -1
- package/dist/src/app/streaming/streamingResponse.js +2 -9
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/app/teamsAttachmentDownloader.d.ts +3 -1
- package/dist/src/app/teamsAttachmentDownloader.js +12 -1
- package/dist/src/app/teamsAttachmentDownloader.js.map +1 -1
- package/dist/src/auth/authConfiguration.js +12 -0
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/index.d.ts +3 -1
- package/dist/src/auth/index.js +3 -1
- package/dist/src/auth/index.js.map +1 -1
- package/dist/src/auth/jwt-middleware.d.ts +6 -0
- package/dist/src/auth/jwt-middleware.js +263 -13
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/auth/msal/msalConnectionSettings.d.ts +8 -0
- package/dist/src/auth/msal/msalHttpRetryHandlerHelper.d.ts +34 -0
- package/dist/src/auth/msal/msalHttpRetryHandlerHelper.js +126 -0
- package/dist/src/auth/msal/msalHttpRetryHandlerHelper.js.map +1 -0
- package/dist/src/auth/msal/msalTokenProvider.d.ts +1 -0
- package/dist/src/auth/msal/msalTokenProvider.js +23 -14
- package/dist/src/auth/msal/msalTokenProvider.js.map +1 -1
- package/dist/src/auth/settings.d.ts +18 -0
- package/dist/src/auth/settings.js +8 -2
- package/dist/src/auth/settings.js.map +1 -1
- package/dist/src/cloudAdapter.d.ts +29 -2
- package/dist/src/cloudAdapter.js +44 -2
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/errorHelper.js +137 -101
- package/dist/src/errorHelper.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/invoke/adaptiveCardInvokeValue.d.ts +5 -0
- package/dist/src/oauth/userTokenClient.d.ts +0 -1
- package/dist/src/oauth/userTokenClient.js +0 -1
- package/dist/src/oauth/userTokenClient.js.map +1 -1
- package/dist/src/observability/traces.js +3 -2
- package/dist/src/observability/traces.js.map +1 -1
- package/dist/src/outboundHostValidator.d.ts +47 -0
- package/dist/src/outboundHostValidator.js +149 -0
- package/dist/src/outboundHostValidator.js.map +1 -0
- package/dist/src/state/agentState.d.ts +5 -0
- package/dist/src/state/agentState.js +16 -3
- package/dist/src/state/agentState.js.map +1 -1
- package/package.json +3 -3
- package/src/agent-client/agentClient.ts +46 -23
- package/src/agent-client/agentResponseHandler.ts +14 -9
- package/src/agent-client/createAgentResponseHandler.ts +70 -9
- package/src/app/adaptiveCards/activityValueParsers.ts +3 -10
- package/src/app/adaptiveCards/adaptiveCardsActions.ts +52 -24
- package/src/app/agentApplication.ts +143 -67
- package/src/app/attachmentDownloader.ts +25 -5
- package/src/app/auth/handlers/agenticAuthorization.ts +1 -1
- package/src/app/auth/handlers/azureBotAuthorization.ts +1 -1
- package/src/app/auth/types.ts +3 -3
- package/src/app/index.ts +8 -0
- package/src/app/streaming/streamingResponse.ts +2 -8
- package/src/app/teamsAttachmentDownloader.ts +11 -1
- package/src/auth/authConfiguration.ts +12 -0
- package/src/auth/index.ts +3 -1
- package/src/auth/jwt-middleware.ts +298 -14
- package/src/auth/msal/msalConnectionSettings.ts +10 -0
- package/src/auth/msal/msalHttpRetryHandlerHelper.ts +161 -0
- package/src/auth/msal/msalTokenProvider.ts +32 -14
- package/src/auth/settings.ts +18 -3
- package/src/cloudAdapter.ts +56 -3
- package/src/errorHelper.ts +155 -114
- package/src/index.ts +1 -0
- package/src/invoke/adaptiveCardInvokeValue.ts +5 -0
- package/src/oauth/userTokenClient.ts +0 -1
- package/src/observability/traces.ts +2 -1
- package/src/outboundHostValidator.ts +172 -0
- package/src/state/agentState.ts +24 -6
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# microsoft/agents-hosting
|
|
1
|
+
# @microsoft/agents-hosting
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
@@ -21,13 +21,28 @@ exposes framework-agnostic primitives that the
|
|
|
21
21
|
|
|
22
22
|
- `createCloudAdapter(agent, authConfig)` — returns `{ adapter, headerPropagation }` for processing incoming activities. Use this from any web framework.
|
|
23
23
|
- `CloudAdapterResult` — return type of `createCloudAdapter`.
|
|
24
|
-
- `createAgentResponseHandler(adapter, agent, conversationState)` — framework-agnostic handler `(req, res, params) => Promise<void>` for the
|
|
24
|
+
- `createAgentResponseHandler(adapter, agent, conversationState)` — framework-agnostic handler `(req, res, params) => Promise<void>` for the authenticated SDK-specific Activity callback route.
|
|
25
25
|
- `AgentResponseHandler`, `AgentResponseHandlerParams`, `AGENT_RESPONSE_ROUTE_PATH` — supporting types and the canonical route path.
|
|
26
26
|
- `WebResponse`, `NextFunction`, `WebRequestParamsCarrier` — minimal structural interfaces (no Express/Fastify imports) used by the cross-framework helpers above.
|
|
27
27
|
|
|
28
28
|
Most consumers should keep using `startServer`/`createAgentRequestHandler` from the
|
|
29
29
|
Express or Fastify packages; reach for these APIs when adapting another framework.
|
|
30
30
|
|
|
31
|
+
This Activity callback flow is used for SDK-specific Activity-protocol
|
|
32
|
+
delegation.
|
|
33
|
+
|
|
34
|
+
The Activity callback handler authenticates requests once through the supplied
|
|
35
|
+
`CloudAdapter`. That boundary validates the token for any configured host connection;
|
|
36
|
+
the handler then verifies that the caller application matches the delegated agent
|
|
37
|
+
recorded for that conversation. Existing route-level `authorizeJWT` middleware is
|
|
38
|
+
redundant but remains compatible. On configured or production hosts, missing,
|
|
39
|
+
invalid, expired, or wrong-audience tokens return `401`. An authenticated caller
|
|
40
|
+
that does not match the delegated agent, or missing, malformed, or pre-upgrade
|
|
41
|
+
delegated state, returns `403`.
|
|
42
|
+
Anonymous callbacks are supported only for unconfigured development hosts
|
|
43
|
+
outside production and emit a registration warning because peer ownership cannot
|
|
44
|
+
be verified. Pre-upgrade conversations must be restarted.
|
|
45
|
+
|
|
31
46
|
## Example Usage based on the AgentApplication object
|
|
32
47
|
|
|
33
48
|
```ts
|
|
@@ -87,3 +102,50 @@ app.post('/api/messages', async (req: Request, res: Response) => {
|
|
|
87
102
|
})
|
|
88
103
|
|
|
89
104
|
```
|
|
105
|
+
|
|
106
|
+
## Outbound request host validation
|
|
107
|
+
|
|
108
|
+
`OutboundHostValidator` provides an opt-in allowlist for server-side requests made
|
|
109
|
+
to activity service URLs and attachment URLs. Enforcement is disabled by default.
|
|
110
|
+
It can be configured with environment variables:
|
|
111
|
+
|
|
112
|
+
```dotenv
|
|
113
|
+
OutboundHostValidator__Enabled=true
|
|
114
|
+
OutboundHostValidator__IncludeDefaultMicrosoftHosts=true
|
|
115
|
+
OutboundHostValidator__Hosts=contoso.com,fabrikam.com
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Indexed host variables such as `OutboundHostValidator__Hosts__0=contoso.com` are
|
|
119
|
+
also supported. A host entry matches both the exact host and its subdomains, and
|
|
120
|
+
is normalized (scheme/port/path stripped; a leading `*.` is accepted and ignored).
|
|
121
|
+
|
|
122
|
+
When enforcement is enabled, `CloudAdapter` rejects inbound activities whose
|
|
123
|
+
`serviceUrl` host is not allowlisted, and it also rejects `serviceurl` claim
|
|
124
|
+
mismatches (equivalent to `CloudAdapterOptions.validateServiceUrl=true`).
|
|
125
|
+
|
|
126
|
+
For explicit configuration, reuse the same immutable policy in the adapter and
|
|
127
|
+
attachment downloaders:
|
|
128
|
+
|
|
129
|
+
```ts
|
|
130
|
+
import {
|
|
131
|
+
AgentApplication,
|
|
132
|
+
AttachmentDownloader,
|
|
133
|
+
CloudAdapter,
|
|
134
|
+
OutboundHostValidator
|
|
135
|
+
} from '@microsoft/agents-hosting'
|
|
136
|
+
|
|
137
|
+
const outboundHostValidator = new OutboundHostValidator({
|
|
138
|
+
enabled: true,
|
|
139
|
+
hosts: ['contoso.com']
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
const adapter = new CloudAdapter(undefined, undefined, undefined, undefined, outboundHostValidator)
|
|
143
|
+
|
|
144
|
+
const agent = new AgentApplication({
|
|
145
|
+
adapter,
|
|
146
|
+
fileDownloaders: [new AttachmentDownloader('inputFiles', outboundHostValidator)]
|
|
147
|
+
})
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
The validator checks the URL supplied to the downloader. Redirects retain native
|
|
151
|
+
`fetch` behavior.
|
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.
|
|
4
|
+
"version": "1.8.0-beta.34.g5d543f96c0",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@azure/core-auth": "1.10.1",
|
|
23
23
|
"@azure/msal-node": "5.1.5",
|
|
24
|
-
"@microsoft/agents-activity": "1.
|
|
25
|
-
"@microsoft/agents-telemetry": "1.
|
|
24
|
+
"@microsoft/agents-activity": "1.8.0-beta.34.g5d543f96c0",
|
|
25
|
+
"@microsoft/agents-telemetry": "1.8.0-beta.34.g5d543f96c0",
|
|
26
26
|
"jsonwebtoken": "9.0.3",
|
|
27
27
|
"jwks-rsa": "4.0.1",
|
|
28
28
|
"zod": "3.25.75"
|
|
@@ -3,7 +3,11 @@ import { Activity, ConversationReference } from '@microsoft/agents-activity';
|
|
|
3
3
|
import { ConversationState } from '../state';
|
|
4
4
|
import { TurnContext } from '../turnContext';
|
|
5
5
|
/**
|
|
6
|
-
* Configuration
|
|
6
|
+
* Configuration for SDK-specific Activity-protocol delegation.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* This configuration is used by the authenticated Activity callback flow and
|
|
10
|
+
* does not describe an open A2A protocol endpoint.
|
|
7
11
|
*/
|
|
8
12
|
export interface AgentClientConfig {
|
|
9
13
|
/**
|
|
@@ -15,12 +19,12 @@ export interface AgentClientConfig {
|
|
|
15
19
|
*/
|
|
16
20
|
clientId: string;
|
|
17
21
|
/**
|
|
18
|
-
* The
|
|
22
|
+
* The delegating host's callback base URL.
|
|
19
23
|
*/
|
|
20
24
|
serviceUrl: string;
|
|
21
25
|
}
|
|
22
26
|
/**
|
|
23
|
-
*
|
|
27
|
+
* Conversation state for an SDK-specific delegated Activity exchange.
|
|
24
28
|
*/
|
|
25
29
|
export interface ConversationData {
|
|
26
30
|
/**
|
|
@@ -31,10 +35,18 @@ export interface ConversationData {
|
|
|
31
35
|
* Reference to the conversation for maintaining context across interactions
|
|
32
36
|
*/
|
|
33
37
|
conversationReference: ConversationReference;
|
|
38
|
+
/**
|
|
39
|
+
* Client ID of the delegated agent allowed to send authenticated Activity
|
|
40
|
+
* callbacks for this conversation.
|
|
41
|
+
*/
|
|
42
|
+
expectedAgentClientId?: string;
|
|
34
43
|
}
|
|
35
44
|
/**
|
|
36
|
-
* Client for
|
|
37
|
-
*
|
|
45
|
+
* Client for SDK-specific Activity-protocol delegation over HTTP.
|
|
46
|
+
*
|
|
47
|
+
* @remarks
|
|
48
|
+
* Manages configuration, authentication, delegated conversation state, and
|
|
49
|
+
* Activity exchange with a target agent.
|
|
38
50
|
*/
|
|
39
51
|
export declare class AgentClient {
|
|
40
52
|
/** Configuration settings for the agent client */
|
|
@@ -47,7 +59,7 @@ export declare class AgentClient {
|
|
|
47
59
|
*/
|
|
48
60
|
constructor(agentConfigKey: string);
|
|
49
61
|
/**
|
|
50
|
-
* Sends an activity to
|
|
62
|
+
* Sends an activity to a delegated agent and stores the callback state.
|
|
51
63
|
*
|
|
52
64
|
* @param activity The activity to send to the target agent
|
|
53
65
|
* @param authConfig Authentication configuration used to obtain access tokens
|
|
@@ -5,13 +5,17 @@ const auth_1 = require("../auth");
|
|
|
5
5
|
const agents_activity_1 = require("@microsoft/agents-activity");
|
|
6
6
|
const crypto_1 = require("crypto");
|
|
7
7
|
const agents_telemetry_1 = require("@microsoft/agents-telemetry");
|
|
8
|
+
const turnContext_1 = require("../turnContext");
|
|
8
9
|
const agents_telemetry_2 = require("@microsoft/agents-telemetry");
|
|
9
10
|
const observability_1 = require("../observability");
|
|
10
11
|
const errorHelper_1 = require("../errorHelper");
|
|
11
12
|
const logger = (0, agents_telemetry_1.debug)('agents:agent-client');
|
|
12
13
|
/**
|
|
13
|
-
* Client for
|
|
14
|
-
*
|
|
14
|
+
* Client for SDK-specific Activity-protocol delegation over HTTP.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Manages configuration, authentication, delegated conversation state, and
|
|
18
|
+
* Activity exchange with a target agent.
|
|
15
19
|
*/
|
|
16
20
|
class AgentClient {
|
|
17
21
|
/**
|
|
@@ -24,7 +28,7 @@ class AgentClient {
|
|
|
24
28
|
this.agentClientConfig = this.loadAgentClientConfig(agentConfigKey);
|
|
25
29
|
}
|
|
26
30
|
/**
|
|
27
|
-
* Sends an activity to
|
|
31
|
+
* Sends an activity to a delegated agent and stores the callback state.
|
|
28
32
|
*
|
|
29
33
|
* @param activity The activity to send to the target agent
|
|
30
34
|
* @param authConfig Authentication configuration used to obtain access tokens
|
|
@@ -53,30 +57,42 @@ class AgentClient {
|
|
|
53
57
|
}
|
|
54
58
|
};
|
|
55
59
|
activityCopy.conversation.id = (0, crypto_1.randomUUID)();
|
|
60
|
+
const delegatedContext = new turnContext_1.TurnContext(context.adapter, activityCopy, context.identity);
|
|
61
|
+
const delegatedStateKey = { channelId: activityCopy.channelId, conversationId: activityCopy.conversation.id };
|
|
56
62
|
const conversationDataAccessor = conversationState.createProperty(activityCopy.conversation.id);
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
await conversationDataAccessor.set(delegatedContext, {
|
|
64
|
+
conversationReference: activity.getConversationReference(),
|
|
65
|
+
nameRequested: false,
|
|
66
|
+
expectedAgentClientId: this.agentClientConfig.clientId
|
|
67
|
+
}, delegatedStateKey);
|
|
68
|
+
logger.debug('stored delegated conversation state');
|
|
60
69
|
const authProvider = new auth_1.MsalTokenProvider(authConfig);
|
|
61
70
|
const token = await authProvider.getAccessToken(this.agentClientConfig.clientId);
|
|
62
|
-
logger.debug('
|
|
71
|
+
logger.debug('sending activity to delegated agent');
|
|
63
72
|
let authHeader = ''; // Allow anonymous auth.
|
|
64
73
|
if (token.trim().length > 0) {
|
|
65
74
|
authHeader = `Bearer ${token}`;
|
|
66
75
|
}
|
|
67
|
-
await conversationState.saveChanges(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
await conversationState.saveChanges(delegatedContext, false, delegatedStateKey);
|
|
77
|
+
let response;
|
|
78
|
+
try {
|
|
79
|
+
response = await fetch(this.agentClientConfig.endPoint, {
|
|
80
|
+
method: 'POST',
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': 'application/json',
|
|
83
|
+
Authorization: authHeader,
|
|
84
|
+
'x-ms-conversation-id': activityCopy.conversation.id
|
|
85
|
+
},
|
|
86
|
+
body: JSON.stringify(activityCopy)
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
await conversationState.delete(delegatedContext, delegatedStateKey);
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
77
93
|
record({ httpStatusCode: response.status.toString() });
|
|
78
94
|
if (!response.ok) {
|
|
79
|
-
await
|
|
95
|
+
await conversationState.delete(delegatedContext, delegatedStateKey);
|
|
80
96
|
throw agents_activity_1.ExceptionHelper.generateException(Error, errorHelper_1.Errors.FailedToPostActivityToAgent, undefined, { statusText: response.statusText });
|
|
81
97
|
}
|
|
82
98
|
return response.statusText;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentClient.js","sourceRoot":"","sources":["../../../src/agent-client/agentClient.ts"],"names":[],"mappings":";;;AAAA,kCAA8D;AAC9D,gEAAwG;AACxG,mCAAmC;AACnC,kEAAmD;
|
|
1
|
+
{"version":3,"file":"agentClient.js","sourceRoot":"","sources":["../../../src/agent-client/agentClient.ts"],"names":[],"mappings":";;;AAAA,kCAA8D;AAC9D,gEAAwG;AACxG,mCAAmC;AACnC,kEAAmD;AAEnD,gDAA4C;AAC5C,kEAAmD;AACnD,oDAA8D;AAC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AG,CAAC,GAAG,SAAS,aAAa,CAAE;iBACpD,CAAA;YACH,CAAC;iBAAM,CAAC;gBACN,MAAM,iCAAe,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAM,CAAC,wBAAwB,EAAE,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAA;YAC3G,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,iCAAe,CAAC,iBAAiB,CAAC,KAAK,EAAE,oBAAM,CAAC,iBAAiB,CAAC,CAAA;QAC1E,CAAC;IACH,CAAC;CACF;AA1HD,kCA0HC"}
|
|
@@ -7,10 +7,10 @@ import { CloudAdapter } from '../cloudAdapter';
|
|
|
7
7
|
import { ConversationState } from '../state';
|
|
8
8
|
/**
|
|
9
9
|
* Minimal application surface needed by {@link configureResponseController} to
|
|
10
|
-
* register the
|
|
11
|
-
* structurally satisfies this
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* register the SDK-specific Activity callback POST route. Express's `Application`
|
|
11
|
+
* structurally satisfies this. Framework integrations that do not satisfy it
|
|
12
|
+
* should wrap {@link createAgentResponseHandler}; Fastify users should use
|
|
13
|
+
* `configureResponseController` from `@microsoft/agents-hosting-fastify`.
|
|
14
14
|
*
|
|
15
15
|
* `WebApp` is a minimal structural shape rather than a richer, named
|
|
16
16
|
* route-registrar contract. It is exported so it has a stable name in the
|
|
@@ -22,24 +22,29 @@ export interface WebApp {
|
|
|
22
22
|
post(path: string, handler: (req: any, res: any) => unknown | Promise<unknown>): unknown;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Registers the authenticated Activity callback endpoint used by SDK-specific
|
|
26
|
+
* Activity-protocol delegation.
|
|
26
27
|
*
|
|
27
28
|
* @remarks
|
|
28
|
-
* This
|
|
29
|
-
*
|
|
30
|
-
* when the agent needs to receive and respond to activities from channels or services that send activities
|
|
31
|
-
* to a specific webhook endpoint.
|
|
29
|
+
* This endpoint is part of the Microsoft Agents SDK delegated-agent callback
|
|
30
|
+
* flow
|
|
32
31
|
*
|
|
33
32
|
* The endpoint expects activities to be sent to:
|
|
34
33
|
* `POST /api/agentresponse/v3/conversations/{conversationId}/activities/{activityId}`
|
|
35
34
|
*
|
|
36
35
|
* The function handles:
|
|
36
|
+
* - Returning `401` when JWT authentication fails
|
|
37
|
+
* - Returning `403` when delegated state is invalid or the authenticated caller
|
|
38
|
+
* does not own the delegated conversation
|
|
37
39
|
* - Normalizing incoming activity data from the request body
|
|
38
40
|
* - Retrieving conversation references from conversation state
|
|
39
41
|
* - Continuing conversations using the stored conversation reference
|
|
40
42
|
* - Processing EndOfConversation activities by cleaning up conversation state
|
|
41
43
|
* - Sending activities through the turn context and returning responses
|
|
42
44
|
*
|
|
45
|
+
* Anonymous callbacks are supported only for unconfigured development hosts
|
|
46
|
+
* outside production and cannot cryptographically prove callback ownership.
|
|
47
|
+
*
|
|
43
48
|
* @param app - The application instance (Express `Application` or any framework that satisfies {@link WebApp}) to configure the route on.
|
|
44
49
|
* @param adapter - The CloudAdapter instance used for processing bot framework activities and managing conversations.
|
|
45
50
|
* @param agent - The ActivityHandler instance that contains the bot's logic for processing different types of activities.
|
|
@@ -7,24 +7,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
exports.configureResponseController = void 0;
|
|
8
8
|
const createAgentResponseHandler_1 = require("./createAgentResponseHandler");
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Registers the authenticated Activity callback endpoint used by SDK-specific
|
|
11
|
+
* Activity-protocol delegation.
|
|
11
12
|
*
|
|
12
13
|
* @remarks
|
|
13
|
-
* This
|
|
14
|
-
*
|
|
15
|
-
* when the agent needs to receive and respond to activities from channels or services that send activities
|
|
16
|
-
* to a specific webhook endpoint.
|
|
14
|
+
* This endpoint is part of the Microsoft Agents SDK delegated-agent callback
|
|
15
|
+
* flow
|
|
17
16
|
*
|
|
18
17
|
* The endpoint expects activities to be sent to:
|
|
19
18
|
* `POST /api/agentresponse/v3/conversations/{conversationId}/activities/{activityId}`
|
|
20
19
|
*
|
|
21
20
|
* The function handles:
|
|
21
|
+
* - Returning `401` when JWT authentication fails
|
|
22
|
+
* - Returning `403` when delegated state is invalid or the authenticated caller
|
|
23
|
+
* does not own the delegated conversation
|
|
22
24
|
* - Normalizing incoming activity data from the request body
|
|
23
25
|
* - Retrieving conversation references from conversation state
|
|
24
26
|
* - Continuing conversations using the stored conversation reference
|
|
25
27
|
* - Processing EndOfConversation activities by cleaning up conversation state
|
|
26
28
|
* - Sending activities through the turn context and returning responses
|
|
27
29
|
*
|
|
30
|
+
* Anonymous callbacks are supported only for unconfigured development hosts
|
|
31
|
+
* outside production and cannot cryptographically prove callback ownership.
|
|
32
|
+
*
|
|
28
33
|
* @param app - The application instance (Express `Application` or any framework that satisfies {@link WebApp}) to configure the route on.
|
|
29
34
|
* @param adapter - The CloudAdapter instance used for processing bot framework activities and managing conversations.
|
|
30
35
|
* @param agent - The ActivityHandler instance that contains the bot's logic for processing different types of activities.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/agentResponseHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,6EAAoG;AAsBpG
|
|
1
|
+
{"version":3,"file":"agentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/agentResponseHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAOH,6EAAoG;AAsBpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACI,MAAM,2BAA2B,GAAG,CACzC,GAAW,EACX,OAAqB,EACrB,KAAsB,EACtB,iBAAoC,EACpC,EAAE;IACF,MAAM,OAAO,GAAG,IAAA,uDAA0B,EAAC,OAAO,EAAE,KAAK,EAAE,iBAAiB,CAAC,CAAA;IAC7E,GAAG,CAAC,IAAI,CAAC,sDAAyB,EAAE,KAAK,EAAE,GAAsC,EAAE,GAAgB,EAAE,EAAE;QACrG,MAAM,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE;YACtB,cAAc,EAAE,GAAG,CAAC,MAAO,CAAC,cAAwB;YACpD,UAAU,EAAE,GAAG,CAAC,MAAO,CAAC,UAAoB;SAC7C,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA;AAbY,QAAA,2BAA2B,+BAavC"}
|
|
@@ -16,7 +16,7 @@ export interface AgentResponseHandlerParams {
|
|
|
16
16
|
activityId: string;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
* Framework-agnostic handler signature for the
|
|
19
|
+
* Framework-agnostic handler signature for the SDK-specific Activity callback endpoint.
|
|
20
20
|
*
|
|
21
21
|
* @remarks
|
|
22
22
|
* The handler is intended to be invoked by a thin framework-specific wrapper (such
|
|
@@ -25,7 +25,7 @@ export interface AgentResponseHandlerParams {
|
|
|
25
25
|
*/
|
|
26
26
|
export type AgentResponseHandler = (req: Request, res: WebResponse, params: AgentResponseHandlerParams) => Promise<void>;
|
|
27
27
|
/**
|
|
28
|
-
* Creates a framework-agnostic handler for the
|
|
28
|
+
* Creates a framework-agnostic handler for the authenticated Activity callback endpoint.
|
|
29
29
|
*
|
|
30
30
|
* This is the core, Express-free implementation used by:
|
|
31
31
|
* - `configureResponseController` in `@microsoft/agents-hosting-express`
|
|
@@ -34,6 +34,11 @@ export type AgentResponseHandler = (req: Request, res: WebResponse, params: Agen
|
|
|
34
34
|
* Both wrappers register the canonical route
|
|
35
35
|
* `POST /api/agentresponse/v3/conversations/:conversationId/activities/:activityId`
|
|
36
36
|
* and forward the parsed body + path parameters to the handler returned here.
|
|
37
|
+
* The handler returns `401` for failed JWT authentication and `403` when the
|
|
38
|
+
* authenticated caller does not match the delegated agent stored for the
|
|
39
|
+
* conversation, or when that delegated state is missing or malformed.
|
|
40
|
+
*
|
|
41
|
+
* This callback contract is SDK-specific and is not the open A2A protocol.
|
|
37
42
|
*
|
|
38
43
|
* @param adapter - The CloudAdapter used for processing activities and managing conversations.
|
|
39
44
|
* @param agent - The ActivityHandler containing the agent logic.
|
|
@@ -12,9 +12,10 @@ const crypto_1 = require("crypto");
|
|
|
12
12
|
const activityWireCompat_1 = require("../activityWireCompat");
|
|
13
13
|
const errorHelper_1 = require("../errorHelper");
|
|
14
14
|
const agents_telemetry_1 = require("@microsoft/agents-telemetry");
|
|
15
|
+
const jwt_middleware_1 = require("../auth/jwt-middleware");
|
|
15
16
|
const logger = (0, agents_telemetry_1.debug)('agents:agent-client');
|
|
16
17
|
/**
|
|
17
|
-
* Creates a framework-agnostic handler for the
|
|
18
|
+
* Creates a framework-agnostic handler for the authenticated Activity callback endpoint.
|
|
18
19
|
*
|
|
19
20
|
* This is the core, Express-free implementation used by:
|
|
20
21
|
* - `configureResponseController` in `@microsoft/agents-hosting-express`
|
|
@@ -23,6 +24,11 @@ const logger = (0, agents_telemetry_1.debug)('agents:agent-client');
|
|
|
23
24
|
* Both wrappers register the canonical route
|
|
24
25
|
* `POST /api/agentresponse/v3/conversations/:conversationId/activities/:activityId`
|
|
25
26
|
* and forward the parsed body + path parameters to the handler returned here.
|
|
27
|
+
* The handler returns `401` for failed JWT authentication and `403` when the
|
|
28
|
+
* authenticated caller does not match the delegated agent stored for the
|
|
29
|
+
* conversation, or when that delegated state is missing or malformed.
|
|
30
|
+
*
|
|
31
|
+
* This callback contract is SDK-specific and is not the open A2A protocol.
|
|
26
32
|
*
|
|
27
33
|
* @param adapter - The CloudAdapter used for processing activities and managing conversations.
|
|
28
34
|
* @param agent - The ActivityHandler containing the agent logic.
|
|
@@ -30,26 +36,57 @@ const logger = (0, agents_telemetry_1.debug)('agents:agent-client');
|
|
|
30
36
|
* @returns A handler `(req, res, params) => Promise<void>`.
|
|
31
37
|
*/
|
|
32
38
|
const createAgentResponseHandler = (adapter, agent, conversationState) => {
|
|
39
|
+
var _a;
|
|
40
|
+
const appId = (_a = adapter.getClientId()) !== null && _a !== void 0 ? _a : '';
|
|
41
|
+
const anonymousDevelopment = appId.length === 0 && process.env.NODE_ENV !== 'production';
|
|
42
|
+
if (anonymousDevelopment) {
|
|
43
|
+
emitAgentResponseWarning('The agent-response endpoint is using anonymous authentication outside production. Callback ownership cannot be cryptographically verified; configure a client ID before deployment.');
|
|
44
|
+
}
|
|
33
45
|
return async (req, res, params) => {
|
|
34
|
-
var _a, _b;
|
|
46
|
+
var _a, _b, _c, _d, _e;
|
|
47
|
+
let middlewareError;
|
|
48
|
+
let nextCalled = false;
|
|
49
|
+
await adapter.authorizeRequest(req, res, (err) => {
|
|
50
|
+
nextCalled = true;
|
|
51
|
+
middlewareError = err;
|
|
52
|
+
});
|
|
53
|
+
if (middlewareError) {
|
|
54
|
+
throw middlewareError;
|
|
55
|
+
}
|
|
56
|
+
if (!nextCalled || res.headersSent) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
35
59
|
if (!req.body) {
|
|
36
60
|
throw agents_activity_1.ExceptionHelper.generateException(TypeError, errorHelper_1.Errors.MissingRequestBody);
|
|
37
61
|
}
|
|
38
62
|
const incoming = (0, activityWireCompat_1.normalizeIncomingActivity)(req.body);
|
|
39
63
|
const activity = agents_activity_1.Activity.fromObject(incoming);
|
|
40
|
-
logger.debug('received response
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const myTurnContext = new turnContext_1.TurnContext(adapter, activity, cloudAdapter_1.CloudAdapter.createIdentity(appId));
|
|
64
|
+
logger.debug('received delegated agent response');
|
|
65
|
+
const continuationAudience = (_a = (0, jwt_middleware_1.getAuthorizedAudience)(req)) !== null && _a !== void 0 ? _a : appId;
|
|
66
|
+
const myTurnContext = new turnContext_1.TurnContext(adapter, activity, cloudAdapter_1.CloudAdapter.createIdentity(continuationAudience));
|
|
44
67
|
const conversationDataAccessor = conversationState.createProperty(params.conversationId);
|
|
45
|
-
const
|
|
68
|
+
const incomingChannelId = activity.channelId;
|
|
69
|
+
const conversationRefState = await conversationDataAccessor.get(myTurnContext, undefined, { channelId: incomingChannelId, conversationId: params.conversationId });
|
|
70
|
+
if (!isDelegatedConversationState(conversationRefState)) {
|
|
71
|
+
res.status(403).send({ 'agent-response-auth-error': 'caller is not authorized for this conversation' });
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const callerClientId = (_c = (_b = req.user) === null || _b === void 0 ? void 0 : _b.azp) !== null && _c !== void 0 ? _c : (_d = req.user) === null || _d === void 0 ? void 0 : _d.appid;
|
|
75
|
+
const anonymousCaller = anonymousDevelopment && ((_e = req.user) === null || _e === void 0 ? void 0 : _e.name) === 'anonymous';
|
|
76
|
+
const delegatedAgentMatches = anonymousCaller || (typeof callerClientId === 'string' &&
|
|
77
|
+
callerClientId.length > 0 &&
|
|
78
|
+
callerClientId.toLowerCase() === conversationRefState.expectedAgentClientId.toLowerCase());
|
|
79
|
+
if (!delegatedAgentMatches) {
|
|
80
|
+
res.status(403).send({ 'agent-response-auth-error': 'caller is not authorized for this conversation' });
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
46
83
|
const callback = async (turnContext) => {
|
|
47
84
|
activity.applyConversationReference(conversationRefState.conversationReference);
|
|
48
85
|
turnContext.activity.id = params.activityId;
|
|
49
86
|
let response;
|
|
50
87
|
let responseContentType;
|
|
51
88
|
if (activity.type === agents_activity_1.ActivityTypes.EndOfConversation) {
|
|
52
|
-
await
|
|
89
|
+
await conversationState.delete(myTurnContext, { channelId: incomingChannelId, conversationId: params.conversationId });
|
|
53
90
|
applyActivityToTurnContext(turnContext, activity);
|
|
54
91
|
await agent.run(turnContext);
|
|
55
92
|
response = (0, crypto_1.randomUUID)().replace(/-/g, '');
|
|
@@ -70,6 +107,16 @@ const createAgentResponseHandler = (adapter, agent, conversationState) => {
|
|
|
70
107
|
};
|
|
71
108
|
};
|
|
72
109
|
exports.createAgentResponseHandler = createAgentResponseHandler;
|
|
110
|
+
function isDelegatedConversationState(state) {
|
|
111
|
+
return typeof (state === null || state === void 0 ? void 0 : state.conversationReference) === 'object' &&
|
|
112
|
+
state.conversationReference !== null &&
|
|
113
|
+
typeof state.expectedAgentClientId === 'string' &&
|
|
114
|
+
state.expectedAgentClientId.trim().length > 0;
|
|
115
|
+
}
|
|
116
|
+
function emitAgentResponseWarning(message) {
|
|
117
|
+
console.warn(`[agents:agent-client] ${message}`);
|
|
118
|
+
logger.warn(message);
|
|
119
|
+
}
|
|
73
120
|
const applyActivityToTurnContext = (turnContext, activity) => {
|
|
74
121
|
turnContext.activity.channelData = activity.channelData;
|
|
75
122
|
turnContext.activity.code = activity.code;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAgentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/createAgentResponseHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAA4G;AAE5G,kDAA8C;AAG9C,gDAA4C;AAC5C,mCAAmC;AACnC,8DAAiE;AACjE,gDAAuC;AACvC,kEAAmD;
|
|
1
|
+
{"version":3,"file":"createAgentResponseHandler.js","sourceRoot":"","sources":["../../../src/agent-client/createAgentResponseHandler.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,gEAA4G;AAE5G,kDAA8C;AAG9C,gDAA4C;AAC5C,mCAAmC;AACnC,8DAAiE;AACjE,gDAAuC;AACvC,kEAAmD;AAEnD,2DAA8D;AAE9D,MAAM,MAAM,GAAG,IAAA,wBAAK,EAAC,qBAAqB,CAAC,CAAA;AAmC3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACI,MAAM,0BAA0B,GAAG,CACxC,OAAqB,EACrB,KAAsB,EACtB,iBAAoC,EACd,EAAE;;IACxB,MAAM,KAAK,GAAG,MAAA,OAAO,CAAC,WAAW,EAAE,mCAAI,EAAE,CAAA;IACzC,MAAM,oBAAoB,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,CAAA;IACxF,IAAI,oBAAoB,EAAE,CAAC;QACzB,wBAAwB,CACtB,qLAAqL,CACtL,CAAA;IACH,CA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ChD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;AACtB,CAAC;AAED,MAAM,0BAA0B,GAAG,CAAC,WAAwB,EAAE,QAAkB,EAAE,EAAE;IAClF,WAAW,CAAC,QAAQ,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAA;IACvD,WAAW,CAAC,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAA;IACzC,WAAW,CAAC,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAA;IACjD,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAA;IAC7C,WAAW,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;AAED;;;GAGG;AACU,QAAA,yBAAyB,GAAG,4EAA4E,CAAA"}
|
|
@@ -25,10 +25,7 @@ export declare function parseValueActionName(value: unknown): string;
|
|
|
25
25
|
*/
|
|
26
26
|
export declare function parseValueContinuation(value: unknown): string;
|
|
27
27
|
interface ValueAction {
|
|
28
|
-
action:
|
|
29
|
-
type: string;
|
|
30
|
-
verb: string;
|
|
31
|
-
};
|
|
28
|
+
action: AdaptiveCardInvokeAction;
|
|
32
29
|
}
|
|
33
30
|
/**
|
|
34
31
|
* Parses the given value as a value action execute selector.
|
|
@@ -18,7 +18,6 @@ exports.parseValueAgentActivityPreview = parseValueAgentActivityPreview;
|
|
|
18
18
|
exports.parseValueCommandId = parseValueCommandId;
|
|
19
19
|
const zod_1 = require("zod");
|
|
20
20
|
const agents_activity_1 = require("@microsoft/agents-activity");
|
|
21
|
-
// import { MessagingExtensionQuery, messagingExtensionQueryZodSchema } from '../messageExtension/messagingExtensionQuery'
|
|
22
21
|
const adaptiveCardsSearchParams_1 = require("./adaptiveCardsSearchParams");
|
|
23
22
|
const errorHelper_1 = require("../../errorHelper");
|
|
24
23
|
/**
|
|
@@ -73,7 +72,7 @@ function parseValueActionExecuteSelector(value) {
|
|
|
73
72
|
const actionZodSchema = zod_1.z.object({
|
|
74
73
|
type: zod_1.z.string().min(1),
|
|
75
74
|
verb: zod_1.z.string().min(1)
|
|
76
|
-
});
|
|
75
|
+
}).passthrough();
|
|
77
76
|
const actionValueExecuteSelector = zod_1.z.object({
|
|
78
77
|
action: actionZodSchema
|
|
79
78
|
});
|
|
@@ -83,10 +82,7 @@ function parseValueActionExecuteSelector(value) {
|
|
|
83
82
|
}
|
|
84
83
|
const parsedValue = safeParsedValue.data;
|
|
85
84
|
return {
|
|
86
|
-
action:
|
|
87
|
-
type: parsedValue.action.type,
|
|
88
|
-
verb: parsedValue.action.verb
|
|
89
|
-
}
|
|
85
|
+
action: parsedValue.action
|
|
90
86
|
};
|
|
91
87
|
}
|
|
92
88
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activityValueParsers.js","sourceRoot":"","sources":["../../../../src/app/adaptiveCards/activityValueParsers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;
|
|
1
|
+
{"version":3,"file":"activityValueParsers.js","sourceRoot":"","sources":["../../../../src/app/adaptiveCards/activityValueParsers.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAaH,4CA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,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IAC1E,OAAO;QACL,kBAAkB,EAAE,WAAW,CAAC,kBAAkB;KACnD,CAAA;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB,CAAE,KAAc;IAGjD,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;QAClC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7B,CAAC,CAAA;IACF,MAAM,WAAW,GAAG,kBAAkB,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;IACjE,OAAO;QACL,SAAS,EAAE,WAAW,CAAC,SAAS;KACjC,CAAA;AACH,CAAC"}
|
|
@@ -67,6 +67,24 @@ export declare class AdaptiveCardsActions<TState extends TurnState> {
|
|
|
67
67
|
* @param verb - A string, RegExp, RouteSelector, or an array of these to match the action verb.
|
|
68
68
|
* @param handler - A function to handle the action execution.
|
|
69
69
|
* @returns The Teams application instance.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* The delivery behavior depends on the action trigger and
|
|
73
|
+
* `adaptiveCardsOptions.actionExecuteResponseType`:
|
|
74
|
+
*
|
|
75
|
+
* | Response type | Automatic trigger | Manual trigger |
|
|
76
|
+
* | --- | --- | --- |
|
|
77
|
+
* | `REPLACE_FOR_INTERACTOR` | User response | User response |
|
|
78
|
+
* | `REPLACE_FOR_ALL` | User response | Shared update |
|
|
79
|
+
* | `NEW_MESSAGE_FOR_ALL` | User response | New message |
|
|
80
|
+
*
|
|
81
|
+
* - **User response** — Return an Adaptive Card invoke response only to the requesting or interacting user.
|
|
82
|
+
* - **Shared update** — Update the shared activity for all users and return an Adaptive Card invoke response to the interacting user.
|
|
83
|
+
* - **New message** — Send a new activity for all users and return a message acknowledgement to the interacting user.
|
|
84
|
+
*
|
|
85
|
+
* Automatic refresh actions always return only an Adaptive Card invoke response.
|
|
86
|
+
* Updating or sending a refreshable card while processing an automatic refresh
|
|
87
|
+
* would cause Teams to invoke the refresh action again.
|
|
70
88
|
*/
|
|
71
89
|
actionExecute<TData = Record<string, any>>(verb: string | RegExp | RouteSelector | (string | RegExp | RouteSelector)[], handler: (context: TurnContext, state: TState, data: TData) => Promise<AdaptiveCard | string>): AgentApplication<TState>;
|
|
72
90
|
/**
|