@microsoft/agents-hosting 0.5.4-ga4d0401645 → 0.5.16-g6bdf69cc43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js +4 -4
- package/dist/src/app/adaptiveCards/adaptiveCardsActions.js.map +1 -1
- package/dist/src/app/agentApplication.d.ts +186 -20
- package/dist/src/app/agentApplication.js +235 -33
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/agentApplicationBuilder.d.ts +1 -1
- package/dist/src/app/agentApplicationOptions.d.ts +1 -1
- package/dist/src/app/appRoute.d.ts +5 -0
- package/dist/src/app/authorization.d.ts +293 -0
- package/dist/src/app/authorization.js +375 -0
- package/dist/src/app/authorization.js.map +1 -0
- package/dist/src/app/index.d.ts +1 -1
- package/dist/src/app/index.js +1 -1
- package/dist/src/app/index.js.map +1 -1
- package/dist/src/app/streaming/citation.d.ts +25 -0
- package/dist/src/app/streaming/{AIEntity.js → citation.js} +1 -1
- package/dist/src/app/streaming/citation.js.map +1 -0
- package/dist/src/app/streaming/{utilities.d.ts → citationUtil.d.ts} +3 -3
- package/dist/src/app/streaming/{utilities.js → citationUtil.js} +5 -36
- package/dist/src/app/streaming/citationUtil.js.map +1 -0
- package/dist/src/app/streaming/streamingResponse.d.ts +3 -4
- package/dist/src/app/streaming/streamingResponse.js +24 -22
- package/dist/src/app/streaming/streamingResponse.js.map +1 -1
- package/dist/src/auth/index.d.ts +1 -0
- package/dist/src/auth/index.js +1 -0
- package/dist/src/auth/index.js.map +1 -1
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/auth/msalTokenCredential.d.ts +10 -0
- package/dist/src/auth/msalTokenCredential.js +19 -0
- package/dist/src/auth/msalTokenCredential.js.map +1 -0
- package/dist/src/auth/msalTokenProvider.d.ts +1 -0
- package/dist/src/auth/msalTokenProvider.js +15 -0
- package/dist/src/auth/msalTokenProvider.js.map +1 -1
- package/dist/src/cards/cardFactory.d.ts +2 -2
- package/dist/src/cards/cardFactory.js.map +1 -1
- package/dist/src/oauth/index.d.ts +1 -4
- package/dist/src/oauth/index.js +1 -4
- package/dist/src/oauth/index.js.map +1 -1
- package/dist/src/oauth/oAuthFlow.d.ts +62 -19
- package/dist/src/oauth/oAuthFlow.js +193 -67
- package/dist/src/oauth/oAuthFlow.js.map +1 -1
- package/dist/src/oauth/userTokenClient.d.ts +37 -7
- package/dist/src/oauth/userTokenClient.js +56 -15
- package/dist/src/oauth/userTokenClient.js.map +1 -1
- package/dist/src/oauth/userTokenClient.types.d.ts +147 -0
- package/dist/src/oauth/{oAuthCard.js → userTokenClient.types.js} +1 -1
- package/dist/src/oauth/userTokenClient.types.js.map +1 -0
- package/package.json +5 -4
- package/src/app/adaptiveCards/adaptiveCardsActions.ts +4 -4
- package/src/app/agentApplication.ts +248 -33
- package/src/app/agentApplicationBuilder.ts +1 -1
- package/src/app/agentApplicationOptions.ts +1 -1
- package/src/app/appRoute.ts +6 -0
- package/src/app/authorization.ts +418 -0
- package/src/app/index.ts +1 -1
- package/src/app/streaming/citation.ts +29 -0
- package/src/app/streaming/{utilities.ts → citationUtil.ts} +3 -35
- package/src/app/streaming/streamingResponse.ts +28 -27
- package/src/auth/index.ts +1 -0
- package/src/auth/jwt-middleware.ts +1 -1
- package/src/auth/msalTokenCredential.ts +14 -0
- package/src/auth/msalTokenProvider.ts +17 -1
- package/src/cards/cardFactory.ts +2 -3
- package/src/oauth/index.ts +1 -4
- package/src/oauth/oAuthFlow.ts +226 -70
- package/src/oauth/userTokenClient.ts +62 -19
- package/src/oauth/userTokenClient.types.ts +173 -0
- package/dist/src/app/oauth/authorization.d.ts +0 -87
- package/dist/src/app/oauth/authorization.js +0 -135
- package/dist/src/app/oauth/authorization.js.map +0 -1
- package/dist/src/app/streaming/AIEntity.d.ts +0 -36
- package/dist/src/app/streaming/AIEntity.js.map +0 -1
- package/dist/src/app/streaming/actionCall.d.ts +0 -33
- package/dist/src/app/streaming/actionCall.js +0 -7
- package/dist/src/app/streaming/actionCall.js.map +0 -1
- package/dist/src/app/streaming/clientCitation.d.ts +0 -68
- package/dist/src/app/streaming/clientCitation.js +0 -10
- package/dist/src/app/streaming/clientCitation.js.map +0 -1
- package/dist/src/app/streaming/message.d.ts +0 -106
- package/dist/src/app/streaming/message.js +0 -7
- package/dist/src/app/streaming/message.js.map +0 -1
- package/dist/src/app/streaming/sensitivityUsageInfo.d.ts +0 -40
- package/dist/src/app/streaming/sensitivityUsageInfo.js +0 -3
- package/dist/src/app/streaming/sensitivityUsageInfo.js.map +0 -1
- package/dist/src/app/streaming/utilities.js.map +0 -1
- package/dist/src/oauth/oAuthCard.d.ts +0 -27
- package/dist/src/oauth/oAuthCard.js.map +0 -1
- package/dist/src/oauth/signingResource.d.ts +0 -43
- package/dist/src/oauth/signingResource.js +0 -5
- package/dist/src/oauth/signingResource.js.map +0 -1
- package/dist/src/oauth/tokenExchangeRequest.d.ts +0 -17
- package/dist/src/oauth/tokenExchangeRequest.js +0 -5
- package/dist/src/oauth/tokenExchangeRequest.js.map +0 -1
- package/dist/src/oauth/tokenResponse.d.ts +0 -29
- package/dist/src/oauth/tokenResponse.js +0 -25
- package/dist/src/oauth/tokenResponse.js.map +0 -1
- package/src/app/oauth/authorization.ts +0 -162
- package/src/app/streaming/AIEntity.ts +0 -44
- package/src/app/streaming/actionCall.ts +0 -37
- package/src/app/streaming/clientCitation.ts +0 -102
- package/src/app/streaming/message.ts +0 -125
- package/src/app/streaming/sensitivityUsageInfo.ts +0 -48
- package/src/oauth/oAuthCard.ts +0 -30
- package/src/oauth/signingResource.ts +0 -48
- package/src/oauth/tokenExchangeRequest.ts +0 -20
- package/src/oauth/tokenResponse.ts +0 -43
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { ActionCall } from './actionCall'
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* A message object sent to or received from an LLM.
|
|
10
|
-
* @param TContent Optional. Type of the message content. Defaults to `string`
|
|
11
|
-
*/
|
|
12
|
-
export interface Message<TContent = string> {
|
|
13
|
-
/**
|
|
14
|
-
* The messages role. Typically 'system', 'user', 'assistant', 'tool', 'function'.
|
|
15
|
-
*/
|
|
16
|
-
role: string;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Text of the message.
|
|
20
|
-
*/
|
|
21
|
-
content: TContent | undefined;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Optional. A named function to call.
|
|
25
|
-
*/
|
|
26
|
-
function_call?: FunctionCall;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* The context used for the message.
|
|
30
|
-
*/
|
|
31
|
-
context?: MessageContext;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Optional. Name of the function that was called.
|
|
35
|
-
*/
|
|
36
|
-
name?: string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Optional. The action or tool to be called by the model when using 'tools' augmentation. In OpenAI, this is the tool_calls property returned from the model.
|
|
40
|
-
*/
|
|
41
|
-
action_calls?: ActionCall[];
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Optional. The id of the action called.
|
|
45
|
-
*/
|
|
46
|
-
action_call_id?: string | undefined;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* A named function to call.
|
|
51
|
-
*/
|
|
52
|
-
export interface FunctionCall {
|
|
53
|
-
/**
|
|
54
|
-
* Name of the function to call.
|
|
55
|
-
*/
|
|
56
|
-
name?: string;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Optional. Arguments to pass to the function. Must be deserialized.
|
|
60
|
-
*/
|
|
61
|
-
arguments?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export type MessageContentParts = TextContentPart | ImageContentPart
|
|
65
|
-
|
|
66
|
-
export interface TextContentPart {
|
|
67
|
-
/**
|
|
68
|
-
* Type of the message content. Should always be 'text'.
|
|
69
|
-
*/
|
|
70
|
-
type: 'text';
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* The text of the message.
|
|
74
|
-
*/
|
|
75
|
-
text: string;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface ImageContentPart {
|
|
79
|
-
/**
|
|
80
|
-
* Type of the message content. Should always be 'image_url'.
|
|
81
|
-
*/
|
|
82
|
-
type: 'image_url';
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* The URL of the image.
|
|
86
|
-
*/
|
|
87
|
-
image_url: string | { url: string };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Citations returned by the model.
|
|
92
|
-
*/
|
|
93
|
-
export interface Citation {
|
|
94
|
-
/**
|
|
95
|
-
* The content of the citation.
|
|
96
|
-
*/
|
|
97
|
-
content: string;
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* The title of the citation.
|
|
101
|
-
*/
|
|
102
|
-
title: string | null;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* The URL of the citation.
|
|
106
|
-
*/
|
|
107
|
-
url: string | null;
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* The filepath of the document.
|
|
111
|
-
*/
|
|
112
|
-
filepath: string | null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface MessageContext {
|
|
116
|
-
/**
|
|
117
|
-
* Citations used in the message.
|
|
118
|
-
*/
|
|
119
|
-
citations: Citation[];
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* The intent of the message (what the user wrote).
|
|
123
|
-
*/
|
|
124
|
-
intent: string;
|
|
125
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Sensitivity usage info for content sent to the user. This is used to provide information about the content to the user. See ClientCitation for more information.
|
|
3
|
-
*/
|
|
4
|
-
export interface SensitivityUsageInfo {
|
|
5
|
-
/**
|
|
6
|
-
* Must be "https://schema.org/Message"
|
|
7
|
-
*/
|
|
8
|
-
type: 'https://schema.org/Message';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Required; Set to CreativeWork;
|
|
12
|
-
*/
|
|
13
|
-
'@type': 'CreativeWork';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Sensitivity description of the content
|
|
17
|
-
*/
|
|
18
|
-
description?: string;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Sensitivity title of the content
|
|
22
|
-
*/
|
|
23
|
-
name: string;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Optional; ignored in Teams.
|
|
27
|
-
*/
|
|
28
|
-
position?: number;
|
|
29
|
-
|
|
30
|
-
pattern?: {
|
|
31
|
-
/**
|
|
32
|
-
* Set to DefinedTerm
|
|
33
|
-
*/
|
|
34
|
-
'@type': 'DefinedTerm';
|
|
35
|
-
|
|
36
|
-
inDefinedTermSet: string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Color
|
|
40
|
-
*/
|
|
41
|
-
name: string;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* e.g. #454545
|
|
45
|
-
*/
|
|
46
|
-
termCode: string;
|
|
47
|
-
};
|
|
48
|
-
}
|
package/src/oauth/oAuthCard.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
import { CardAction } from '@microsoft/agents-activity'
|
|
5
|
-
import { TokenExchangeResource, TokenPostResource } from './signingResource'
|
|
6
|
-
/**
|
|
7
|
-
* Represents an OAuth card.
|
|
8
|
-
*/
|
|
9
|
-
export interface OAuthCard {
|
|
10
|
-
/**
|
|
11
|
-
* The buttons associated with the OAuth card.
|
|
12
|
-
*/
|
|
13
|
-
buttons: CardAction[]
|
|
14
|
-
/**
|
|
15
|
-
* The connection name for the OAuth card.
|
|
16
|
-
*/
|
|
17
|
-
connectionName: string
|
|
18
|
-
/**
|
|
19
|
-
* The text content of the OAuth card.
|
|
20
|
-
*/
|
|
21
|
-
text: string
|
|
22
|
-
/**
|
|
23
|
-
* The token exchange resource for the OAuth card.
|
|
24
|
-
*/
|
|
25
|
-
tokenExchangeResource: TokenExchangeResource
|
|
26
|
-
/**
|
|
27
|
-
* The token post resource for the OAuth card.
|
|
28
|
-
*/
|
|
29
|
-
tokenPostResource: TokenPostResource
|
|
30
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Represents a resource for exchanging tokens.
|
|
6
|
-
*/
|
|
7
|
-
export interface TokenExchangeResource {
|
|
8
|
-
/**
|
|
9
|
-
* The ID of the token exchange resource.
|
|
10
|
-
*/
|
|
11
|
-
id?: string
|
|
12
|
-
/**
|
|
13
|
-
* The URI of the token exchange resource.
|
|
14
|
-
*/
|
|
15
|
-
uri?: string
|
|
16
|
-
/**
|
|
17
|
-
* The provider ID for the token exchange resource.
|
|
18
|
-
*/
|
|
19
|
-
providerId?: string
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Represents a resource for posting tokens.
|
|
24
|
-
*/
|
|
25
|
-
export interface TokenPostResource {
|
|
26
|
-
/**
|
|
27
|
-
* The SAS URL for the token post resource.
|
|
28
|
-
*/
|
|
29
|
-
sasUrl?: string
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Represents a resource for signing in.
|
|
34
|
-
*/
|
|
35
|
-
export interface SigningResource {
|
|
36
|
-
/**
|
|
37
|
-
* The link for signing in.
|
|
38
|
-
*/
|
|
39
|
-
signInLink: string,
|
|
40
|
-
/**
|
|
41
|
-
* The resource for token exchange.
|
|
42
|
-
*/
|
|
43
|
-
tokenExchangeResource: TokenExchangeResource,
|
|
44
|
-
/**
|
|
45
|
-
* The resource for token post.
|
|
46
|
-
*/
|
|
47
|
-
tokenPostResource: TokenPostResource
|
|
48
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Represents a request for exchanging tokens.
|
|
6
|
-
*/
|
|
7
|
-
export interface TokenExchangeRequest {
|
|
8
|
-
/**
|
|
9
|
-
* The URI for the token exchange request.
|
|
10
|
-
*/
|
|
11
|
-
uri?: string
|
|
12
|
-
/**
|
|
13
|
-
* The token to be exchanged.
|
|
14
|
-
*/
|
|
15
|
-
token?: string
|
|
16
|
-
/**
|
|
17
|
-
* The ID associated with the token exchange request.
|
|
18
|
-
*/
|
|
19
|
-
id?: string
|
|
20
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Represents the status of an OAuth token request.
|
|
6
|
-
*/
|
|
7
|
-
export enum TokenRequestStatus {
|
|
8
|
-
/**
|
|
9
|
-
* Indicates that the token request was successful.
|
|
10
|
-
*/
|
|
11
|
-
Success = 'Success',
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Indicates that the token request failed.
|
|
15
|
-
*/
|
|
16
|
-
Failed = 'Failed',
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Indicates that the token request is pending.
|
|
20
|
-
*/
|
|
21
|
-
InProgress = 'InProgress',
|
|
22
|
-
|
|
23
|
-
Expired = 'Expired',
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Represents the response containing OAuth token information.
|
|
28
|
-
* This interface encapsulates all data related to an OAuth token response.
|
|
29
|
-
*/
|
|
30
|
-
export interface TokenResponse {
|
|
31
|
-
|
|
32
|
-
status: TokenRequestStatus
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* The OAuth token string, or null if no token is available.
|
|
36
|
-
*/
|
|
37
|
-
token: string | undefined
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* The expiration time of the token, represented as a numeric timestamp.
|
|
41
|
-
*/
|
|
42
|
-
// expires: number
|
|
43
|
-
}
|